Chromium Code Reviews

Issue 10534006: Remove TLS access for current Zone. (Closed)

Created:
8 years, 6 months ago by sanjoy
Modified:
8 years, 6 months ago
Reviewers:
danno
CC:
v8-dev
Visibility:
Public.

Description

Remove TLS access for current Zone. By passing around a Zone object explicitly we no longer need to do a TLS access at the sites that allocate memory from the current Zone. BUG= TEST= Committed: https://code.google.com/p/v8/source/detail?r=11761

Patch Set 1 #

Total comments: 34

Patch Set 2 : Review. #

Total comments: 2

Patch Set 3 : Store zone in SplayTree and VariableMap. Remove `explicit` from constructors where it isn't needed. #

Total comments: 6

Patch Set 4 : Address review. #

Unified diffs Side-by-side diffs Stats (+1501 lines, -1225 lines)
M src/arm/assembler-arm.cc View 1 chunk +1 line, -1 line 0 comments
M src/arm/full-codegen-arm.cc View 4 chunks +8 lines, -7 lines 0 comments
M src/arm/lithium-arm.h View 2 chunks +7 lines, -3 lines 0 comments
M src/arm/lithium-arm.cc View 9 chunks +21 lines, -17 lines 0 comments
M src/arm/lithium-codegen-arm.h View 3 chunks +9 lines, -9 lines 0 comments
M src/arm/lithium-codegen-arm.cc View 16 chunks +18 lines, -17 lines 0 comments
M src/arm/lithium-gap-resolver-arm.cc View 2 chunks +2 lines, -2 lines 0 comments
M src/arm/regexp-macro-assembler-arm.h View 1 chunk +1 line, -1 line 0 comments
M src/arm/regexp-macro-assembler-arm.cc View 1 chunk +4 lines, -2 lines 0 comments
M src/assembler.h View 2 chunks +4 lines, -1 line 0 comments
M src/assembler.cc View 1 chunk +3 lines, -2 lines 0 comments
M src/ast.h View 18 chunks +35 lines, -31 lines 0 comments
M src/ast.cc View 9 chunks +29 lines, -21 lines 0 comments
M src/compiler.cc View 7 chunks +11 lines, -8 lines 0 comments
M src/deoptimizer.h View 1 chunk +1 line, -1 line 0 comments
M src/frames.h View 1 chunk +1 line, -1 line 0 comments
M src/frames.cc View 2 chunks +6 lines, -6 lines 0 comments
M src/full-codegen.h View 5 chunks +13 lines, -7 lines 0 comments
M src/full-codegen.cc View 4 chunks +5 lines, -5 lines 0 comments
M src/func-name-inferrer.h View 5 chunks +5 lines, -3 lines 0 comments
M src/func-name-inferrer.cc View 2 chunks +8 lines, -7 lines 0 comments
M src/hashmap.h View 2 chunks +4 lines, -3 lines 0 comments
M src/hydrogen.h View 17 chunks +34 lines, -27 lines 0 comments
M src/hydrogen.cc View 95 chunks +185 lines, -167 lines 0 comments
M src/hydrogen-instructions.h View 13 chunks +34 lines, -28 lines 0 comments
M src/hydrogen-instructions.cc View 8 chunks +18 lines, -16 lines 0 comments
M src/ia32/assembler-ia32.cc View 1 chunk +1 line, -1 line 0 comments
M src/ia32/full-codegen-ia32.cc View 4 chunks +7 lines, -7 lines 0 comments
M src/ia32/lithium-codegen-ia32.h View 3 chunks +8 lines, -8 lines 0 comments
M src/ia32/lithium-codegen-ia32.cc View 14 chunks +15 lines, -14 lines 0 comments
M src/ia32/lithium-gap-resolver-ia32.cc View 2 chunks +2 lines, -2 lines 0 comments
M src/ia32/lithium-ia32.h View 4 chunks +11 lines, -7 lines 0 comments
M src/ia32/lithium-ia32.cc View 6 chunks +13 lines, -12 lines 0 comments
M src/ia32/regexp-macro-assembler-ia32.h View 1 chunk +1 line, -1 line 0 comments
M src/ia32/regexp-macro-assembler-ia32.cc View 1 chunk +4 lines, -2 lines 0 comments
M src/interface.h View 4 chunks +11 lines, -10 lines 0 comments
M src/interface.cc View 8 chunks +19 lines, -13 lines 0 comments
M src/isolate.h View 1 chunk +0 lines, -1 line 0 comments
M src/isolate.cc View 1 chunk +1 line, -1 line 0 comments
M src/json-parser.h View 5 chunks +10 lines, -6 lines 0 comments
M src/jsregexp.h View 17 chunks +43 lines, -28 lines 0 comments
M src/jsregexp.cc View 67 chunks +193 lines, -149 lines 0 comments
M src/list-inl.h View 1 chunk +5 lines, -1 line 0 comments
M src/lithium.h View 12 chunks +23 lines, -23 lines 0 comments
M src/lithium.cc View 2 chunks +4 lines, -4 lines 0 comments
M src/lithium-allocator.h View 1 chunk +1 line, -0 lines 0 comments
M src/lithium-allocator.cc View 27 chunks +44 lines, -43 lines 0 comments
M src/liveedit.h View 2 chunks +2 lines, -2 lines 0 comments
M src/liveedit.cc View 10 chunks +26 lines, -17 lines 0 comments
M src/objects.h View 2 chunks +2 lines, -1 line 0 comments
M src/parser.h View 6 chunks +10 lines, -10 lines 0 comments
M src/parser.cc View 72 chunks +132 lines, -115 lines 0 comments
M src/regexp-macro-assembler.h View 3 chunks +5 lines, -2 lines 0 comments
M src/regexp-macro-assembler.cc View 2 chunks +5 lines, -4 lines 0 comments
M src/regexp-macro-assembler-tracer.cc View 1 chunk +1 line, -0 lines 0 comments
M src/rewriter.cc View 1 chunk +1 line, -1 line 0 comments
M src/runtime.cc View 31 chunks +82 lines, -51 lines 0 comments
M src/safepoint-table.h View 1 chunk +1 line, -1 line 0 comments
M src/safepoint-table.cc View 4 chunks +12 lines, -9 lines 0 comments
M src/scopeinfo.cc View 1 chunk +3 lines, -3 lines 0 comments
M src/scopes.h View 8 chunks +25 lines, -9 lines 0 comments
M src/scopes.cc View 18 chunks +81 lines, -73 lines 0 comments
M src/small-pointer-list.h View 2 chunks +11 lines, -11 lines 0 comments
M src/splay-tree.h View 3 chunks +5 lines, -5 lines 0 comments
M src/splay-tree-inl.h View 3 chunks +8 lines, -10 lines 0 comments
M src/stub-cache.h View 2 chunks +3 lines, -1 line 0 comments
M src/stub-cache.cc View 3 chunks +4 lines, -3 lines 0 comments
M src/type-info.h View 3 chunks +5 lines, -1 line 0 comments
M src/type-info.cc View 6 chunks +11 lines, -8 lines 0 comments
M src/x64/assembler-x64.cc View 1 chunk +1 line, -1 line 0 comments
M src/x64/full-codegen-x64.cc View 4 chunks +8 lines, -7 lines 0 comments
M src/x64/lithium-codegen-x64.h View 3 chunks +9 lines, -9 lines 0 comments
M src/x64/lithium-codegen-x64.cc View 13 chunks +15 lines, -14 lines 0 comments
M src/x64/lithium-gap-resolver-x64.cc View 2 chunks +2 lines, -2 lines 0 comments
M src/x64/lithium-x64.h View 3 chunks +12 lines, -7 lines 0 comments
M src/x64/lithium-x64.cc View 6 chunks +13 lines, -12 lines 0 comments
M src/x64/regexp-macro-assembler-x64.h View 2 chunks +2 lines, -2 lines 0 comments
M src/x64/regexp-macro-assembler-x64.cc View 1 chunk +5 lines, -3 lines 0 comments
M src/zone.h View 5 chunks +12 lines, -14 lines 0 comments
M src/zone-inl.h View 1 chunk +2 lines, -18 lines 0 comments
M test/cctest/test-dataflow.cc View 1 chunk +1 line, -1 line 0 comments
M test/cctest/test-liveedit.cc View 1 chunk +2 lines, -1 line 0 comments
M test/cctest/test-regexp.cc View 27 chunks +90 lines, -64 lines 0 comments
M test/cctest/test-strings.cc View 4 chunks +9 lines, -7 lines 0 comments

