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. #Messages
Total messages: 21 (6 generated)
|