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

Issue 1414183006: [turbofan] Avoid unnecessary write barriers and improve code generation. (Closed)

Created:
5 years, 1 month ago by Benedikt Meurer
Modified:
4 years, 10 months ago
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[turbofan] Avoid unnecessary write barriers and improve code generation. Avoid write barriers when storing values in the root set, and use cheaper write barriers for storing maps or tagged pointers. Also improve the generated code for write barriers, utilizing the out of line code mechanism that is available to TurboFan backends, which moves the unlikely case out of the hot path. R=jarin@chromium.org, mstarzinger@chromium.org Committed: https://crrev.com/1e2770123bd5c1cf7631bf11be846f0fbd884c08 Cr-Commit-Position: refs/heads/master@{#31914}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Make GCC happy. #

Patch Set 3 : Removed trailing semicolon #

Patch Set 4 : Store w/ write barrier #

Patch Set 5 : Fix typo. #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+915 lines, -462 lines) Patch
M src/compiler/arm/code-generator-arm.cc View 1 2 3 3 chunks +59 lines, -13 lines 0 comments Download
M src/compiler/arm/instruction-codes-arm.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/arm/instruction-selector-arm.cc View 1 2 3 2 chunks +61 lines, -41 lines 0 comments Download
M src/compiler/arm64/code-generator-arm64.cc View 1 2 3 3 chunks +59 lines, -23 lines 0 comments Download
M src/compiler/arm64/instruction-codes-arm64.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/arm64/instruction-selector-arm64.cc View 1 2 3 1 chunk +72 lines, -50 lines 0 comments Download
M src/compiler/code-generator.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/code-generator-impl.h View 1 chunk +3 lines, -0 lines 0 comments Download
M src/compiler/ia32/code-generator-ia32.cc View 1 2 3 3 chunks +58 lines, -18 lines 0 comments Download
M src/compiler/ia32/instruction-codes-ia32.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/compiler/ia32/instruction-selector-ia32.cc View 1 2 3 1 chunk +75 lines, -52 lines 0 comments Download
M src/compiler/instruction-codes.h View 1 2 3 1 chunk +36 lines, -31 lines 0 comments Download
M src/compiler/machine-operator.h View 1 chunk +6 lines, -1 line 0 comments Download
M src/compiler/machine-operator.cc View 4 chunks +29 lines, -8 lines 0 comments Download
M src/compiler/mips/code-generator-mips.cc View 1 2 3 3 chunks +60 lines, -12 lines 0 comments Download
M src/compiler/mips/instruction-codes-mips.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/mips/instruction-selector-mips.cc View 1 2 3 1 chunk +66 lines, -44 lines 0 comments Download
M src/compiler/mips64/code-generator-mips64.cc View 1 2 3 4 3 chunks +60 lines, -12 lines 0 comments Download
M src/compiler/mips64/instruction-codes-mips64.h View 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/mips64/instruction-selector-mips64.cc View 1 2 3 1 chunk +69 lines, -47 lines 0 comments Download
M src/compiler/simplified-lowering.cc View 2 chunks +28 lines, -0 lines 0 comments Download
M src/compiler/x64/code-generator-x64.cc View 1 2 3 3 chunks +58 lines, -18 lines 1 comment Download
M src/compiler/x64/instruction-codes-x64.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/compiler/x64/instruction-selector-x64.cc View 1 2 3 1 chunk +72 lines, -49 lines 0 comments Download
M src/heap/heap.cc View 1 2 1 chunk +9 lines, -4 lines 0 comments Download
M src/types.h View 1 chunk +30 lines, -28 lines 0 comments Download

Messages

Total messages: 12 (3 generated)
Benedikt Meurer
5 years, 1 month ago (2015-11-10 09:08:52 UTC) #1
Benedikt Meurer
Hey Michi, Jaro, Here's an initial patch to make us less stupid wrt. write barriers ...
5 years, 1 month ago (2015-11-10 09:11:22 UTC) #2
Michael Starzinger
LGTM on "heap", didn't look at the rest at all. https://codereview.chromium.org/1414183006/diff/1/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1414183006/diff/1/src/heap/heap.cc#newcode4384 ...
5 years, 1 month ago (2015-11-10 09:23:17 UTC) #3
Benedikt Meurer
https://codereview.chromium.org/1414183006/diff/1/src/heap/heap.cc File src/heap/heap.cc (right): https://codereview.chromium.org/1414183006/diff/1/src/heap/heap.cc#newcode4384 src/heap/heap.cc:4384: IMMORTAL_IMMOVABLE_ROOT_LIST(IMMORTAL_IMMOVABLE_ROOT); On 2015/11/10 09:23:17, Michael Starzinger wrote: > nit: ...
5 years, 1 month ago (2015-11-10 09:30:10 UTC) #4
Jarin
lgtm
5 years, 1 month ago (2015-11-10 10:07:55 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1414183006/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1414183006/80001
5 years, 1 month ago (2015-11-10 10:31:10 UTC) #8
commit-bot: I haz the power
Committed patchset #5 (id:80001)
5 years, 1 month ago (2015-11-10 11:05:25 UTC) #9
commit-bot: I haz the power
Patchset 5 (id:??) landed as https://crrev.com/1e2770123bd5c1cf7631bf11be846f0fbd884c08 Cr-Commit-Position: refs/heads/master@{#31914}
5 years, 1 month ago (2015-11-10 11:06:08 UTC) #10
ulan
4 years, 10 months ago (2016-02-19 15:02:32 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/1414183006/diff/80001/src/compiler/x64/code-g...
File src/compiler/x64/code-generator-x64.cc (right):

https://codereview.chromium.org/1414183006/diff/80001/src/compiler/x64/code-g...
src/compiler/x64/code-generator-x64.cc:213: __ CheckPageFlag(value_, scratch0_,
Eliding kPointersToHereAreInterestingMask check for maps is not correct.

There are two issues:
1. Incremental marker dynamically sets and clears this flag for map space pages,
so we don't know the value of the flag at code generation time.

2. Even assuming that there is no incremental marking, the intention of the code
was probably to not emit the write barrier because we know that the flag is 0
for maps? But this code actually forces the write barrier because it removes the
check. So we end up with old -> map slots in old -> new remembered set.

Context: https://bugs.chromium.org/p/chromium/issues/detail?id=587004#c13

Powered by Google App Engine
This is Rietveld 408576698