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

Unified Diff: src/compiler/linkage.cc

Issue 1410633006: [turbofan] Implement the call protocol properly for direct calls. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments. Created 5 years, 1 month 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/compiler/linkage.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/linkage.cc
diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc
index 957e4730b802504b65ee7d36dd40d3e9391f7d7f..8878fc8be93ffea0478f275aaf62939c081257a4 100644
--- a/src/compiler/linkage.cc
+++ b/src/compiler/linkage.cc
@@ -383,7 +383,9 @@ CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
CallDescriptor::Flags flags) {
const size_t return_count = 1;
const size_t context_count = 1;
- const size_t parameter_count = js_parameter_count + context_count;
+ const size_t num_args_count = 1;
+ const size_t parameter_count =
+ js_parameter_count + num_args_count + context_count;
LocationSignature::Builder locations(zone, return_count, parameter_count);
MachineSignature::Builder types(zone, return_count, parameter_count);
@@ -398,6 +400,11 @@ CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
locations.AddParam(LinkageLocation::ForCallerFrameSlot(spill_slot_index));
types.AddParam(kMachAnyTagged);
}
+
+ // Add JavaScript call argument count.
+ locations.AddParam(regloc(kJavaScriptCallArgCountRegister));
+ types.AddParam(kMachInt32);
+
// Add context.
locations.AddParam(regloc(kContextRegister));
types.AddParam(kMachAnyTagged);
@@ -544,8 +551,9 @@ LinkageLocation Linkage::GetOsrValueLocation(int index) const {
if (index == kOsrContextSpillSlotIndex) {
// Context. Use the parameter location of the context spill slot.
- // Parameter (arity + 1) is special for the context of the function frame.
- int context_index = 1 + 1 + parameter_count; // target + receiver + params
+ // Parameter (arity + 2) is special for the context of the function frame.
+ int context_index =
+ 1 + 1 + 1 + parameter_count; // target + receiver + params + #args
return incoming_->GetInputLocation(context_index);
} else if (index >= first_stack_slot) {
// Local variable stored in this (callee) stack.
« no previous file with comments | « src/compiler/linkage.h ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698