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

Issue 2369873002: [Interpreter] Replace BytecodeRegisterAllocator with a simple bump pointer. (Closed)

Created:
4 years, 2 months ago by rmcilroy
Modified:
4 years, 2 months ago
Reviewers:
mythria, Leszek Swirski
CC:
v8-reviews_googlegroups.com, rmcilroy
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Interpreter] Replace BytecodeRegisterAllocator with a simple bump pointer. There are only a few occasions where we allocate a register in an outer expression allocation scope, which makes the costly free-list approach of the BytecodeRegisterAllocator unecessary. This CL replaces all occurrences with moves to the accumulator and stores to a register allocated in the correct scope. By doing this, we can simplify the BytecodeRegisterAllocator to be a simple bump-pointer allocator with registers released in the same order as allocated. The following changes are also made: - Make BytecodeRegisterOptimizer able to use registers which have been unallocated, but not yet reused - Remove RegisterExpressionResultScope and rename AccumulatorExpressionResultScope to ValueExpressionResultScope - Introduce RegisterList to represent consecutive register allocations, and use this for operands to call bytecodes. By avoiding the free-list handling, this gives another couple of percent on CodeLoad. BUG=v8:4280 Committed: https://crrev.com/27fe988b85e9b0b77eb5c376d4bdd1350dfc3e17 Cr-Commit-Position: refs/heads/master@{#39905}

Patch Set 1 #

Patch Set 2 : Fix debugger tests. #

Patch Set 3 : Fix casts #

Patch Set 4 : Add dcheck #

Total comments: 10

Patch Set 5 : Address comments #

Patch Set 6 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+862 lines, -1478 lines) Patch
M BUILD.gn View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 chunks +54 lines, -70 lines 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 8 chunks +39 lines, -41 lines 0 comments Download
M src/interpreter/bytecode-generator.h View 8 chunks +11 lines, -28 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 73 chunks +300 lines, -624 lines 0 comments Download
M src/interpreter/bytecode-register-allocator.h View 1 2 3 4 2 chunks +80 lines, -80 lines 0 comments Download
D src/interpreter/bytecode-register-allocator.cc View 1 chunk +0 lines, -210 lines 0 comments Download
M src/interpreter/bytecode-register-optimizer.h View 2 chunks +10 lines, -7 lines 0 comments Download
M src/interpreter/bytecode-register-optimizer.cc View 1 2 3 13 chunks +72 lines, -31 lines 0 comments Download
M src/interpreter/mkpeephole.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/AssignmentsInBinaryExpression.golden View 12 chunks +28 lines, -28 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/BreakableBlocks.golden View 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallLookupSlot.golden View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassAndSuperClass.golden View 1 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CreateRestParameter.golden View 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Eval.golden View 1 chunk +2 lines, -2 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForIn.golden View 2 chunks +5 lines, -5 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 5 8 chunks +29 lines, -30 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LetVariable.golden View 2 chunks +2 lines, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LookupSlot.golden View 5 chunks +10 lines, -10 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ObjectLiterals.golden View 12 chunks +11 lines, -14 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/UnaryOperators.golden View 2 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/WithStatement.golden View 1 chunk +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/test-interpreter.cc View 6 chunks +37 lines, -30 lines 0 comments Download
M test/cctest/interpreter/test-interpreter-intrinsics.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 7 chunks +13 lines, -46 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-iterator-unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M test/unittests/interpreter/bytecode-register-allocator-unittest.cc View 1 chunk +69 lines, -185 lines 0 comments Download
M test/unittests/interpreter/bytecode-register-optimizer-unittest.cc View 1 2 5 chunks +65 lines, -12 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 50 (42 generated)
rmcilroy
Appologies about another large CL, but the refactorings seemed worth it after the change in ...
4 years, 2 months ago (2016-09-27 07:55:55 UTC) #37
rmcilroy
Appologies about another large CL, but the refactorings seemed worth it after the change in ...
4 years, 2 months ago (2016-09-27 07:56:03 UTC) #38
mythria
Nice, we actually reduce the frame sizes in a couple of tests. I am not ...
4 years, 2 months ago (2016-09-28 11:45:30 UTC) #41
Leszek Swirski
lgtm aside from some nits https://codereview.chromium.org/2369873002/diff/140001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2369873002/diff/140001/src/interpreter/bytecode-generator.cc#newcode2226 src/interpreter/bytecode-generator.cc:2226: // avoid DCHECK fails ...
4 years, 2 months ago (2016-09-28 15:27:25 UTC) #42
rmcilroy
Thanks for the reviews, all addressed. https://codereview.chromium.org/2369873002/diff/140001/src/interpreter/bytecode-array-builder.h File src/interpreter/bytecode-array-builder.h (right): https://codereview.chromium.org/2369873002/diff/140001/src/interpreter/bytecode-array-builder.h#newcode185 src/interpreter/bytecode-array-builder.h:185: // |callable|. The ...
4 years, 2 months ago (2016-09-30 08:37:54 UTC) #43
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/2369873002/180001
4 years, 2 months ago (2016-09-30 08:38:15 UTC) #46
commit-bot: I haz the power
Committed patchset #6 (id:180001)
4 years, 2 months ago (2016-09-30 09:03:04 UTC) #48
commit-bot: I haz the power
4 years, 2 months ago (2016-09-30 09:03:35 UTC) #50
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/27fe988b85e9b0b77eb5c376d4bdd1350dfc3e17
Cr-Commit-Position: refs/heads/master@{#39905}

Powered by Google App Engine
This is Rietveld 408576698