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

Unified Diff: src/compiler/code-assembler.cc

Issue 2352163004: [stubs] ApiCallbackDescriptor cleanup - make it independent on the number of JS parameters. (Closed)
Patch Set: Created 4 years, 3 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/compiler/code-assembler.h ('k') | src/fast-accessor-assembler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/code-assembler.cc
diff --git a/src/compiler/code-assembler.cc b/src/compiler/code-assembler.cc
index 792d0a1c9659054a13fbebf66b23f830b3cde226..c2574c11844a88629493ad699432ba20fa99ff9e 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -657,9 +657,11 @@ Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
}
Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor,
- Node* target, Node** args, size_t result_size) {
+ int js_parameter_count, Node* target,
+ Node** args, size_t result_size) {
CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ isolate(), zone(), descriptor,
+ descriptor.GetStackParameterCount() + js_parameter_count,
CallDescriptor::kNoFlags, Operator::kNoProperties,
MachineType::AnyTagged(), result_size);
@@ -822,10 +824,6 @@ Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
Node* function, Node* receiver,
size_t result_size) {
const int argc = 0;
- CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), zone(), callable.descriptor(), argc + 1,
- CallDescriptor::kNoFlags, Operator::kNoProperties,
- MachineType::AnyTagged(), result_size);
Node* target = HeapConstant(callable.code());
Node** args = zone()->NewArray<Node*>(argc + 4);
@@ -834,17 +832,13 @@ Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
args[2] = receiver;
args[3] = context;
- return CallN(call_descriptor, target, args);
+ return CallStubN(callable.descriptor(), argc + 1, target, args, result_size);
}
Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
Node* function, Node* receiver, Node* arg1,
size_t result_size) {
const int argc = 1;
- CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), zone(), callable.descriptor(), argc + 1,
- CallDescriptor::kNoFlags, Operator::kNoProperties,
- MachineType::AnyTagged(), result_size);
Node* target = HeapConstant(callable.code());
Node** args = zone()->NewArray<Node*>(argc + 4);
@@ -854,17 +848,13 @@ Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
args[3] = arg1;
args[4] = context;
- return CallN(call_descriptor, target, args);
+ return CallStubN(callable.descriptor(), argc + 1, target, args, result_size);
}
Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
Node* function, Node* receiver, Node* arg1,
Node* arg2, size_t result_size) {
const int argc = 2;
- CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
- isolate(), zone(), callable.descriptor(), argc + 1,
- CallDescriptor::kNoFlags, Operator::kNoProperties,
- MachineType::AnyTagged(), result_size);
Node* target = HeapConstant(callable.code());
Node** args = zone()->NewArray<Node*>(argc + 4);
@@ -875,7 +865,7 @@ Node* CodeAssembler::CallJS(Callable const& callable, Node* context,
args[4] = arg2;
args[5] = context;
- return CallN(call_descriptor, target, args);
+ return CallStubN(callable.descriptor(), argc + 1, target, args, result_size);
}
Node* CodeAssembler::CallCFunction2(MachineType return_type,
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/fast-accessor-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698