Messages

Total messages: 8 (0 generated)
sanjoy
http://codereview.chromium.org/10534006/diff/1/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/10534006/diff/1/src/hydrogen.cc#newcode6926 src/hydrogen.cc:6926: AddInstruction(global); This needs to be done so that the ...
8 years, 6 months ago (2012-06-05 13:02:49 UTC) #1
danno
Mostly nits, but a few real issues to address. http://codereview.chromium.org/10534006/diff/1/src/ast.cc File src/ast.cc (right): http://codereview.chromium.org/10534006/diff/1/src/ast.cc#newcode248 src/ast.cc:248: ...
8 years, 6 months ago (2012-06-05 13:42:33 UTC) #2
sanjoy
http://codereview.chromium.org/10534006/diff/1/src/ast.cc File src/ast.cc (right): http://codereview.chromium.org/10534006/diff/1/src/ast.cc#newcode248 src/ast.cc:248: ZoneHashMap table(Literal::Match, 8, allocator); On 2012/06/05 13:42:35, danno wrote: ...
8 years, 6 months ago (2012-06-05 14:21:39 UTC) #3
danno
More comments. https://chromiumcodereview.appspot.com/10534006/diff/1/src/scopes.h File src/scopes.h (right): https://chromiumcodereview.appspot.com/10534006/diff/1/src/scopes.h#newcode43 src/scopes.h:43: explicit VariableMap(Zone* zone); This is probably cleaner ...
8 years, 6 months ago (2012-06-06 10:59:53 UTC) #4
sanjoy
http://codereview.chromium.org/10534006/diff/10001/src/splay-tree-inl.h File src/splay-tree-inl.h (right): http://codereview.chromium.org/10534006/diff/10001/src/splay-tree-inl.h#newcode49 src/splay-tree-inl.h:49: } On 2012/06/06 10:59:53, danno wrote: > Store the ...
8 years, 6 months ago (2012-06-06 11:43:54 UTC) #5
danno
http://codereview.chromium.org/10534006/diff/3003/src/hydrogen.cc File src/hydrogen.cc (right): http://codereview.chromium.org/10534006/diff/3003/src/hydrogen.cc#newcode6958 src/hydrogen.cc:6958: AddInstruction(global_object); This is an unrelated change, can you please ...
8 years, 6 months ago (2012-06-11 12:11:45 UTC) #6
danno
lgtm
8 years, 6 months ago (2012-06-11 12:37:50 UTC) #7
sanjoy
8 years, 6 months ago (2012-06-11 12:37:56 UTC) #8
http://codereview.chromium.org/10534006/diff/3003/src/hydrogen.cc
File src/hydrogen.cc (right):

