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

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

Issue 1659023002: [interpreter] Unify meaning of register count operands. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/interpreter.cc » ('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 26e945c77d721b1011bb486a0395310ffd51b793..702ede8105e4124c25ed51014978a020dfb9c053 100644
--- a/src/interpreter/bytecode-generator.cc
+++ b/src/interpreter/bytecode-generator.cc
@@ -1956,7 +1956,7 @@ void BytecodeGenerator::VisitCall(Call* expr) {
}
// TODO(rmcilroy): Use CallIC to allow call type feedback.
- builder()->Call(callee, receiver, args->length(),
+ builder()->Call(callee, receiver, 1 + args->length(),
feedback_index(expr->CallFeedbackICSlot()));
execution_result()->SetResultInAccumulator();
}
@@ -1976,20 +1976,18 @@ void BytecodeGenerator::VisitCallNew(CallNew* expr) {
void BytecodeGenerator::VisitCallRuntime(CallRuntime* expr) {
ZoneList<Expression*>* args = expr->arguments();
- Register receiver;
if (expr->is_jsruntime()) {
// Allocate a register for the receiver and load it with undefined.
- register_allocator()->PrepareForConsecutiveAllocations(args->length() + 1);
- receiver = register_allocator()->NextConsecutiveRegister();
+ register_allocator()->PrepareForConsecutiveAllocations(1 + args->length());
+ Register receiver = register_allocator()->NextConsecutiveRegister();
builder()->LoadUndefined().StoreAccumulatorInRegister(receiver);
- }
- // Evaluate all arguments to the runtime call.
- Register first_arg = VisitArguments(args);
-
- if (expr->is_jsruntime()) {
- DCHECK(args->length() == 0 || first_arg.index() == receiver.index() + 1);
- builder()->CallJSRuntime(expr->context_index(), receiver, args->length());
+ Register first_arg = VisitArguments(args);
+ CHECK(args->length() == 0 || first_arg.index() == receiver.index() + 1);
+ builder()->CallJSRuntime(expr->context_index(), receiver,
+ 1 + args->length());
} else {
+ // Evaluate all arguments to the runtime call.
+ Register first_arg = VisitArguments(args);
Runtime::FunctionId function_id = expr->function()->function_id;
builder()->CallRuntime(function_id, first_arg, args->length());
}
« no previous file with comments | « src/interpreter/bytecode-array-iterator.cc ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698