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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 2384123002: [Interpreter] Use RegisterList for kRegTriple and kRegPair operands. (Closed)
Patch Set: Rebase Created 4 years, 2 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/interpreter/bytecode-generator.cc
diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
index c7b46e5fdb1995b77a1a35f775b7dcdefd81214c..c6b6280bc5a0d9ef00a0b7593b45a36a83ac3b32 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1202,7 +1202,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// Used as kRegTriple and kRegPair in ForInPrepare and ForInNext.
RegisterList triple = register_allocator()->NewRegisterList(3);
Register cache_length = triple[2];
- builder()->ForInPrepare(receiver, triple.first_register());
+ builder()->ForInPrepare(receiver, triple);
// Set up loop counter
Register index = register_allocator()->NewRegister();
@@ -1215,7 +1215,7 @@ void BytecodeGenerator::VisitForInStatement(ForInStatement* stmt) {
builder()->ForInContinue(index, cache_length);
loop_builder.BreakIfFalse();
FeedbackVectorSlot slot = stmt->ForInFeedbackSlot();
- builder()->ForInNext(receiver, index, triple.first_register(),
+ builder()->ForInNext(receiver, index, triple.Truncate(2),
feedback_index(slot));
loop_builder.ContinueIfUndefined();
VisitForInAssignment(stmt->each(), stmt->EachFeedbackSlot());
@@ -2378,11 +2378,13 @@ void BytecodeGenerator::VisitCall(Call* expr) {
// Call %LoadLookupSlotForCall to get the callee and receiver.
DCHECK(Register::AreContiguous(callee, receiver));
+ RegisterList result_pair(callee.index(), 2);
Variable* variable = callee_expr->AsVariableProxy()->var();
builder()
->LoadLiteral(variable->name())
.StoreAccumulatorInRegister(name)
- .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, name, callee);
+ .CallRuntimeForPair(Runtime::kLoadLookupSlotForCall, name,
+ result_pair);
break;
}
// Fall through.
« no previous file with comments | « src/interpreter/bytecode-array-builder.cc ('k') | test/unittests/interpreter/bytecode-array-builder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698