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/code-stubs.h" | 5 #include "src/code-stubs.h" |
6 #include "src/compiler.h" | 6 #include "src/compiler.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
9 #include "src/compiler/pipeline.h" | 9 #include "src/compiler/pipeline.h" |
10 #include "src/scopes.h" | 10 #include "src/scopes.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 break; | 27 break; |
28 } | 28 } |
29 return os; | 29 return os; |
30 } | 30 } |
31 | 31 |
32 | 32 |
33 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { | 33 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) { |
34 // TODO(svenpanne) Output properties etc. and be less cryptic. | 34 // TODO(svenpanne) Output properties etc. and be less cryptic. |
35 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() | 35 return os << d.kind() << ":" << d.debug_name() << ":r" << d.ReturnCount() |
36 << "j" << d.JSParameterCount() << "i" << d.InputCount() << "f" | 36 << "j" << d.JSParameterCount() << "i" << d.InputCount() << "f" |
37 << d.FrameStateCount(); | 37 << d.FrameStateCount() << "t" << d.IsTailCallAllowed(); |
38 } | 38 } |
39 | 39 |
40 | 40 |
41 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { | 41 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
42 if (info->code_stub() != NULL) { | 42 if (info->code_stub() != NULL) { |
43 // Use the code stub interface descriptor. | 43 // Use the code stub interface descriptor. |
44 CallInterfaceDescriptor descriptor = | 44 CallInterfaceDescriptor descriptor = |
45 info->code_stub()->GetCallInterfaceDescriptor(); | 45 info->code_stub()->GetCallInterfaceDescriptor(); |
46 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0, | 46 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0, |
47 CallDescriptor::kNoFlags, | 47 CallDescriptor::kNoFlags, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 // Most inlined runtime functions (except the ones listed above) can be called | 135 // Most inlined runtime functions (except the ones listed above) can be called |
136 // without a FrameState or will be lowered by JSIntrinsicLowering internally. | 136 // without a FrameState or will be lowered by JSIntrinsicLowering internally. |
137 const Runtime::Function* const f = Runtime::FunctionForId(function); | 137 const Runtime::Function* const f = Runtime::FunctionForId(function); |
138 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false; | 138 if (f->intrinsic_type == Runtime::IntrinsicType::INLINE) return false; |
139 | 139 |
140 return true; | 140 return true; |
141 } | 141 } |
142 | 142 |
143 | 143 |
| 144 bool CallDescriptor::UsesOnlyRegisters() const { |
| 145 for (size_t i = 0; i < InputCount(); ++i) { |
| 146 if (!GetInputLocation(i).is_register()) return false; |
| 147 } |
| 148 for (size_t i = 0; i < ReturnCount(); ++i) { |
| 149 if (!GetReturnLocation(i).is_register()) return false; |
| 150 } |
| 151 return true; |
| 152 } |
| 153 |
| 154 |
144 //============================================================================== | 155 //============================================================================== |
145 // Provide unimplemented methods on unsupported architectures, to at least link. | 156 // Provide unimplemented methods on unsupported architectures, to at least link. |
146 //============================================================================== | 157 //============================================================================== |
147 #if !V8_TURBOFAN_BACKEND | 158 #if !V8_TURBOFAN_BACKEND |
148 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, | 159 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
149 int parameter_count, | 160 int parameter_count, |
150 CallDescriptor::Flags flags) { | 161 CallDescriptor::Flags flags) { |
151 UNIMPLEMENTED(); | 162 UNIMPLEMENTED(); |
152 return NULL; | 163 return NULL; |
153 } | 164 } |
(...skipping 24 matching lines...) Expand all Loading... |
178 | 189 |
179 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | 190 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, |
180 const MachineSignature* sig) { | 191 const MachineSignature* sig) { |
181 UNIMPLEMENTED(); | 192 UNIMPLEMENTED(); |
182 return NULL; | 193 return NULL; |
183 } | 194 } |
184 #endif // !V8_TURBOFAN_BACKEND | 195 #endif // !V8_TURBOFAN_BACKEND |
185 } | 196 } |
186 } | 197 } |
187 } // namespace v8::internal::compiler | 198 } // namespace v8::internal::compiler |
OLD | NEW |