Index: src/compiler/raw-machine-assembler.cc |
diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc |
index 81faa7d840b82d963ffb93f05a84bdd024c46bd3..83dbbf15d988d510fa05c31343e62dfb089ccc98 100644 |
--- a/src/compiler/raw-machine-assembler.cc |
+++ b/src/compiler/raw-machine-assembler.cc |
@@ -104,7 +104,8 @@ Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, |
Node** args) { |
int param_count = |
static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
- Node** buffer = zone()->NewArray<Node*>(param_count + 3); |
+ 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++) { |
@@ -112,12 +113,54 @@ Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, |
} |
buffer[index++] = graph()->start(); |
buffer[index++] = graph()->start(); |
- Node* call = graph()->NewNode(common()->Call(desc), param_count + 3, buffer); |
+ Node* call = graph()->NewNode(common()->Call(desc), input_count, buffer); |
schedule()->AddNode(CurrentBlock(), call); |
return call; |
} |
+Node* RawMachineAssembler::CallNWithFrameState(CallDescriptor* desc, |
+ Node* function, Node** args, |
+ Node* frame_state) { |
+ DCHECK(desc->NeedsFrameState()); |
+ int param_count = |
+ static_cast<int>(desc->GetMachineSignature()->parameter_count()); |
+ int input_count = param_count + 4; |
+ 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++] = frame_state; |
+ buffer[index++] = graph()->start(); |
+ buffer[index++] = graph()->start(); |
+ Node* call = graph()->NewNode(common()->Call(desc), input_count, buffer); |
+ schedule()->AddNode(CurrentBlock(), call); |
+ return call; |
+} |
+ |
+ |
+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 = |
+ graph()->NewNode(common()->TailCall(desc), input_count, buffer); |
+ schedule()->AddTailCall(CurrentBlock(), tail_call); |
+ return tail_call; |
+} |
+ |
+ |
Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, |
Node* context, Node* frame_state, |
CallFunctionFlags flags) { |
@@ -134,18 +177,6 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, |
} |
-Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver, |
- Node* context, Node* frame_state) { |
- CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( |
- zone(), false, 1, CallDescriptor::kNeedsFrameState); |
- Node* call = |
- graph()->NewNode(common()->Call(descriptor), function, receiver, context, |
- frame_state, graph()->start(), graph()->start()); |
- schedule()->AddNode(CurrentBlock(), call); |
- return call; |
-} |
- |
- |
Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, |
Node* arg0, Node* context, |
Node* frame_state) { |
@@ -249,17 +280,6 @@ Node* RawMachineAssembler::CallCFunction8( |
} |
-Node* RawMachineAssembler::TailCallInterpreterDispatch( |
- const CallDescriptor* call_descriptor, Node* target, Node* arg1, Node* arg2, |
- Node* arg3, Node* arg4, Node* arg5, Node* arg6) { |
- Node* tail_call = graph()->NewNode(common()->TailCall(call_descriptor), |
- target, arg1, arg2, arg3, arg4, arg5, arg6, |
- graph()->start(), graph()->start()); |
- schedule()->AddTailCall(CurrentBlock(), tail_call); |
- return tail_call; |
-} |
- |
- |
void RawMachineAssembler::Bind(Label* label) { |
DCHECK(current_block_ == nullptr); |
DCHECK(!label->bound_); |