Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 4cbde46813c3de538fcbceb964fb9abef9243445..4d3257d5eb04e2d488aadff5d88a5f56ecd772ad 100644 |
--- a/src/compiler/bytecode-graph-builder.cc |
+++ b/src/compiler/bytecode-graph-builder.cc |
@@ -164,12 +164,23 @@ void BytecodeGraphBuilder::Environment::BindAccumulator( |
values()->at(accumulator_base_) = node; |
} |
+ |
void BytecodeGraphBuilder::Environment::RecordAfterState( |
Node* node, FrameStateBeforeAndAfter* states) { |
states->AddToNode(node, AccumulatorUpdateMode::kOutputIgnored); |
} |
+void BytecodeGraphBuilder::Environment::ExchangeRegisters( |
+ interpreter::Register r0, interpreter::Register r1) { |
rmcilroy
2016/01/04 11:54:53
nit - reg0, reg1
oth
2016/01/04 14:01:42
Done.
|
+ int i0 = RegisterToValuesIndex(r0); |
rmcilroy
2016/01/04 11:54:53
nit - reg0_index
oth
2016/01/04 14:01:42
Done.
|
+ int i1 = RegisterToValuesIndex(r1); |
+ Node* saved = values()->at(i0); |
+ values()->at(i0) = values()->at(i1); |
+ values()->at(i1) = saved; |
+} |
+ |
+ |
Node* BytecodeGraphBuilder::Environment::LookupAccumulator() const { |
return values()->at(accumulator_base_); |
} |
@@ -561,6 +572,20 @@ void BytecodeGraphBuilder::VisitMov( |
} |
+void BytecodeGraphBuilder::VisitExchange( |
+ const interpreter::BytecodeArrayIterator& iterator) { |
+ environment()->ExchangeRegisters(iterator.GetRegisterOperand(0), |
+ iterator.GetRegisterOperand(1)); |
+} |
+ |
+ |
+void BytecodeGraphBuilder::VisitExchangeWide( |
+ const interpreter::BytecodeArrayIterator& iterator) { |
+ environment()->ExchangeRegisters(iterator.GetRegisterOperand(0), |
+ iterator.GetRegisterOperand(1)); |
+} |
+ |
+ |
void BytecodeGraphBuilder::BuildLoadGlobal( |
const interpreter::BytecodeArrayIterator& iterator, |
TypeofMode typeof_mode) { |