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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1555713002: [Interpreter] Bytecodes for exchanging registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/interpreter-assembler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/compiler/interpreter-assembler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698