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

Unified Diff: src/compiler/raw-machine-assembler.cc

Issue 1475953002: [stubs] A new approach to TF stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win64 build Created 5 years 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/raw-machine-assembler.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
index b88fe8c4f07486b9ed93668d603a8b891990c3b9..43a3aac2b5e91c518dcc48c08864d31e53448350 100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -152,30 +152,10 @@ Node* RawMachineAssembler::CallNWithFrameState(CallDescriptor* desc,
}
-Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function,
- Node** args) {
- int param_count =
- static_cast<int>(desc->GetMachineSignature()->parameter_count());
- int input_count = param_count + 3;
- Node** buffer = zone()->NewArray<Node*>(input_count);
- int index = 0;
- buffer[index++] = function;
- for (int i = 0; i < param_count; i++) {
- buffer[index++] = args[i];
- }
- buffer[index++] = graph()->start();
- buffer[index++] = graph()->start();
- Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer);
- schedule()->AddTailCall(CurrentBlock(), tail_call);
- current_block_ = nullptr;
- return tail_call;
-}
-
-
Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
Node* arg1, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
- zone(), function, 1, Operator::kNoProperties, false);
+ zone(), function, 1, Operator::kNoProperties, CallDescriptor::kNoFlags);
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
Node* ref = AddNode(
@@ -190,7 +170,7 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function,
Node* arg1, Node* arg2, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
- zone(), function, 2, Operator::kNoProperties, false);
+ zone(), function, 2, Operator::kNoProperties, CallDescriptor::kNoFlags);
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
Node* ref = AddNode(
@@ -206,7 +186,7 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function,
Node* arg1, Node* arg2, Node* arg3,
Node* arg4, Node* context) {
CallDescriptor* descriptor = Linkage::GetRuntimeCallDescriptor(
- zone(), function, 4, Operator::kNoProperties, false);
+ zone(), function, 4, Operator::kNoProperties, CallDescriptor::kNoFlags);
Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
Node* ref = AddNode(
@@ -218,6 +198,72 @@ Node* RawMachineAssembler::CallRuntime4(Runtime::FunctionId function,
}
+Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function,
+ Node** args) {
+ int param_count =
+ static_cast<int>(desc->GetMachineSignature()->parameter_count());
+ int input_count = param_count + 3;
+ Node** buffer = zone()->NewArray<Node*>(input_count);
+ int index = 0;
+ buffer[index++] = function;
+ for (int i = 0; i < param_count; i++) {
+ buffer[index++] = args[i];
+ }
+ buffer[index++] = graph()->start();
+ buffer[index++] = graph()->start();
+ Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer);
+ schedule()->AddTailCall(CurrentBlock(), tail_call);
+ current_block_ = nullptr;
+ return tail_call;
+}
+
+
+Node* RawMachineAssembler::TailCallRuntime1(Runtime::FunctionId function,
+ Node* arg1, Node* context) {
+ const int kArity = 1;
+ CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
+ zone(), function, kArity, Operator::kNoProperties,
+ CallDescriptor::kSupportsTailCalls);
+
+ Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
+ Node* ref = AddNode(
+ common()->ExternalConstant(ExternalReference(function, isolate())));
+ Node* arity = Int32Constant(kArity);
+
+ Node* nodes[] = {centry, arg1, ref, arity, context, graph()->start(),
+ graph()->start()};
+ Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
+
+ schedule()->AddTailCall(CurrentBlock(), tail_call);
+ current_block_ = nullptr;
+ return tail_call;
+}
+
+
+Node* RawMachineAssembler::TailCallRuntime2(Runtime::FunctionId function,
+ Node* arg1, Node* arg2,
+ Node* context) {
+ const int kArity = 2;
+ CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor(
+ zone(), function, kArity, Operator::kNoProperties,
+ CallDescriptor::kSupportsTailCalls);
+
+ Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
+ Node* ref = AddNode(
+ common()->ExternalConstant(ExternalReference(function, isolate())));
+ Node* arity = Int32Constant(kArity);
+
+ Node* nodes[] = {
+ centry, arg1, arg2, ref, arity, context, graph()->start(),
+ graph()->start()};
+ Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes);
+
+ schedule()->AddTailCall(CurrentBlock(), tail_call);
+ current_block_ = nullptr;
+ return tail_call;
+}
+
+
Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
Node* function) {
MachineSignature::Builder builder(zone(), 1, 0);
« no previous file with comments | « src/compiler/raw-machine-assembler.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698