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

Unified Diff: src/interpreter/bytecode-generator.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/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index 959e15514976132c32a0292e367ba17ea3b23d5e..c870746f8a59e82be9318c16375cfeff1d7876f3 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -821,10 +821,14 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->CastAccumulatorToJSObject();
builder()->JumpIfNull(&not_object_label);
builder()->StoreAccumulatorInRegister(receiver);
- Register cache_type = register_allocator()->NewRegister();
- Register cache_array = register_allocator()->NewRegister();
- Register cache_length = register_allocator()->NewRegister();
- builder()->ForInPrepare(cache_type, cache_array, cache_length);
+
+ register_allocator()->PrepareForConsecutiveAllocations(3);
+ Register cache_type = register_allocator()->NextConsecutiveRegister();
+ Register cache_array = register_allocator()->NextConsecutiveRegister();
+ Register cache_length = register_allocator()->NextConsecutiveRegister();
+ // Used as kRegTriple8 and kRegPair8 in ForInPrepare and ForInNext.
+ USE(cache_array);
+ builder()->ForInPrepare(cache_type);
// Set up loop counter
Register index = register_allocator()->NewRegister();
@@ -836,7 +840,8 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
loop_builder.Condition();
builder()->ForInDone(index, cache_length);
loop_builder.BreakIfTrue();
- builder()->ForInNext(receiver, cache_type, cache_array, index);
+ DCHECK(Register::AreContiguous(cache_type, cache_array));
+ builder()->ForInNext(receiver, index, cache_type);
loop_builder.ContinueIfUndefined();
VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot());
Visit(stmt->body());
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/bytecodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698