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/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 #include "src/compiler/scheduler.h" | 10 #include "src/compiler/scheduler.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 Node* arity = Int32Constant(kArity); | 365 Node* arity = Int32Constant(kArity); |
366 | 366 |
367 Node* nodes[] = {centry, arg1, arg2, arg3, arg4, ref, arity, context}; | 367 Node* nodes[] = {centry, arg1, arg2, arg3, arg4, ref, arity, context}; |
368 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); | 368 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); |
369 | 369 |
370 schedule()->AddTailCall(CurrentBlock(), tail_call); | 370 schedule()->AddTailCall(CurrentBlock(), tail_call); |
371 current_block_ = nullptr; | 371 current_block_ = nullptr; |
372 return tail_call; | 372 return tail_call; |
373 } | 373 } |
374 | 374 |
| 375 Node* RawMachineAssembler::TailCallRuntime5(Runtime::FunctionId function, |
| 376 Node* arg1, Node* arg2, Node* arg3, |
| 377 Node* arg4, Node* arg5, |
| 378 Node* context) { |
| 379 const int kArity = 5; |
| 380 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
| 381 zone(), function, kArity, Operator::kNoProperties, |
| 382 CallDescriptor::kSupportsTailCalls); |
| 383 int return_count = static_cast<int>(desc->ReturnCount()); |
| 384 |
| 385 Node* centry = HeapConstant(CEntryStub(isolate(), return_count).GetCode()); |
| 386 Node* ref = AddNode( |
| 387 common()->ExternalConstant(ExternalReference(function, isolate()))); |
| 388 Node* arity = Int32Constant(kArity); |
| 389 |
| 390 Node* nodes[] = {centry, arg1, arg2, arg3, arg4, arg5, ref, arity, context}; |
| 391 Node* tail_call = MakeNode(common()->TailCall(desc), arraysize(nodes), nodes); |
| 392 |
| 393 schedule()->AddTailCall(CurrentBlock(), tail_call); |
| 394 current_block_ = nullptr; |
| 395 return tail_call; |
| 396 } |
| 397 |
375 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, | 398 Node* RawMachineAssembler::CallCFunction0(MachineType return_type, |
376 Node* function) { | 399 Node* function) { |
377 MachineSignature::Builder builder(zone(), 1, 0); | 400 MachineSignature::Builder builder(zone(), 1, 0); |
378 builder.AddReturn(return_type); | 401 builder.AddReturn(return_type); |
379 const CallDescriptor* descriptor = | 402 const CallDescriptor* descriptor = |
380 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); | 403 Linkage::GetSimplifiedCDescriptor(zone(), builder.Build()); |
381 | 404 |
382 return AddNode(common()->Call(descriptor), function); | 405 return AddNode(common()->Call(descriptor), function); |
383 } | 406 } |
384 | 407 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 // The raw machine assembler nodes do not have effect and control inputs, | 513 // The raw machine assembler nodes do not have effect and control inputs, |
491 // so we disable checking input counts here. | 514 // so we disable checking input counts here. |
492 return graph()->NewNodeUnchecked(op, input_count, inputs); | 515 return graph()->NewNodeUnchecked(op, input_count, inputs); |
493 } | 516 } |
494 | 517 |
495 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } | 518 RawMachineLabel::~RawMachineLabel() { DCHECK(bound_ || !used_); } |
496 | 519 |
497 } // namespace compiler | 520 } // namespace compiler |
498 } // namespace internal | 521 } // namespace internal |
499 } // namespace v8 | 522 } // namespace v8 |
OLD | NEW |