Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12)

Issue 76380043: code review 76380043: runtime: redo stack map entries to avoid false retention (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 7 months ago by khr
Modified:
12 years, 6 months ago
Reviewers:
rsc
CC:
golang-codereviews, bradfitz, rsc
Visibility:
Public.

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 issue 7564 is fixed. Update issue 7549

Patch Set 1 #

Patch Set 2 : diff -r b1c5bf74b59e https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 3 : diff -r 2bce43d48503 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 4 : diff -r 2bce43d48503 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 5 : diff -r 1ddce2d9ee32 https://code.google.com/p/go/ #

Patch Set 6 : diff -r 1ddce2d9ee32 https://code.google.com/p/go/ #

Total comments: 2

Patch Set 7 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 8 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 9 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 10 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 11 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 12 : diff -r d68b79ccbfed https://code.google.com/p/go/ #

Patch Set 13 : diff -r d68b79ccbfed https://khr%40golang.org@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+218 lines, -37 lines) Patch
M src/cmd/cc/pgen.c View 1 3 chunks +7 lines, -3 lines 0 comments Download
M src/cmd/gc/plive.c View 1 2 6 chunks +30 lines, -11 lines 0 comments Download
M src/pkg/runtime/extern.go View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 2 3 4 5 6 1 chunk +8 lines, -2 lines 0 comments Download
M src/pkg/runtime/mfinal_test.go View 1 2 3 4 2 chunks +81 lines, -0 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 4 5 6 2 chunks +46 lines, -4 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/runtime.c View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/stack.c View 1 2 3 4 5 6 7 8 2 chunks +41 lines, -17 lines 0 comments Download

Messages

Total messages: 5
khr
Hello golang-codereviews@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
12 years, 7 months ago (2014-03-19 07:55:55 UTC) #1
bradfitz
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
khr
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
rsc
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
khr
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
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b