http://codereview.chromium.org/10534006/diff/3003/src/hydrogen.cc#newcode6958
src/hydrogen.cc:6958: AddInstruction(global_object);
On 2012/06/11 12:11:45, danno wrote:
> This is an unrelated change, can you please remove it from this patch?

This change is required since the HGlobalReceiver constructor reads the zone
from the HBasicBlock in the HValue.  Unless we add the instruction to the basic
block before constructing the HGlobalReceiver, the HGlobalReceiver constructor
sees a NULL HBasicBlock and segfaults.

http://codereview.chromium.org/10534006/diff/3003/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/10534006/diff/3003/src/parser.cc#newcode1557
src/parser.cc:1557: interface->Add(names[i], inner, ok, zone());
On 2012/06/11 12:11:45, danno wrote:
> Move zone() to be the third parameter so that the CHECK_OK parameter still
> works.

Fixed.

http://codereview.chromium.org/10534006/diff/3003/src/scopes.h
File src/scopes.h (right):

http://codereview.chromium.org/10534006/diff/3003/src/scopes.h#newcode72
src/scopes.h:72: maps_[i] = new VariableMap(zone);
On 2012/06/11 12:11:45, danno wrote:
> Where does this allocation come from? It looks like it's from the malloc heap,
> that doesn't seem right.

Changed to allocate from the zone.  VariableMap isn't a ZoneObject, so I had to
explicitly allocate the memory from the zone.

Powered by Google App Engine