| Index: src/compiler/raw-machine-assembler.cc
|
| diff --git a/src/compiler/raw-machine-assembler.cc b/src/compiler/raw-machine-assembler.cc
|
| index b517e938d6e2bd081a42792dc63005d17244af26..937e3be8b9df120ed64ea8b7bd3205950681329d 100644
|
| --- a/src/compiler/raw-machine-assembler.cc
|
| +++ b/src/compiler/raw-machine-assembler.cc
|
| @@ -32,7 +32,7 @@
|
| parameters_ = zone()->NewArray<Node*>(param_count);
|
| for (size_t i = 0; i < parameter_count(); ++i) {
|
| parameters_[i] =
|
| - AddNode(common()->Parameter(static_cast<int>(i)), graph->start());
|
| + NewNode(common()->Parameter(static_cast<int>(i)), graph->start());
|
| }
|
| }
|
|
|
| @@ -64,7 +64,7 @@
|
| void RawMachineAssembler::Branch(Node* condition, Label* true_val,
|
| Label* false_val) {
|
| DCHECK(current_block_ != schedule()->end());
|
| - Node* branch = AddNode(common()->Branch(), condition);
|
| + Node* branch = NewNode(common()->Branch(), condition);
|
| schedule()->AddBranch(CurrentBlock(), branch, Use(true_val), Use(false_val));
|
| current_block_ = nullptr;
|
| }
|
| @@ -75,7 +75,7 @@
|
| size_t case_count) {
|
| DCHECK_NE(schedule()->end(), current_block_);
|
| size_t succ_count = case_count + 1;
|
| - Node* switch_node = AddNode(common()->Switch(succ_count), index);
|
| + Node* switch_node = NewNode(common()->Switch(succ_count), index);
|
| BasicBlock** succ_blocks = zone()->NewArray<BasicBlock*>(succ_count);
|
| for (size_t index = 0; index < case_count; ++index) {
|
| int32_t case_value = case_values[index];
|
| @@ -95,7 +95,7 @@
|
|
|
|
|
| void RawMachineAssembler::Return(Node* value) {
|
| - Node* ret = MakeNode(common()->Return(), 1, &value);
|
| + Node* ret = graph()->NewNode(common()->Return(), value);
|
| schedule()->AddReturn(CurrentBlock(), ret);
|
| current_block_ = nullptr;
|
| }
|
| @@ -114,7 +114,9 @@
|
| }
|
| buffer[index++] = graph()->start();
|
| buffer[index++] = graph()->start();
|
| - return AddNode(common()->Call(desc), input_count, buffer);
|
| + Node* call = graph()->NewNode(common()->Call(desc), input_count, buffer);
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -134,7 +136,9 @@
|
| buffer[index++] = frame_state;
|
| buffer[index++] = graph()->start();
|
| buffer[index++] = graph()->start();
|
| - return AddNode(common()->Call(desc), input_count, buffer);
|
| + Node* call = graph()->NewNode(common()->Call(desc), input_count, buffer);
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -151,7 +155,8 @@
|
| }
|
| buffer[index++] = graph()->start();
|
| buffer[index++] = graph()->start();
|
| - Node* tail_call = MakeNode(common()->TailCall(desc), input_count, buffer);
|
| + Node* tail_call =
|
| + graph()->NewNode(common()->TailCall(desc), input_count, buffer);
|
| schedule()->AddTailCall(CurrentBlock(), tail_call);
|
| return tail_call;
|
| }
|
| @@ -165,8 +170,11 @@
|
| isolate(), zone(), callable.descriptor(), 1,
|
| CallDescriptor::kNeedsFrameState, Operator::kNoProperties);
|
| Node* stub_code = HeapConstant(callable.code());
|
| - return AddNode(common()->Call(desc), stub_code, function, receiver, context,
|
| - frame_state, graph()->start(), graph()->start());
|
| + Node* call = graph()->NewNode(common()->Call(desc), stub_code, function,
|
| + receiver, context, frame_state,
|
| + graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -176,12 +184,15 @@
|
| zone(), function, 1, Operator::kNoProperties, false);
|
|
|
| Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
|
| - Node* ref = AddNode(
|
| + Node* ref = NewNode(
|
| common()->ExternalConstant(ExternalReference(function, isolate())));
|
| Node* arity = Int32Constant(1);
|
|
|
| - return AddNode(common()->Call(descriptor), centry, arg1, ref, arity, context,
|
| - graph()->start(), graph()->start());
|
| + Node* call =
|
| + graph()->NewNode(common()->Call(descriptor), centry, arg1, ref, arity,
|
| + context, graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -191,12 +202,15 @@
|
| zone(), function, 2, Operator::kNoProperties, false);
|
|
|
| Node* centry = HeapConstant(CEntryStub(isolate(), 1).GetCode());
|
| - Node* ref = AddNode(
|
| + Node* ref = NewNode(
|
| common()->ExternalConstant(ExternalReference(function, isolate())));
|
| Node* arity = Int32Constant(2);
|
|
|
| - return AddNode(common()->Call(descriptor), centry, arg1, arg2, ref, arity,
|
| - context, graph()->start(), graph()->start());
|
| + Node* call =
|
| + graph()->NewNode(common()->Call(descriptor), centry, arg1, arg2, ref,
|
| + arity, context, graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -207,8 +221,10 @@
|
| const CallDescriptor* descriptor =
|
| Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
|
|
|
| - return AddNode(common()->Call(descriptor), function, graph()->start(),
|
| - graph()->start());
|
| + Node* call = graph()->NewNode(common()->Call(descriptor), function,
|
| + graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -221,8 +237,10 @@
|
| const CallDescriptor* descriptor =
|
| Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
|
|
|
| - return AddNode(common()->Call(descriptor), function, arg0, graph()->start(),
|
| - graph()->start());
|
| + Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
|
| + graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -237,8 +255,10 @@
|
| const CallDescriptor* descriptor =
|
| Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
|
|
|
| - return AddNode(common()->Call(descriptor), function, arg0, arg1,
|
| - graph()->start(), graph()->start());
|
| + Node* call = graph()->NewNode(common()->Call(descriptor), function, arg0,
|
| + arg1, graph()->start(), graph()->start());
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -271,7 +291,10 @@
|
| graph()->start()};
|
| const CallDescriptor* descriptor =
|
| Linkage::GetSimplifiedCDescriptor(zone(), builder.Build());
|
| - return AddNode(common()->Call(descriptor), arraysize(args), args);
|
| + Node* call =
|
| + graph()->NewNode(common()->Call(descriptor), arraysize(args), args);
|
| + schedule()->AddNode(CurrentBlock(), call);
|
| + return call;
|
| }
|
|
|
|
|
| @@ -301,21 +324,13 @@
|
| }
|
|
|
|
|
| -Node* RawMachineAssembler::AddNode(const Operator* op, int input_count,
|
| - Node** inputs) {
|
| +Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
|
| + Node** inputs) {
|
| DCHECK_NOT_NULL(schedule_);
|
| DCHECK(current_block_ != nullptr);
|
| - Node* node = MakeNode(op, input_count, inputs);
|
| + Node* node = graph()->NewNode(op, input_count, inputs);
|
| schedule()->AddNode(CurrentBlock(), node);
|
| return node;
|
| -}
|
| -
|
| -
|
| -Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
|
| - Node** inputs) {
|
| - // The raw machine assembler nodes do not have effect and control inputs,
|
| - // so we disable checking input counts here.
|
| - return graph()->NewNodeUnchecked(op, input_count, inputs);
|
| }
|
|
|
| } // namespace compiler
|
|
|