Commit 843d5d5c authored by rmcilroy's avatar rmcilroy Committed by Commit bot

[turbofan] Add control and effect inputs to RawMachineAssembler calls.

Calls should have control and effect inputs, which were previously missing
for RawMachineAssembler call operations. Add control and effect edges to
graph()->start().

BUG=v8:4280
LOG=N

Review URL: https://codereview.chromium.org/1283193007

Cr-Commit-Position: refs/heads/master@{#30307}
parent d1aeb45d
...@@ -104,13 +104,15 @@ Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function, ...@@ -104,13 +104,15 @@ Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function,
Node** args) { Node** args) {
int param_count = int param_count =
static_cast<int>(desc->GetMachineSignature()->parameter_count()); static_cast<int>(desc->GetMachineSignature()->parameter_count());
Node** buffer = zone()->NewArray<Node*>(param_count + 1); Node** buffer = zone()->NewArray<Node*>(param_count + 3);
int index = 0; int index = 0;
buffer[index++] = function; buffer[index++] = function;
for (int i = 0; i < param_count; i++) { for (int i = 0; i < param_count; i++) {
buffer[index++] = args[i]; buffer[index++] = args[i];
} }
Node* call = graph()->NewNode(common()->Call(desc), param_count + 1, buffer); buffer[index++] = graph()->start();
buffer[index++] = graph()->start();
Node* call = graph()->NewNode(common()->Call(desc), param_count + 3, buffer);
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -125,7 +127,8 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver, ...@@ -125,7 +127,8 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties); CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
Node* stub_code = HeapConstant(callable.code()); Node* stub_code = HeapConstant(callable.code());
Node* call = graph()->NewNode(common()->Call(desc), stub_code, function, Node* call = graph()->NewNode(common()->Call(desc), stub_code, function,
receiver, context, frame_state); receiver, context, frame_state,
graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -135,8 +138,9 @@ Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver, ...@@ -135,8 +138,9 @@ Node* RawMachineAssembler::CallJS0(Node* function, Node* receiver,
Node* context, Node* frame_state) { Node* context, Node* frame_state) {
CallDescriptor* descriptor = Linkage::GetJSCallDescriptor( CallDescriptor* descriptor = Linkage::GetJSCallDescriptor(
zone(), false, 1, CallDescriptor::kNeedsFrameState); zone(), false, 1, CallDescriptor::kNeedsFrameState);
Node* call = graph()->NewNode(common()->Call(descriptor), function, receiver, Node* call =
context, frame_state); graph()->NewNode(common()->Call(descriptor), function, receiver, context,
frame_state, graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -154,7 +158,8 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function, ...@@ -154,7 +158,8 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
Node* arity = Int32Constant(1); Node* arity = Int32Constant(1);
Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref, Node* call = graph()->NewNode(common()->Call(descriptor), centry, arg0, ref,
arity, context, frame_state); arity, context, frame_state, graph()->start(),
graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -167,7 +172,8 @@ Node* RawMachineAssembler::CallCFunction0(MachineType return_type, ...@@ -167,7 +172,8 @@ Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
const CallDescriptor* descriptor = const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
Node* call = graph()->NewNode(common()->Call(descriptor), function); Node* call = graph()->NewNode(common()->Call(descriptor), function,
graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -182,7 +188,8 @@ Node* RawMachineAssembler::CallCFunction1(MachineType return_type, ...@@ -182,7 +188,8 @@ Node* RawMachineAssembler::CallCFunction1(MachineType return_type,
const CallDescriptor* descriptor = const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0); Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -199,8 +206,8 @@ Node* RawMachineAssembler::CallCFunction2(MachineType return_type, ...@@ -199,8 +206,8 @@ Node* RawMachineAssembler::CallCFunction2(MachineType return_type,
const CallDescriptor* descriptor = const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
Node* call = Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
graph()->NewNode(common()->Call(descriptor), function, arg0, arg1); arg1, graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
...@@ -222,11 +229,21 @@ Node* RawMachineAssembler::CallCFunction8( ...@@ -222,11 +229,21 @@ Node* RawMachineAssembler::CallCFunction8(
builder.AddParam(arg5_type); builder.AddParam(arg5_type);
builder.AddParam(arg6_type); builder.AddParam(arg6_type);
builder.AddParam(arg7_type); builder.AddParam(arg7_type);
Node* args[] = {function,
arg0,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6,
arg7,
graph()->start(),
graph()->start()};
const CallDescriptor* descriptor = const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
Node* call =
Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0, graph()->NewNode(common()->Call(descriptor), arraysize(args), args);
arg1, arg2, arg3, arg4, arg5, arg6, arg7);
schedule()->AddNode(CurrentBlock(), call); schedule()->AddNode(CurrentBlock(), call);
return call; return call;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment