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

Issue 2411873004: [ignition] Eliminate hole checks where statically possible for loads and stores (Closed)

Created:
4 years, 2 months ago by adamk
Modified:
4 years, 1 month ago
CC:
v8-reviews_googlegroups.com, rmcilroy
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[ignition] Eliminate hole checks where statically possible for loads and stores Move hole check logic from full-codegen into scope analysis, and store the "needs hole check" bit on VariableProxy. This makes it easy to re-use in any backend: it will be trivial to extend the use of this logic in, e.g., full-codegen variable stores. While changing the signatures of the variable loading/storing methods in Ignition, I took the liberty of replacing the verb "Visit" with "Build", since these are not part of AST visiting. BUG=v8:5460 Committed: https://crrev.com/35a3ccbfac415f7ab53ed5a63b03ed366d29a104 Cr-Commit-Position: refs/heads/master@{#40479}

Patch Set 1 #

Patch Set 2 : Move logic to scope analysis time #

Total comments: 5

Patch Set 3 : No hole checks for global variables #

Patch Set 4 : rebased #

Patch Set 5 : Move DCHECKs down instead #

Patch Set 6 : Further restructuring #

Patch Set 7 : Fix modules #

Patch Set 8 : Pass needs_hole_check as a bool arg #

Patch Set 9 : Make MODULE allocation less ugly #

Total comments: 2

Patch Set 10 : Added some comments after discussion with neis #

Patch Set 11 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+230 lines, -320 lines) Patch
M src/ast/ast.h View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M src/ast/ast.cc View 1 2 3 2 chunks +6 lines, -3 lines 0 comments Download
M src/ast/scopes.h View 1 2 3 4 5 6 1 chunk +3 lines, -3 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 9 4 chunks +57 lines, -9 lines 0 comments Download
M src/ast/variables.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -1 line 0 comments Download
M src/full-codegen/arm/full-codegen-arm.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/arm64/full-codegen-arm64.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/full-codegen.h View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M src/full-codegen/full-codegen.cc View 1 1 chunk +0 lines, -59 lines 0 comments Download
M src/full-codegen/ia32/full-codegen-ia32.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/mips/full-codegen-mips.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/mips64/full-codegen-mips64.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/ppc/full-codegen-ppc.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/s390/full-codegen-s390.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/x64/full-codegen-x64.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/x87/full-codegen-x87.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-generator.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -9 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 25 chunks +57 lines, -51 lines 0 comments Download
M src/parsing/parser.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 3 chunks +17 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/BasicLoops.golden View 1 2 chunks +6 lines, -22 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden View 1 2 chunks +5 lines, -25 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden View 1 2 chunks +3 lines, -8 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ConstVariable.golden View 1 3 chunks +6 lines, -17 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ConstVariableContextSlot.golden View 1 4 chunks +5 lines, -17 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 4 5 6 7 8 9 10 11 chunks +21 lines, -28 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LetVariable.golden View 1 3 chunks +6 lines, -17 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LetVariableContextSlot.golden View 1 4 chunks +5 lines, -18 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Modules.golden View 1 2 3 4 5 6 7 8 9 10 6 chunks +2 lines, -18 lines 0 comments Download

Messages

Total messages: 59 (43 generated)
adamk
4 years, 2 months ago (2016-10-14 22:53:15 UTC) #9
adamk
It appears this approach almost works, but that I'm somehow capturing too any variables in ...
4 years, 2 months ago (2016-10-15 01:05:27 UTC) #15
Michael Starzinger
I like the approach, back-ends look good, fine from my end. Adding Toon to double ...
4 years, 2 months ago (2016-10-17 14:15:35 UTC) #16
Michael Starzinger
Actually adding Toon. :)
4 years, 2 months ago (2016-10-17 14:15:54 UTC) #18
mythria
Nice, looks good from my side.
4 years, 2 months ago (2016-10-18 06:43:37 UTC) #19
adamk
https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h File src/interpreter/bytecode-generator.h (right): https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h#newcode97 src/interpreter/bytecode-generator.h:97: void BuildVariableLoad(VariableProxy* proxy, On 2016/10/17 14:15:35, Michael Starzinger wrote: ...
4 years, 2 months ago (2016-10-19 11:09:43 UTC) #26
adamk
This is now working except for module imports: the existing code was depending on having ...
4 years, 2 months ago (2016-10-19 12:24:08 UTC) #35
Michael Starzinger
https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h File src/interpreter/bytecode-generator.h (right): https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h#newcode97 src/interpreter/bytecode-generator.h:97: void BuildVariableLoad(VariableProxy* proxy, On 2016/10/19 11:09:43, adamk wrote: > ...
4 years, 2 months ago (2016-10-19 12:32:41 UTC) #36
adamk
I've got the modules tests passing, adding neis@ for modules. PTAL. https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h File src/interpreter/bytecode-generator.h (right): ...
4 years, 2 months ago (2016-10-19 13:34:23 UTC) #42
Michael Starzinger
LGTM from my end. https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h File src/interpreter/bytecode-generator.h (right): https://codereview.chromium.org/2411873004/diff/20001/src/interpreter/bytecode-generator.h#newcode97 src/interpreter/bytecode-generator.h:97: void BuildVariableLoad(VariableProxy* proxy, On 2016/10/19 ...
4 years, 2 months ago (2016-10-19 15:41:52 UTC) #49
Toon Verwaest
I presume the original reason why I was added here is already gone by now, ...
4 years, 2 months ago (2016-10-20 12:41:22 UTC) #50
neis
lgtm with comment https://codereview.chromium.org/2411873004/diff/160001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2411873004/diff/160001/src/ast/scopes.cc#newcode1924 src/ast/scopes.cc:1924: var->AllocateTo(VariableLocation::MODULE, 0); You can use your ...
4 years, 2 months ago (2016-10-20 16:46:42 UTC) #51
adamk
Latest patch set addresses neis's concerns, it's likely the allocation logic will change in a ...
4 years, 2 months ago (2016-10-20 16:53:25 UTC) #52
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2411873004/200001
4 years, 2 months ago (2016-10-20 16:56:00 UTC) #55
commit-bot: I haz the power
Committed patchset #11 (id:200001)
4 years, 2 months ago (2016-10-20 17:31:44 UTC) #57
commit-bot: I haz the power
4 years, 1 month ago (2016-11-17 22:08:39 UTC) #59
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/35a3ccbfac415f7ab53ed5a63b03ed366d29a104
Cr-Commit-Position: refs/heads/master@{#40479}

Powered by Google App Engine
This is Rietveld 408576698