Chromium Code Reviews

Issue 1412683011: [Interpreter] Enable assignments in expressions. (Closed)

Created:
5 years, 1 month ago by oth
Modified:
5 years, 1 month ago
Reviewers:
rmcilroy, Michael Starzinger
CC:
v8-reviews_googlegroups.com, oth, rmcilroy
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Interpreter] Enable assignments in expressions. This change introduces register re-mapping to avoid assignment hazards in binary expressions. Expressions that cause problems typically have the form y = x + (x = 4);. The problem occurs because the lhs value evaluates to the register holding x. The rhs updates that register and then applying the operation would use the new value as the lhs. By tracking loads and stores in binary expressions the generator is now able to detect when condition occurs and uses a temporary register for the rhs value. When the binary expression evaluation is complete the variable is updated with the latest temporary. A new bytecode Mov performs this update without touching the accumulator. BUG=v8:4280 LOG=N Committed: https://crrev.com/a1ba971cd84a77d077f5fb3389c3f6c66392cdae Cr-Commit-Position: refs/heads/master@{#32141}

Patch Set 1 #

Patch Set 2 : Fix assertion failure in bytecode-array-builder-unittest.cc. #

Patch Set 3 : Additional comments. Push down assignment entry/exit. Add compare ops. #

Patch Set 4 : Rebase. #

Patch Set 5 : Additional tests for conditional expressions. #

Total comments: 30

Patch Set 6 : Incorporate review comments. #

Patch Set 7 : Rebase. #

Total comments: 7

Patch Set 8 : Incorporate feedback from last review. #

Patch Set 9 : Rebase #

Patch Set 10 : Move AssignmentHazardHelper to be an inner class of BytecodeGenerator. #

Total comments: 8

Patch Set 11 : Incorporate comments on patchset 10. #

Patch Set 12 : Rebase. #

Patch Set 13 : Rebase. #

Patch Set 14 : Sync test bytecode sequences to avoid unnecessary Ldar/Star instructions. #

Unified diffs Side-by-side diffs Stats (+588 lines, -87 lines)
M src/compiler/bytecode-graph-builder.cc View 1 chunk +7 lines, -0 lines 0 comments
M src/interpreter/bytecode-array-builder.h View 1 chunk +3 lines, -0 lines 0 comments
M src/interpreter/bytecode-array-builder.cc View 2 chunks +15 lines, -0 lines 0 comments
M src/interpreter/bytecode-generator.h View 6 chunks +39 lines, -10 lines 0 comments
M src/interpreter/bytecode-generator.cc View 12 chunks +141 lines, -72 lines 0 comments
M src/interpreter/bytecodes.h View 1 chunk +3 lines, -0 lines 0 comments
M src/interpreter/interpreter.cc View 2 chunks +12 lines, -1 line 0 comments
M test/cctest/interpreter/test-bytecode-generator.cc View 1 chunk +219 lines, -0 lines 0 comments
M test/cctest/interpreter/test-interpreter.cc View 2 chunks +142 lines, -1 line 0 comments
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 2 chunks +7 lines, -3 lines 0 comments

Messages

Total messages: 21 (6 generated)
oth
Ross, PTAL. I'll circulate more widely when you've had a look over. Thanks!
5 years, 1 month ago (2015-11-02 12:30:28 UTC) #2
rmcilroy
Overall looks good, just some minor comments. https://codereview.chromium.org/1412683011/diff/80001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/1412683011/diff/80001/src/interpreter/bytecode-generator.cc#newcode303 src/interpreter/bytecode-generator.cc:303: class BytecodeGenerator::StatementResultScope ...
5 years, 1 month ago (2015-11-03 14:17:52 UTC) #3
rmcilroy
Overall looks good, just some minor comments. https://codereview.chromium.org/1412683011/diff/80001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/1412683011/diff/80001/src/interpreter/bytecode-generator.cc#newcode303 src/interpreter/bytecode-generator.cc:303: class BytecodeGenerator::StatementResultScope ...
5 years, 1 month ago (2015-11-03 14:17:53 UTC) #4
oth
PTAL. The code now uses AssignmentHazardScopes. It drops StatementResultScope entirely, but has EffectResultScope where these ...
5 years, 1 month ago (2015-11-04 10:03:37 UTC) #5
rmcilroy
A couple of suggestions, but lgtm. https://codereview.chromium.org/1412683011/diff/120001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/1412683011/diff/120001/src/interpreter/bytecode-generator.cc#newcode241 src/interpreter/bytecode-generator.cc:241: class BytecodeGenerator::EffectResultScope : ...
5 years, 1 month ago (2015-11-05 16:34:51 UTC) #6
oth
Hi Ross, if you've not gone on leave yet PTAL. Thanks! https://codereview.chromium.org/1412683011/diff/120001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): ...
5 years, 1 month ago (2015-11-12 11:32:15 UTC) #7
rmcilroy
Looks great, a couple of DCHECK suggestions but LGTM! https://codereview.chromium.org/1412683011/diff/180001/src/compiler/bytecode-graph-builder.h File src/compiler/bytecode-graph-builder.h (right): https://codereview.chromium.org/1412683011/diff/180001/src/compiler/bytecode-graph-builder.h#newcode1 src/compiler/bytecode-graph-builder.h:1: ...
5 years, 1 month ago (2015-11-12 12:49:15 UTC) #8
oth
Thanks! https://codereview.chromium.org/1412683011/diff/180001/src/compiler/bytecode-graph-builder.h File src/compiler/bytecode-graph-builder.h (right): https://codereview.chromium.org/1412683011/diff/180001/src/compiler/bytecode-graph-builder.h#newcode1 src/compiler/bytecode-graph-builder.h:1: /// Copyright 2015 the V8 project authors. All ...
5 years, 1 month ago (2015-11-13 12:43:30 UTC) #9
oth
mstarzinger@chromium.org: Please review changes in compiler and anywhere else of interest. This is hopefully the ...
5 years, 1 month ago (2015-11-13 13:27:04 UTC) #11
Michael Starzinger
LGTM on "compiler". The changes to BytecodeGenerator scare, confuse and frighten me, so I cannot ...
5 years, 1 month ago (2015-11-20 09:45:15 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1412683011/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1412683011/260001
5 years, 1 month ago (2015-11-20 10:53:43 UTC) #14
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 1 month ago (2015-11-20 11:11:03 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1412683011/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1412683011/260001
5 years, 1 month ago (2015-11-20 11:15:53 UTC) #19
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 1 month ago (2015-11-20 11:17:16 UTC) #20
commit-bot: I haz the power
5 years, 1 month ago (2015-11-20 11:18:00 UTC) #21
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/a1ba971cd84a77d077f5fb3389c3f6c66392cdae
Cr-Commit-Position: refs/heads/master@{#32141}

Powered by Google App Engine