Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Issue 893073006: Add map-based read barrier to WeakCell

Created:
5 years, 10 months ago by Erik Corry Chromium.org
Modified:
5 years, 10 months ago
CC:
v8-dev, Paweł Hajdan Jr., rmcilroy
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Add map-based read barrier to WeakCell R=hpayer@chromium.org, ulan@chromium.org BUG=

Patch Set 1 #

Total comments: 13

Patch Set 2 : Don't trigger read barrier for comparison reads in hydrogen #

Patch Set 3 : Fix tests - no idea why I have to do this #

Patch Set 4 : Add TODO #

Patch Set 5 : Remove wrong test and be more careful harvesting maps for type feedback #

Patch Set 6 : Ignore weak cell maps in FindFirstMap too #

Patch Set 7 : Add TODO about reloc info for used_weak_cell_map #

Patch Set 8 : Fix merge #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -109 lines) Patch
M include/v8.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/code-stubs-hydrogen.cc View 1 2 3 4 5 6 7 4 chunks +6 lines, -6 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/heap/heap.h View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M src/heap/heap.cc View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M src/heap/mark-compact.cc View 1 2 3 4 5 6 7 1 chunk +15 lines, -8 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/hydrogen-instructions.h View 1 2 3 4 5 6 7 4 chunks +29 lines, -19 lines 0 comments Download
M src/ia32/code-stubs-ia32.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -4 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 2 3 4 5 6 7 3 chunks +10 lines, -0 lines 0 comments Download
M src/ia32/lithium-ia32.cc View 1 chunk +11 lines, -4 lines 0 comments Download
M src/ia32/macro-assembler-ia32.h View 1 chunk +13 lines, -2 lines 0 comments Download
M src/ia32/macro-assembler-ia32.cc View 1 2 3 4 5 6 1 chunk +34 lines, -5 lines 0 comments Download
M src/ic/ia32/handler-compiler-ia32.cc View 4 chunks +4 lines, -4 lines 0 comments Download
M src/ic/ia32/ic-compiler-ia32.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 5 6 7 4 chunks +12 lines, -5 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 6 7 10 chunks +43 lines, -16 lines 0 comments Download
M src/objects-debug.cc View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 5 6 7 3 chunks +38 lines, -9 lines 0 comments Download
M src/objects-printer.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/type-feedback-vector.cc View 1 2 3 4 5 6 7 2 chunks +5 lines, -2 lines 0 comments Download
M src/type-info.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M src/types.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M test/cctest/test-compiler.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M test/cctest/test-heap.cc View 1 2 3 4 5 6 7 2 chunks +10 lines, -10 lines 0 comments Download

Messages

Total messages: 10 (1 generated)
Erik Corry Chromium.org
5 years, 10 months ago (2015-02-03 16:05:48 UTC) #1
Erik Corry Chromium.org
This is a slightly different approach to https://codereview.chromium.org/892843002/ Instead of mistagging, we change the map. ...
5 years, 10 months ago (2015-02-03 16:12:55 UTC) #2
Erik Corry Chromium.org
https://codereview.chromium.org/893073006/diff/1/src/hydrogen-instructions.h File src/hydrogen-instructions.h (right): https://codereview.chromium.org/893073006/diff/1/src/hydrogen-instructions.h#newcode6220 src/hydrogen-instructions.h:6220: static HObjectAccess ForWeakCellValue() { I suspect some or perhaps ...
5 years, 10 months ago (2015-02-03 17:42:53 UTC) #3
ulan
Looks good. Updating the map could race with the sweeper thread. Shouldn't the barrier check ...
5 years, 10 months ago (2015-02-04 09:35:04 UTC) #4
Erik Corry
Thanks for review. The two different WeakCell maps are identical from the point of view ...
5 years, 10 months ago (2015-02-04 10:49:42 UTC) #6
ulan
https://codereview.chromium.org/893073006/diff/1/src/ia32/lithium-codegen-ia32.cc File src/ia32/lithium-codegen-ia32.cc (right): https://codereview.chromium.org/893073006/diff/1/src/ia32/lithium-codegen-ia32.cc#newcode2995 src/ia32/lithium-codegen-ia32.cc:2995: __ mov(result, FieldOperand(object, HeapObject::kMapOffset)); On 2015/02/04 10:49:42, Erik Corry ...
5 years, 10 months ago (2015-02-04 11:08:10 UTC) #7
Erik Corry
On 2015/02/04 11:08:10, ulan wrote: > https://codereview.chromium.org/893073006/diff/1/src/ia32/lithium-codegen-ia32.cc > File src/ia32/lithium-codegen-ia32.cc (right): > > https://codereview.chromium.org/893073006/diff/1/src/ia32/lithium-codegen-ia32.cc#newcode2995 > ...
5 years, 10 months ago (2015-02-04 12:15:44 UTC) #8
Hannes Payer (out of office)
On 2015/02/04 10:49:42, Erik Corry wrote: > Thanks for review. > > The two different ...
5 years, 10 months ago (2015-02-04 12:25:01 UTC) #9
Hannes Payer (out of office)
5 years, 10 months ago (2015-02-04 12:45:59 UTC) #10
https://codereview.chromium.org/893073006/diff/1/src/hydrogen-instructions.h
File src/hydrogen-instructions.h (right):

https://codereview.chromium.org/893073006/diff/1/src/hydrogen-instructions.h#...
src/hydrogen-instructions.h:6404: ReadBarrierField::encode(read_barrier ? 1 : 0)
|
I like that.

https://codereview.chromium.org/893073006/diff/1/src/ia32/macro-assembler-ia3...
File src/ia32/macro-assembler-ia32.cc (right):

https://codereview.chromium.org/893073006/diff/1/src/ia32/macro-assembler-ia3...
src/ia32/macro-assembler-ia32.cc:2429: // indicates the cell has been read from.
This seems to be more expensive than just clearing a bit. The advantage is, that
we do not slow down the case when we can go directly to the value (omit read
barrier). I guess we have to measure the performance impact.

Powered by Google App Engine
This is Rietveld 408576698