runtime: redo stack map entries to avoid false retention
Change two-bit stack map entries to encode:
0 = dead
1 = scalar
2 = pointer
3 = multiword
If multiword, the two-bit entry for the following word encodes:
0 = string
1 = slice
2 = iface
3 = eface
That way, during stack scanning we can check if a string
is zero length or a slice has zero capacity. We can avoid
following the contained pointer in those cases. It is safe
to do so because it can never be dereferenced, and it is
desirable to do so because it may cause false retention
of the following block in memory.
Slice feature turned off until issue 7564 is fixed.
Update issue 7549
s/bug NNNN/issue NNNN/ for the auto-linking/updating magic. On Wed, Mar 19, 2014 at 12:55 AM, ...
12 years, 7 months ago
(2014-03-19 16:00:47 UTC)
#2
s/bug NNNN/issue NNNN/ for the auto-linking/updating magic.
On Wed, Mar 19, 2014 at 12:55 AM, <khr@golang.org> wrote:
> Reviewers: golang-codereviews,
>
> Message:
> Hello golang-codereviews@googlegroups.com,
>
> I'd like you to review this change to
> https://code.google.com/p/go/
>
>
> Description:
> runtime: redo stack map entries to avoid false retention
>
> Change two-bit stack map entries to encode:
> 0 = dead
> 1 = scalar
> 2 = pointer
> 3 = multiword
>
> If multiword, the two-bit entry for the following word encodes:
> 0 = string
> 1 = slice
> 2 = iface
> 3 = eface
>
> That way, during stack scanning we can check if a string
> is zero length or a slice has zero capacity. We can avoid
> following the contained pointer in those cases. It is safe
> to do so because it can never be dereferenced, and it is
> desirable to do so because it may cause false retention
> of the following block in memory.
>
> Slice feature turned off until bug 7564 is fixed.
>
> Update bug 7549
>
> Please review this at https://codereview.appspot.com/76380043/
>
> Affected files (+213, -37 lines):
> M src/cmd/cc/pgen.c
> M src/cmd/gc/plive.c
> M src/pkg/runtime/malloc.h
> M src/pkg/runtime/mfinal_test.go
> M src/pkg/runtime/mgc0.c
> M src/pkg/runtime/stack.c
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-codereviews" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-codereviews+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
On 2014/03/19 16:00:47, bradfitz wrote: > s/bug NNNN/issue NNNN/ for the auto-linking/updating magic. > > ...
12 years, 6 months ago
(2014-03-25 16:28:35 UTC)
#3
On 2014/03/19 16:00:47, bradfitz wrote:
> s/bug NNNN/issue NNNN/ for the auto-linking/updating magic.
>
>
>
> On Wed, Mar 19, 2014 at 12:55 AM, <mailto:khr@golang.org> wrote:
>
> > Reviewers: golang-codereviews,
> >
> > Message:
> > Hello mailto:golang-codereviews@googlegroups.com,
> >
> > I'd like you to review this change to
> > https://code.google.com/p/go/
> >
> >
> > Description:
> > runtime: redo stack map entries to avoid false retention
> >
> > Change two-bit stack map entries to encode:
> > 0 = dead
> > 1 = scalar
> > 2 = pointer
> > 3 = multiword
> >
> > If multiword, the two-bit entry for the following word encodes:
> > 0 = string
> > 1 = slice
> > 2 = iface
> > 3 = eface
> >
> > That way, during stack scanning we can check if a string
> > is zero length or a slice has zero capacity. We can avoid
> > following the contained pointer in those cases. It is safe
> > to do so because it can never be dereferenced, and it is
> > desirable to do so because it may cause false retention
> > of the following block in memory.
> >
> > Slice feature turned off until bug 7564 is fixed.
> >
> > Update bug 7549
> >
> > Please review this at https://codereview.appspot.com/76380043/
> >
> > Affected files (+213, -37 lines):
> > M src/cmd/cc/pgen.c
> > M src/cmd/gc/plive.c
> > M src/pkg/runtime/malloc.h
> > M src/pkg/runtime/mfinal_test.go
> > M src/pkg/runtime/mgc0.c
> > M src/pkg/runtime/stack.c
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "golang-codereviews" group.
> > To unsubscribe from this group and stop receiving emails from it, send an
> > email to mailto:golang-codereviews+unsubscribe@googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
Ping.
LGTM i love it https://codereview.appspot.com/76380043/diff/100001/src/pkg/runtime/mgc0.c File src/pkg/runtime/mgc0.c (right): https://codereview.appspot.com/76380043/diff/100001/src/pkg/runtime/mgc0.c#newcode70 src/pkg/runtime/mgc0.c:70: ClobberDead = 0, please make ...
12 years, 6 months ago
(2014-03-25 19:41:49 UTC)
#4
*** Submitted as https://code.google.com/p/go/source/detail?r=8b79c77e7fea *** runtime: redo stack map entries to avoid false retention Change ...
12 years, 6 months ago
(2014-03-25 21:11:41 UTC)
#5
*** Submitted as https://code.google.com/p/go/source/detail?r=8b79c77e7fea ***
runtime: redo stack map entries to avoid false retention
Change two-bit stack map entries to encode:
0 = dead
1 = scalar
2 = pointer
3 = multiword
If multiword, the two-bit entry for the following word encodes:
0 = string
1 = slice
2 = iface
3 = eface
That way, during stack scanning we can check if a string
is zero length or a slice has zero capacity. We can avoid
following the contained pointer in those cases. It is safe
to do so because it can never be dereferenced, and it is
desirable to do so because it may cause false retention
of the following block in memory.
Slice feature turned off until issue 7564 is fixed.
Update issue 7549
LGTM=rsc
R=golang-codereviews, bradfitz, rsc
CC=golang-codereviews
https://codereview.appspot.com/76380043
Issue 76380043: code review 76380043: runtime: redo stack map entries to avoid false retention
(Closed)
Created 12 years, 7 months ago by khr
Modified 12 years, 6 months ago
Reviewers:
Base URL:
Comments: 2