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

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

Issue 2172223002: [stubs] Call interface descriptors cleanup. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@store-ic-tf
Patch Set: Addressing comments Created 4 years, 5 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/compiler/js-generic-lowering.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 839912795f445bd5b8ce21d55984036a5aa7d289..f6d8d4e9a39af0503fb58e5ca596abac2f2c3827 100644
--- a/src/compiler/code-assembler.cc
+++ b/src/compiler/code-assembler.cc
@@ -523,6 +523,91 @@ Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
return CallN(call_descriptor, target, args);
}
+Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kNoFlags, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 3;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return CallN(call_descriptor, target, args);
+}
+
+Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, const Arg& arg3,
+ size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kNoFlags, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 4;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[arg3.index] = arg3.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return CallN(call_descriptor, target, args);
+}
+
+Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, const Arg& arg3, const Arg& arg4,
+ size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kNoFlags, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 5;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[arg3.index] = arg3.value;
+ args[arg4.index] = arg4.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return CallN(call_descriptor, target, args);
+}
+
+Node* CodeAssembler::CallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, const Arg& arg3, const Arg& arg4,
+ const Arg& arg5, size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kNoFlags, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 6;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[arg3.index] = arg3.value;
+ args[arg4.index] = arg4.value;
+ args[arg5.index] = arg5.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return CallN(call_descriptor, target, args);
+}
+
Node* CodeAssembler::CallStubN(const CallInterfaceDescriptor& descriptor,
Node* target, Node** args, size_t result_size) {
CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
@@ -622,6 +707,52 @@ Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
return raw_assembler_->TailCallN(call_descriptor, target, args);
}
+Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, const Arg& arg3,
+ const Arg& arg4, size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kSupportsTailCalls, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 5;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[arg3.index] = arg3.value;
+ args[arg4.index] = arg4.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return raw_assembler_->TailCallN(call_descriptor, target, args);
+}
+
+Node* CodeAssembler::TailCallStub(const CallInterfaceDescriptor& descriptor,
+ Node* target, Node* context, const Arg& arg1,
+ const Arg& arg2, const Arg& arg3,
+ const Arg& arg4, const Arg& arg5,
+ size_t result_size) {
+ CallDescriptor* call_descriptor = Linkage::GetStubCallDescriptor(
+ isolate(), zone(), descriptor, descriptor.GetStackParameterCount(),
+ CallDescriptor::kSupportsTailCalls, Operator::kNoProperties,
+ MachineType::AnyTagged(), result_size);
+
+ const int kArgsCount = 6;
+ Node** args = zone()->NewArray<Node*>(kArgsCount);
+ DCHECK((std::fill(&args[0], &args[kArgsCount], nullptr), true));
+ args[arg1.index] = arg1.value;
+ args[arg2.index] = arg2.value;
+ args[arg3.index] = arg3.value;
+ args[arg4.index] = arg4.value;
+ args[arg5.index] = arg5.value;
+ args[kArgsCount - 1] = context;
+ DCHECK_EQ(0, std::count(&args[0], &args[kArgsCount], nullptr));
+
+ return raw_assembler_->TailCallN(call_descriptor, target, args);
+}
+
Node* CodeAssembler::TailCallBytecodeDispatch(
const CallInterfaceDescriptor& interface_descriptor,
Node* code_target_address, Node** args) {
« no previous file with comments | « src/compiler/code-assembler.h ('k') | src/compiler/js-generic-lowering.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698