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

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: One more test. 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
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) {

Powered by Google App Engine
This is Rietveld 408576698