@@ -32,7 +32,7 @@ RawMachineAssembler::RawMachineAssembler(Isolate* isolate, Graph* graph,
3232 parameters_ = zone ()->NewArray <Node*>(param_count);
3333 for (size_t i = 0 ; i < parameter_count (); ++i) {
3434 parameters_[i] =
35- AddNode (common ()->Parameter (static_cast <int >(i)), graph->start ());
35+ NewNode (common ()->Parameter (static_cast <int >(i)), graph->start ());
3636 }
3737}
3838
@@ -64,7 +64,7 @@ void RawMachineAssembler::Goto(Label* label) {
6464void RawMachineAssembler::Branch (Node* condition, Label* true_val,
6565 Label* false_val) {
6666 DCHECK (current_block_ != schedule ()->end ());
67- Node* branch = AddNode (common ()->Branch (), condition);
67+ Node* branch = NewNode (common ()->Branch (), condition);
6868 schedule ()->AddBranch (CurrentBlock (), branch, Use (true_val), Use (false_val));
6969 current_block_ = nullptr ;
7070}
@@ -75,7 +75,7 @@ void RawMachineAssembler::Switch(Node* index, Label* default_label,
7575 size_t case_count) {
7676 DCHECK_NE (schedule ()->end (), current_block_);
7777 size_t succ_count = case_count + 1 ;
78- Node* switch_node = AddNode (common ()->Switch (succ_count), index);
78+ Node* switch_node = NewNode (common ()->Switch (succ_count), index);
7979 BasicBlock** succ_blocks = zone ()->NewArray <BasicBlock*>(succ_count);
8080 for (size_t index = 0 ; index < case_count; ++index) {
8181 int32_t case_value = case_values[index];
@@ -95,7 +95,7 @@ void RawMachineAssembler::Switch(Node* index, Label* default_label,
9595
9696
9797void RawMachineAssembler::Return (Node* value) {
98- Node* ret = MakeNode ( common ()->Return (), 1 , & value);
98+ Node* ret = graph ()-> NewNode ( common ()->Return (), value);
9999 schedule ()->AddReturn (CurrentBlock (), ret);
100100 current_block_ = nullptr ;
101101}
@@ -114,7 +114,9 @@ Node* RawMachineAssembler::CallN(CallDescriptor* desc, Node* function,
114114 }
115115 buffer[index++] = graph ()->start ();
116116 buffer[index++] = graph ()->start ();
117- return AddNode (common ()->Call (desc), input_count, buffer);
117+ Node* call = graph ()->NewNode (common ()->Call (desc), input_count, buffer);
118+ schedule ()->AddNode (CurrentBlock (), call);
119+ return call;
118120}
119121
120122
@@ -134,7 +136,9 @@ Node* RawMachineAssembler::CallNWithFrameState(CallDescriptor* desc,
134136 buffer[index++] = frame_state;
135137 buffer[index++] = graph ()->start ();
136138 buffer[index++] = graph ()->start ();
137- return AddNode (common ()->Call (desc), input_count, buffer);
139+ Node* call = graph ()->NewNode (common ()->Call (desc), input_count, buffer);
140+ schedule ()->AddNode (CurrentBlock (), call);
141+ return call;
138142}
139143
140144
@@ -151,7 +155,8 @@ Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function,
151155 }
152156 buffer[index++] = graph ()->start ();
153157 buffer[index++] = graph ()->start ();
154- Node* tail_call = MakeNode (common ()->TailCall (desc), input_count, buffer);
158+ Node* tail_call =
159+ graph ()->NewNode (common ()->TailCall (desc), input_count, buffer);
155160 schedule ()->AddTailCall (CurrentBlock (), tail_call);
156161 return tail_call;
157162}
@@ -165,8 +170,11 @@ Node* RawMachineAssembler::CallFunctionStub0(Node* function, Node* receiver,
165170 isolate (), zone (), callable.descriptor (), 1 ,
166171 CallDescriptor::kNeedsFrameState , Operator::kNoProperties );
167172 Node* stub_code = HeapConstant (callable.code ());
168- return AddNode (common ()->Call (desc), stub_code, function, receiver, context,
169- frame_state, graph ()->start (), graph ()->start ());
173+ Node* call = graph ()->NewNode (common ()->Call (desc), stub_code, function,
174+ receiver, context, frame_state,
175+ graph ()->start (), graph ()->start ());
176+ schedule ()->AddNode (CurrentBlock (), call);
177+ return call;
170178}
171179
172180
@@ -176,12 +184,15 @@ Node* RawMachineAssembler::CallRuntime1(Runtime::FunctionId function,
176184 zone (), function, 1 , Operator::kNoProperties , false );
177185
178186 Node* centry = HeapConstant (CEntryStub (isolate (), 1 ).GetCode ());
179- Node* ref = AddNode (
187+ Node* ref = NewNode (
180188 common ()->ExternalConstant (ExternalReference (function, isolate ())));
181189 Node* arity = Int32Constant (1 );
182190
183- return AddNode (common ()->Call (descriptor), centry, arg1, ref, arity, context,
184- graph ()->start (), graph ()->start ());
191+ Node* call =
192+ graph ()->NewNode (common ()->Call (descriptor), centry, arg1, ref, arity,
193+ context, graph ()->start (), graph ()->start ());
194+ schedule ()->AddNode (CurrentBlock (), call);
195+ return call;
185196}
186197
187198
@@ -191,12 +202,15 @@ Node* RawMachineAssembler::CallRuntime2(Runtime::FunctionId function,
191202 zone (), function, 2 , Operator::kNoProperties , false );
192203
193204 Node* centry = HeapConstant (CEntryStub (isolate (), 1 ).GetCode ());
194- Node* ref = AddNode (
205+ Node* ref = NewNode (
195206 common ()->ExternalConstant (ExternalReference (function, isolate ())));
196207 Node* arity = Int32Constant (2 );
197208
198- return AddNode (common ()->Call (descriptor), centry, arg1, arg2, ref, arity,
199- context, graph ()->start (), graph ()->start ());
209+ Node* call =
210+ graph ()->NewNode (common ()->Call (descriptor), centry, arg1, arg2, ref,
211+ arity, context, graph ()->start (), graph ()->start ());
212+ schedule ()->AddNode (CurrentBlock (), call);
213+ return call;
200214}
201215
202216
@@ -207,8 +221,10 @@ Node* RawMachineAssembler::CallCFunction0(MachineType return_type,
207221 const CallDescriptor* descriptor =
208222 Linkage::GetSimplifiedCDescriptor (zone (), builder.Build ());
209223
210- return AddNode (common ()->Call (descriptor), function, graph ()->start (),
211- graph ()->start ());
224+ Node* call = graph ()->NewNode (common ()->Call (descriptor), function,
225+ graph ()->start (), graph ()->start ());
226+ schedule ()->AddNode (CurrentBlock (), call);
227+ return call;
212228}
213229
214230
@@ -221,8 +237,10 @@ Node* RawMachineAssembler::CallCFunction1(MachineType return_type,
221237 const CallDescriptor* descriptor =
222238 Linkage::GetSimplifiedCDescriptor (zone (), builder.Build ());
223239
224- return AddNode (common ()->Call (descriptor), function, arg0, graph ()->start (),
225- graph ()->start ());
240+ Node* call = graph ()->NewNode (common ()->Call (descriptor), function, arg0,
241+ graph ()->start (), graph ()->start ());
242+ schedule ()->AddNode (CurrentBlock (), call);
243+ return call;
226244}
227245
228246
@@ -237,8 +255,10 @@ Node* RawMachineAssembler::CallCFunction2(MachineType return_type,
237255 const CallDescriptor* descriptor =
238256 Linkage::GetSimplifiedCDescriptor (zone (), builder.Build ());
239257
240- return AddNode (common ()->Call (descriptor), function, arg0, arg1,
241- graph ()->start (), graph ()->start ());
258+ Node* call = graph ()->NewNode (common ()->Call (descriptor), function, arg0,
259+ arg1, graph ()->start (), graph ()->start ());
260+ schedule ()->AddNode (CurrentBlock (), call);
261+ return call;
242262}
243263
244264
@@ -271,7 +291,10 @@ Node* RawMachineAssembler::CallCFunction8(
271291 graph ()->start ()};
272292 const CallDescriptor* descriptor =
273293 Linkage::GetSimplifiedCDescriptor (zone (), builder.Build ());
274- return AddNode (common ()->Call (descriptor), arraysize (args), args);
294+ Node* call =
295+ graph ()->NewNode (common ()->Call (descriptor), arraysize (args), args);
296+ schedule ()->AddNode (CurrentBlock (), call);
297+ return call;
275298}
276299
277300
@@ -301,23 +324,15 @@ BasicBlock* RawMachineAssembler::CurrentBlock() {
301324}
302325
303326
304- Node* RawMachineAssembler::AddNode (const Operator* op, int input_count,
305- Node** inputs) {
327+ Node* RawMachineAssembler::MakeNode (const Operator* op, int input_count,
328+ Node** inputs) {
306329 DCHECK_NOT_NULL (schedule_);
307330 DCHECK (current_block_ != nullptr );
308- Node* node = MakeNode (op, input_count, inputs);
331+ Node* node = graph ()-> NewNode (op, input_count, inputs);
309332 schedule ()->AddNode (CurrentBlock (), node);
310333 return node;
311334}
312335
313-
314- Node* RawMachineAssembler::MakeNode (const Operator* op, int input_count,
315- Node** inputs) {
316- // The raw machine assembler nodes do not have effect and control inputs,
317- // so we disable checking input counts here.
318- return graph ()->NewNodeUnchecked (op, input_count, inputs);
319- }
320-
321336} // namespace compiler
322337} // namespace internal
323338} // namespace v8
0 commit comments