| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/code-assembler.h" | 5 #include "src/compiler/code-assembler.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
| 10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| (...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 Node* arity = Int32Constant(argc); | 488 Node* arity = Int32Constant(argc); |
| 489 | 489 |
| 490 Node* nodes[] = {centry, args..., ref, arity, context}; | 490 Node* nodes[] = {centry, args..., ref, arity, context}; |
| 491 | 491 |
| 492 CallPrologue(); | 492 CallPrologue(); |
| 493 Node* return_value = raw_assembler()->CallN(desc, arraysize(nodes), nodes); | 493 Node* return_value = raw_assembler()->CallN(desc, arraysize(nodes), nodes); |
| 494 CallEpilogue(); | 494 CallEpilogue(); |
| 495 return return_value; | 495 return return_value; |
| 496 } | 496 } |
| 497 | 497 |
| 498 // Instantiate CallRuntime() with up to 5 arguments. | 498 // Instantiate CallRuntime() with up to 6 arguments. |
| 499 #define INSTANTIATE(...) \ | 499 #define INSTANTIATE(...) \ |
| 500 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallRuntime( \ | 500 template V8_EXPORT_PRIVATE Node* CodeAssembler::CallRuntime( \ |
| 501 Runtime::FunctionId, __VA_ARGS__); | 501 Runtime::FunctionId, __VA_ARGS__); |
| 502 REPEAT_1_TO_6(INSTANTIATE, Node*) | 502 REPEAT_1_TO_7(INSTANTIATE, Node*) |
| 503 #undef INSTANTIATE | 503 #undef INSTANTIATE |
| 504 | 504 |
| 505 template <class... TArgs> | 505 template <class... TArgs> |
| 506 Node* CodeAssembler::TailCallRuntime(Runtime::FunctionId function, | 506 Node* CodeAssembler::TailCallRuntime(Runtime::FunctionId function, |
| 507 Node* context, TArgs... args) { | 507 Node* context, TArgs... args) { |
| 508 int argc = static_cast<int>(sizeof...(args)); | 508 int argc = static_cast<int>(sizeof...(args)); |
| 509 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( | 509 CallDescriptor* desc = Linkage::GetRuntimeCallDescriptor( |
| 510 zone(), function, argc, Operator::kNoProperties, | 510 zone(), function, argc, Operator::kNoProperties, |
| 511 CallDescriptor::kSupportsTailCalls); | 511 CallDescriptor::kSupportsTailCalls); |
| 512 int return_count = static_cast<int>(desc->ReturnCount()); | 512 int return_count = static_cast<int>(desc->ReturnCount()); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 | 821 |
| 822 bound_ = true; | 822 bound_ = true; |
| 823 } | 823 } |
| 824 | 824 |
| 825 } // namespace compiler | 825 } // namespace compiler |
| 826 } // namespace internal | 826 } // namespace internal |
| 827 } // namespace v8 | 827 } // namespace v8 |
| OLD | NEW |