Reviewers: titzer,
Message:
Ben, please take a look, thanks.
Description:
[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
Please review this at https://codereview.chromium.org/1283193007/
Base URL:
ssh://rmcilroy.lon.corp.google.com///usr/local/google/code/v8_full/v8@master
Affected files (+30, -12 lines):
M src/compiler/graph.h
M src/compiler/raw-machine-assembler.cc
Index: src/compiler/graph.h
diff --git a/src/compiler/graph.h b/src/compiler/graph.h
index
cb073b312acafdc01933bbb6f113be18a714f1c4..aa1977084bebb59f86cced1929520efd3a826b1c
100644
--- a/src/compiler/graph.h
+++ b/src/compiler/graph.h
@@ -79,6 +79,17 @@ class Graph : public ZoneObject {
Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9};
return NewNode(op, arraysize(nodes), nodes);
}
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+ Node* n5, Node* n6, Node* n7, Node* n8, Node* n9, Node*
n10) {
+ Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9, n10};
+ return NewNode(op, arraysize(nodes), nodes);
+ }
+ Node* NewNode(const Operator* op, Node* n1, Node* n2, Node* n3, Node* n4,
+ Node* n5, Node* n6, Node* n7, Node* n8, Node* n9, Node*
n10,
+ Node* n11) {
+ Node* nodes[] = {n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11};
+ return NewNode(op, arraysize(nodes), nodes);
+ }
// Clone the {node}, and assign a new node id to the copy.
Node* CloneNode(const Node* node);
Index: src/compiler/raw-machine-assembler.cc
diff --git a/src/compiler/raw-machine-assembler.cc
b/src/compiler/raw-machine-assembler.cc
index
8013f422f6b9ba42bd825b068367f3bc96730e44..15d7b1b1f9e27b86e6d077ad187245135de5cffb
100644
--- a/src/compiler/raw-machine-assembler.cc
+++ b/src/compiler/raw-machine-assembler.cc
@@ -104,13 +104,15 @@ 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 + 1);
+ Node** buffer = zone()->NewArray<Node*>(param_count + 3);
int index = 0;
buffer[index++] = function;
for (int i = 0; i < param_count; 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);
return call;
}
@@ -125,7 +127,8 @@ Node* RawMachineAssembler::CallFunctionStub0(Node*
function, Node* receiver,
CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
Node* stub_code = HeapConstant(callable.code());
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);
return call;
}
@@ -135,8 +138,9 @@ 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);
+ Node* call =
+ graph()->NewNode(common()->Call(descriptor), function, receiver,
context,
+ frame_state, graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call);
return call;
}
@@ -154,7 +158,8 @@ Node*
RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
Node* arity = Int32Constant(1);
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);
return call;
}
@@ -167,7 +172,8 @@ Node* RawMachineAssembler::CallCFunction0(MachineType
return_type,
const CallDescriptor* descriptor =
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);
return call;
}
@@ -182,7 +188,8 @@ Node* RawMachineAssembler::CallCFunction1(MachineType
return_type,
const CallDescriptor* descriptor =
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);
return call;
}
@@ -199,8 +206,8 @@ Node* RawMachineAssembler::CallCFunction2(MachineType
return_type,
const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
- Node* call =
- graph()->NewNode(common()->Call(descriptor), function, arg0, arg1);
+ Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
+ arg1, graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call);
return call;
}
@@ -224,9 +231,9 @@ Node* RawMachineAssembler::CallCFunction8(
builder.AddParam(arg7_type);
const CallDescriptor* descriptor =
Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
-
Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
- arg1, arg2, arg3, arg4, arg5, arg6, arg7);
+ arg1, arg2, arg3, arg4, arg5, arg6, arg7,
+ graph()->start(), graph()->start());
schedule()->AddNode(CurrentBlock(), call);
return call;
}
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.