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

Unified Diff: src/interpreter/interpreter.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: Fix release 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 | « src/interpreter/bytecodes.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index d1fb1b1711e5bfe53ed7837a82f28a350b2d45a8..6b8f9094021829ba505177c7a72abf62685eb338 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -1709,39 +1709,41 @@ void Interpreter::DoReturn(compiler::InterpreterAssembler* assembler) {
}
-// ForInPrepare <cache_type> <cache_array> <cache_length>
+// ForInPrepare <cache_info_triple>
//
// Returns state for for..in loop execution based on the object in the
-// accumulator. The registers |cache_type|, |cache_array|, and
-// |cache_length| represent output parameters.
+// accumulator. The result is output in registers |cache_info_triple| to
+// |cache_info_triple + 2|, with the registers holding cache_type, cache_array,
+// and cache_length respectively.
void Interpreter::DoForInPrepare(compiler::InterpreterAssembler* assembler) {
Node* object = __ GetAccumulator();
Node* result_triple = __ CallRuntime(Runtime::kForInPrepare, object);
// Set output registers:
// 0 == cache_type, 1 == cache_array, 2 == cache_length
+ Node* output_register = __ BytecodeOperandReg(0);
for (int i = 0; i < 3; i++) {
Node* cache_info = __ Projection(i, result_triple);
- Node* cache_info_reg = __ BytecodeOperandReg(i);
- __ StoreRegister(cache_info, cache_info_reg);
+ __ StoreRegister(cache_info, output_register);
+ output_register = __ NextRegister(output_register);
}
__ Dispatch();
}
-// ForInNext <receiver> <cache_type> <cache_array> <index>
+// ForInNext <receiver> <index> <cache_info_pair>
//
// Returns the next enumerable property in the the accumulator.
void Interpreter::DoForInNext(compiler::InterpreterAssembler* assembler) {
Node* receiver_reg = __ BytecodeOperandReg(0);
Node* receiver = __ LoadRegister(receiver_reg);
- Node* cache_type_reg = __ BytecodeOperandReg(1);
+ Node* index_reg = __ BytecodeOperandReg(1);
+ Node* index = __ LoadRegister(index_reg);
+ Node* cache_type_reg = __ BytecodeOperandReg(2);
Node* cache_type = __ LoadRegister(cache_type_reg);
- Node* cache_array_reg = __ BytecodeOperandReg(2);
+ Node* cache_array_reg = __ NextRegister(cache_type_reg);
Node* cache_array = __ LoadRegister(cache_array_reg);
- Node* index_reg = __ BytecodeOperandReg(3);
- Node* index = __ LoadRegister(index_reg);
Node* result = __ CallRuntime(Runtime::kForInNext, receiver, cache_array,
cache_type, index);
__ SetAccumulator(result);
« no previous file with comments | « src/interpreter/bytecodes.cc ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698