OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/raw-machine-assembler.h" | 5 #include "src/compiler/raw-machine-assembler.h" |
6 | 6 |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 #include "src/compiler/pipeline.h" | 8 #include "src/compiler/pipeline.h" |
9 #include "src/compiler/scheduler.h" | 9 #include "src/compiler/scheduler.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 Node** buffer = zone()->NewArray<Node*>(input_count); | 199 Node** buffer = zone()->NewArray<Node*>(input_count); |
200 int index = 0; | 200 int index = 0; |
201 buffer[index++] = function; | 201 buffer[index++] = function; |
202 for (int i = 0; i < param_count; i++) { | 202 for (int i = 0; i < param_count; i++) { |
203 buffer[index++] = args[i]; | 203 buffer[index++] = args[i]; |
204 } | 204 } |
205 buffer[index++] = frame_state; | 205 buffer[index++] = frame_state; |
206 return AddNode(common()->Call(desc), input_count, buffer); | 206 return AddNode(common()->Call(desc), input_count, buffer); |
207 } | 207 } |
208 | 208 |
209 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, Node* function, | |
210 Node** args) { | |
211 int param_count = static_cast<int>(desc->ParameterCount()); | |
212 int input_count = param_count + 1; | |
213 Node** buffer = zone()->NewArray<Node*>(input_count); | |
214 int index = 0; | |
215 buffer[index++] = function; | |
216 for (int i = 0; i < param_count; i++) { | |
217 buffer[index++] = args[i]; | |
218 } | |
219 return TailCallN(desc, input_count, buffer); | |
220 } | |
221 | |
222 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, int input_count, | 209 Node* RawMachineAssembler::TailCallN(CallDescriptor* desc, int input_count, |
223 Node* const* inputs) { | 210 Node* const* inputs) { |
224 // +1 is for target. | 211 // +1 is for target. |
225 DCHECK_EQ(input_count, desc->ParameterCount() + 1); | 212 DCHECK_EQ(input_count, desc->ParameterCount() + 1); |
226 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, inputs); | 213 Node* tail_call = MakeNode(common()->TailCall(desc), input_count, inputs); |
227 schedule()->AddTailCall(CurrentBlock(), tail_call); | 214 schedule()->AddTailCall(CurrentBlock(), tail_call); |
228 current_block_ = nullptr; | 215 current_block_ = nullptr; |
229 return tail_call; | 216 return tail_call; |
230 } | 217 } |
231 | 218 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 // The raw machine assembler nodes do not have effect and control inputs, | 334 // The raw machine assembler nodes do not have effect and control inputs, |
348 // so we disable checking input counts here. | 335 // so we disable checking input counts here. |
349 return graph()->NewNodeUnchecked(op, input_count, inputs); | 336 return graph()->NewNodeUnchecked(op, input_count, inputs); |
350 } | 337 } |
351 | 338 |
352 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 339 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
353 | 340 |
354 } // namespace compiler | 341 } // namespace compiler |
355 } // namespace internal | 342 } // namespace internal |
356 } // namespace v8 | 343 } // namespace v8 |
OLD | NEW |