Index: src/compiler/bytecode-graph-builder.cc |
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc |
index 12d944407f10f2cca250fa306559f2eac0b0da74..2fe2e1c397ec99a19f44a3f3bf2144002267eda6 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 reg0, interpreter::Register reg1) { |
+ int reg0_index = RegisterToValuesIndex(reg0); |
+ int reg1_index = RegisterToValuesIndex(reg1); |
+ Node* saved_reg0_value = values()->at(reg0_index); |
+ values()->at(reg0_index) = values()->at(reg1_index); |
+ values()->at(reg1_index) = saved_reg0_value; |
+} |
+ |
+ |
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) { |