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

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

Issue 2189463006: [interpreter] Put object in register for ToObject/ForInPrepare (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix tests Created 4 years, 5 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/interpreter/bytecode-array-builder.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 4ec83f85d8123e03bb52162444c7e59a77ada2fa..ab320d504ace83eda0c1b7d4d4d60b409c0929b6 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1340,27 +1340,23 @@ void BytecodeGraphBuilder::VisitTestInstanceOf() {
BuildCompareOp(javascript()->InstanceOf());
}
-void BytecodeGraphBuilder::VisitToName() {
+void BytecodeGraphBuilder::BuildCastOperator(const Operator* js_op) {
FrameStateBeforeAndAfter states(this);
- Node* value =
- NewNode(javascript()->ToName(), environment()->LookupAccumulator());
+ Node* value = NewNode(js_op, environment()->LookupAccumulator());
environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value,
&states);
}
+void BytecodeGraphBuilder::VisitToName() {
+ BuildCastOperator(javascript()->ToName());
+}
+
void BytecodeGraphBuilder::VisitToObject() {
- FrameStateBeforeAndAfter states(this);
- Node* node =
- NewNode(javascript()->ToObject(), environment()->LookupAccumulator());
- environment()->BindAccumulator(node, &states);
+ BuildCastOperator(javascript()->ToObject());
}
void BytecodeGraphBuilder::VisitToNumber() {
- FrameStateBeforeAndAfter states(this);
- Node* value =
- NewNode(javascript()->ToNumber(), environment()->LookupAccumulator());
- environment()->BindRegister(bytecode_iterator().GetRegisterOperand(0), value,
- &states);
+ BuildCastOperator(javascript()->ToNumber());
}
void BytecodeGraphBuilder::VisitJump() { BuildJump(); }
@@ -1458,10 +1454,11 @@ DEBUG_BREAK_BYTECODE_LIST(DEBUG_BREAK);
void BytecodeGraphBuilder::BuildForInPrepare() {
FrameStateBeforeAndAfter states(this);
- Node* receiver = environment()->LookupAccumulator();
+ Node* receiver =
+ environment()->LookupRegister(bytecode_iterator().GetRegisterOperand(0));
Node* prepare = NewNode(javascript()->ForInPrepare(), receiver);
environment()->BindRegistersToProjections(
- bytecode_iterator().GetRegisterOperand(0), prepare, &states);
+ bytecode_iterator().GetRegisterOperand(1), prepare, &states);
}
void BytecodeGraphBuilder::VisitForInPrepare() { BuildForInPrepare(); }
« no previous file with comments | « src/compiler/bytecode-graph-builder.h ('k') | src/interpreter/bytecode-array-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698