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/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
| 10 #include "src/compiler/osr.h" |
10 #include "src/compiler/pipeline.h" | 11 #include "src/compiler/pipeline.h" |
11 #include "src/scopes.h" | 12 #include "src/scopes.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 namespace compiler { | 16 namespace compiler { |
16 | 17 |
17 | |
18 std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k) { | 18 std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k) { |
19 switch (k) { | 19 switch (k) { |
20 case CallDescriptor::kCallCodeObject: | 20 case CallDescriptor::kCallCodeObject: |
21 os << "Code"; | 21 os << "Code"; |
22 break; | 22 break; |
23 case CallDescriptor::kCallJSFunction: | 23 case CallDescriptor::kCallJSFunction: |
24 os << "JS"; | 24 os << "JS"; |
25 break; | 25 break; |
26 case CallDescriptor::kCallAddress: | 26 case CallDescriptor::kCallAddress: |
27 os << "Addr"; | 27 os << "Addr"; |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 for (size_t i = 0; i < InputCount(); ++i) { | 240 for (size_t i = 0; i < InputCount(); ++i) { |
241 if (!GetInputLocation(i).IsRegister()) return false; | 241 if (!GetInputLocation(i).IsRegister()) return false; |
242 } | 242 } |
243 for (size_t i = 0; i < ReturnCount(); ++i) { | 243 for (size_t i = 0; i < ReturnCount(); ++i) { |
244 if (!GetReturnLocation(i).IsRegister()) return false; | 244 if (!GetReturnLocation(i).IsRegister()) return false; |
245 } | 245 } |
246 return true; | 246 return true; |
247 } | 247 } |
248 | 248 |
249 | 249 |
250 //============================================================================== | |
251 // Provide unimplemented methods on unsupported architectures, to at least link. | |
252 //============================================================================== | |
253 #if !V8_TURBOFAN_BACKEND | |
254 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, | |
255 int parameter_count, | |
256 CallDescriptor::Flags flags) { | |
257 UNIMPLEMENTED(); | |
258 return NULL; | |
259 } | |
260 | |
261 | |
262 LinkageLocation Linkage::GetOsrValueLocation(int index) const { | 250 LinkageLocation Linkage::GetOsrValueLocation(int index) const { |
263 UNIMPLEMENTED(); | 251 CHECK(incoming_->IsJSFunctionCall()); |
264 return LinkageLocation(-1); // Dummy value | 252 int parameter_count = static_cast<int>(incoming_->JSParameterCount() - 1); |
| 253 int first_stack_slot = OsrHelper::FirstStackSlotIndex(parameter_count); |
| 254 |
| 255 if (index == kOsrContextSpillSlotIndex) { |
| 256 // Context. Use the parameter location of the context spill slot. |
| 257 // Parameter (arity + 1) is special for the context of the function frame. |
| 258 int context_index = 1 + 1 + parameter_count; // target + receiver + params |
| 259 return incoming_->GetInputLocation(context_index); |
| 260 } else if (index >= first_stack_slot) { |
| 261 // Local variable stored in this (callee) stack. |
| 262 int spill_index = index - first_stack_slot; |
| 263 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
| 264 } else { |
| 265 // Parameter. Use the assigned location from the incoming call descriptor. |
| 266 int parameter_index = 1 + index; // skip index 0, which is the target. |
| 267 return incoming_->GetInputLocation(parameter_index); |
| 268 } |
265 } | 269 } |
266 | |
267 | |
268 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | |
269 Zone* zone, Runtime::FunctionId function, int parameter_count, | |
270 Operator::Properties properties) { | |
271 UNIMPLEMENTED(); | |
272 return NULL; | |
273 } | |
274 | |
275 | |
276 CallDescriptor* Linkage::GetStubCallDescriptor( | |
277 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | |
278 int stack_parameter_count, CallDescriptor::Flags flags, | |
279 Operator::Properties properties, MachineType return_type) { | |
280 UNIMPLEMENTED(); | |
281 return NULL; | |
282 } | |
283 | |
284 | |
285 #endif // !V8_TURBOFAN_BACKEND | |
286 } // namespace compiler | 270 } // namespace compiler |
287 } // namespace internal | 271 } // namespace internal |
288 } // namespace v8 | 272 } // namespace v8 |
OLD | NEW |