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

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

Issue 1584813002: [Interpreter] Make ForInPrepare take a kRegTriple8 and ForInNext take kRegPair8 for cache state (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@int_forin
Patch Set: Created 4 years, 11 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 | « no previous file | src/compiler/interpreter-assembler.cc » ('j') | src/interpreter/bytecode-array-builder.h » ('J')
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 d24ae3c56fbb5315249661106707a77988c7069d..e5a989292867afd9ef7f0836e3e143420c4842ba 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -1706,19 +1706,11 @@ void BytecodeGraphBuilder::VisitReturn(
void BytecodeGraphBuilder::VisitForInPrepare(
const interpreter::BytecodeArrayIterator& iterator) {
- Node* prepare = nullptr;
- {
- FrameStateBeforeAndAfter states(this, iterator);
- Node* receiver = environment()->LookupAccumulator();
- prepare = NewNode(javascript()->ForInPrepare(), receiver);
- environment()->RecordAfterState(prepare, &states);
- }
- // Project cache_type, cache_array, cache_length into register
- // operands 1, 2, 3.
- for (int i = 0; i < 3; i++) {
- environment()->BindRegister(iterator.GetRegisterOperand(i),
- NewNode(common()->Projection(i), prepare));
- }
+ FrameStateBeforeAndAfter states(this, iterator);
+ Node* receiver = environment()->LookupAccumulator();
+ Node* prepare = NewNode(javascript()->ForInPrepare(), receiver);
+ environment()->BindRegistersToProjections(iterator.GetRegisterOperand(0),
+ prepare, &states);
}
@@ -1738,11 +1730,13 @@ void BytecodeGraphBuilder::VisitForInNext(
FrameStateBeforeAndAfter states(this, iterator);
Node* receiver =
environment()->LookupRegister(iterator.GetRegisterOperand(0));
- Node* cache_type =
- environment()->LookupRegister(iterator.GetRegisterOperand(1));
- Node* cache_array =
- environment()->LookupRegister(iterator.GetRegisterOperand(2));
- Node* index = environment()->LookupRegister(iterator.GetRegisterOperand(3));
+ Node* index = environment()->LookupRegister(iterator.GetRegisterOperand(1));
+ int catch_reg_pair_index = iterator.GetRegisterOperand(2).index();
+ Node* cache_type = environment()->LookupRegister(
+ interpreter::Register(catch_reg_pair_index));
+ Node* cache_array = environment()->LookupRegister(
+ interpreter::Register(catch_reg_pair_index + 1));
+
Node* value = NewNode(javascript()->ForInNext(), receiver, cache_array,
cache_type, index);
environment()->BindAccumulator(value, &states);
« no previous file with comments | « no previous file | src/compiler/interpreter-assembler.cc » ('j') | src/interpreter/bytecode-array-builder.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698