Chromium Code Reviews| 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 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ | 5 #ifndef V8_COMPILER_LINKAGE_IMPL_H_ |
| 6 #define V8_COMPILER_LINKAGE_IMPL_H_ | 6 #define V8_COMPILER_LINKAGE_IMPL_H_ |
| 7 | 7 |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/compiler/osr.h" | 9 #include "src/compiler/osr.h" |
| 10 #include "src/runtime/runtime.h" | |
| 10 | 11 |
| 11 namespace v8 { | 12 namespace v8 { |
| 12 namespace internal { | 13 namespace internal { |
| 13 namespace compiler { | 14 namespace compiler { |
| 14 | 15 |
| 15 // TODO(titzer): replace uses of int with size_t in LinkageHelper. | 16 // TODO(titzer): replace uses of int with size_t in LinkageHelper. |
| 16 template <typename LinkageTraits> | 17 template <typename LinkageTraits> |
| 17 class LinkageHelper { | 18 class LinkageHelper { |
| 18 public: | 19 public: |
| 19 static const RegList kNoCalleeSaved = 0; | 20 static const RegList kNoCalleeSaved = 0; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 locations.AddParam(regloc(LinkageTraits::RuntimeCallArgCountReg())); | 113 locations.AddParam(regloc(LinkageTraits::RuntimeCallArgCountReg())); |
| 113 types.AddParam(kMachPtr); | 114 types.AddParam(kMachPtr); |
| 114 | 115 |
| 115 // Add context. | 116 // Add context. |
| 116 locations.AddParam(regloc(LinkageTraits::ContextReg())); | 117 locations.AddParam(regloc(LinkageTraits::ContextReg())); |
| 117 types.AddParam(kMachAnyTagged); | 118 types.AddParam(kMachAnyTagged); |
| 118 | 119 |
| 119 CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0 | 120 CallDescriptor::Flags flags = Linkage::FrameStateInputCount(function_id) > 0 |
| 120 ? CallDescriptor::kNeedsFrameState | 121 ? CallDescriptor::kNeedsFrameState |
| 121 : CallDescriptor::kNoFlags; | 122 : CallDescriptor::kNoFlags; |
| 123 if (Runtime::SupportsTailCall(function_id)) { | |
|
Michael Starzinger
2015/08/04 15:01:54
This new predicate on {Runtime} is similar to Link
| |
| 124 flags |= CallDescriptor::kSupportsTailCalls; | |
| 125 } | |
| 122 | 126 |
| 123 // The target for runtime calls is a code object. | 127 // The target for runtime calls is a code object. |
| 124 MachineType target_type = kMachAnyTagged; | 128 MachineType target_type = kMachAnyTagged; |
| 125 LinkageLocation target_loc = LinkageLocation::AnyRegister(); | 129 LinkageLocation target_loc = LinkageLocation::AnyRegister(); |
| 126 return new (zone) CallDescriptor( // -- | 130 return new (zone) CallDescriptor( // -- |
| 127 CallDescriptor::kCallCodeObject, // kind | 131 CallDescriptor::kCallCodeObject, // kind |
| 128 target_type, // target MachineType | 132 target_type, // target MachineType |
| 129 target_loc, // target location | 133 target_loc, // target location |
| 130 types.Build(), // machine_sig | 134 types.Build(), // machine_sig |
| 131 locations.Build(), // location_sig | 135 locations.Build(), // location_sig |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 int parameter_index = 1 + index; // skip index 0, which is the target. | 326 int parameter_index = 1 + index; // skip index 0, which is the target. |
| 323 return incoming_->GetInputLocation(parameter_index); | 327 return incoming_->GetInputLocation(parameter_index); |
| 324 } | 328 } |
| 325 } | 329 } |
| 326 | 330 |
| 327 } // namespace compiler | 331 } // namespace compiler |
| 328 } // namespace internal | 332 } // namespace internal |
| 329 } // namespace v8 | 333 } // namespace v8 |
| 330 | 334 |
| 331 #endif // V8_COMPILER_LINKAGE_IMPL_H_ | 335 #endif // V8_COMPILER_LINKAGE_IMPL_H_ |
| OLD | NEW |