| 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 24 matching lines...) Expand all Loading... |
| 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(); |
| 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->function() != NULL) { | 42 if (info->function() != NULL) { |
| 43 // If we already have the function literal, use the number of parameters | 43 // If we already have the function literal, use the number of parameters |
| 44 // plus the receiver. | 44 // plus the receiver. |
| 45 return GetJSCallDescriptor(zone, 1 + info->function()->parameter_count(), | 45 return GetJSCallDescriptor(zone, info->is_osr(), |
| 46 1 + info->function()->parameter_count(), |
| 46 CallDescriptor::kNoFlags); | 47 CallDescriptor::kNoFlags); |
| 47 } | 48 } |
| 48 if (!info->closure().is_null()) { | 49 if (!info->closure().is_null()) { |
| 49 // If we are compiling a JS function, use a JS call descriptor, | 50 // If we are compiling a JS function, use a JS call descriptor, |
| 50 // plus the receiver. | 51 // plus the receiver. |
| 51 SharedFunctionInfo* shared = info->closure()->shared(); | 52 SharedFunctionInfo* shared = info->closure()->shared(); |
| 52 return GetJSCallDescriptor(zone, 1 + shared->formal_parameter_count(), | 53 return GetJSCallDescriptor(zone, info->is_osr(), |
| 54 1 + shared->formal_parameter_count(), |
| 53 CallDescriptor::kNoFlags); | 55 CallDescriptor::kNoFlags); |
| 54 } | 56 } |
| 55 if (info->code_stub() != NULL) { | 57 if (info->code_stub() != NULL) { |
| 56 // Use the code stub interface descriptor. | 58 // Use the code stub interface descriptor. |
| 57 CallInterfaceDescriptor descriptor = | 59 CallInterfaceDescriptor descriptor = |
| 58 info->code_stub()->GetCallInterfaceDescriptor(); | 60 info->code_stub()->GetCallInterfaceDescriptor(); |
| 59 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0, | 61 return GetStubCallDescriptor(info->isolate(), zone, descriptor, 0, |
| 60 CallDescriptor::kNoFlags, | 62 CallDescriptor::kNoFlags, |
| 61 Operator::kNoProperties); | 63 Operator::kNoProperties); |
| 62 } | 64 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 87 int register_save_area_size = frame->GetRegisterSaveAreaSize(); | 89 int register_save_area_size = frame->GetRegisterSaveAreaSize(); |
| 88 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + | 90 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + |
| 89 kPCOnStackSize + extra; | 91 kPCOnStackSize + extra; |
| 90 return FrameOffset::FromStackPointer(offset); | 92 return FrameOffset::FromStackPointer(offset); |
| 91 } | 93 } |
| 92 } | 94 } |
| 93 | 95 |
| 94 | 96 |
| 95 CallDescriptor* Linkage::GetJSCallDescriptor( | 97 CallDescriptor* Linkage::GetJSCallDescriptor( |
| 96 int parameter_count, CallDescriptor::Flags flags) const { | 98 int parameter_count, CallDescriptor::Flags flags) const { |
| 97 return GetJSCallDescriptor(zone_, parameter_count, flags); | 99 return GetJSCallDescriptor(zone_, false, parameter_count, flags); |
| 98 } | 100 } |
| 99 | 101 |
| 100 | 102 |
| 101 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | 103 CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| 102 Runtime::FunctionId function, int parameter_count, | 104 Runtime::FunctionId function, int parameter_count, |
| 103 Operator::Properties properties) const { | 105 Operator::Properties properties) const { |
| 104 return GetRuntimeCallDescriptor(zone_, function, parameter_count, properties); | 106 return GetRuntimeCallDescriptor(zone_, function, parameter_count, properties); |
| 105 } | 107 } |
| 106 | 108 |
| 107 | 109 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 default: | 227 default: |
| 226 return false; | 228 return false; |
| 227 } | 229 } |
| 228 } | 230 } |
| 229 | 231 |
| 230 | 232 |
| 231 //============================================================================== | 233 //============================================================================== |
| 232 // Provide unimplemented methods on unsupported architectures, to at least link. | 234 // Provide unimplemented methods on unsupported architectures, to at least link. |
| 233 //============================================================================== | 235 //============================================================================== |
| 234 #if !V8_TURBOFAN_BACKEND | 236 #if !V8_TURBOFAN_BACKEND |
| 235 CallDescriptor* Linkage::GetJSCallDescriptor(Isolate* isolate, Zone* zone, | 237 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
| 236 int parameter_count, | 238 int parameter_count, |
| 237 CallDescriptor::Flags flags) { | 239 CallDescriptor::Flags flags) { |
| 238 UNIMPLEMENTED(); | 240 UNIMPLEMENTED(); |
| 239 return NULL; | 241 return NULL; |
| 240 } | 242 } |
| 241 | 243 |
| 242 | 244 |
| 243 LinkageLocation Linkage::GetOsrValueLocation(int index) const { | 245 LinkageLocation Linkage::GetOsrValueLocation(int index) const { |
| 244 UNIMPLEMENTED(); | 246 UNIMPLEMENTED(); |
| 245 return LinkageLocation(-1); // Dummy value | 247 return LinkageLocation(-1); // Dummy value |
| 246 } | 248 } |
| 247 | 249 |
| 248 | 250 |
| 249 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | 251 CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| 250 Runtime::FunctionId function, int parameter_count, | 252 Zone* zone, Runtime::FunctionId function, int parameter_count, |
| 251 Operator::Properties properties, Zone* zone) { | 253 Operator::Properties properties) { |
| 252 UNIMPLEMENTED(); | 254 UNIMPLEMENTED(); |
| 253 return NULL; | 255 return NULL; |
| 254 } | 256 } |
| 255 | 257 |
| 256 | 258 |
| 257 CallDescriptor* Linkage::GetStubCallDescriptor( | 259 CallDescriptor* Linkage::GetStubCallDescriptor( |
| 258 const CallInterfaceDescriptor& descriptor, int stack_parameter_count, | 260 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
| 259 CallDescriptor::Flags flags, Operator::Properties properties, | 261 int stack_parameter_count, CallDescriptor::Flags flags, |
| 260 Zone* zone) { | 262 Operator::Properties properties) { |
| 261 UNIMPLEMENTED(); | 263 UNIMPLEMENTED(); |
| 262 return NULL; | 264 return NULL; |
| 263 } | 265 } |
| 264 | 266 |
| 265 | 267 |
| 266 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | 268 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, |
| 267 MachineSignature* sig) { | 269 MachineSignature* sig) { |
| 268 UNIMPLEMENTED(); | 270 UNIMPLEMENTED(); |
| 269 return NULL; | 271 return NULL; |
| 270 } | 272 } |
| 271 #endif // !V8_TURBOFAN_BACKEND | 273 #endif // !V8_TURBOFAN_BACKEND |
| 272 } | 274 } |
| 273 } | 275 } |
| 274 } // namespace v8::internal::compiler | 276 } // namespace v8::internal::compiler |
| OLD | NEW |