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(1 + info->function()->parameter_count(), zone); | 45 return GetJSCallDescriptor(1 + info->function()->parameter_count(), zone, |
| 46 CallDescriptor::kNoFlags); |
46 } | 47 } |
47 if (!info->closure().is_null()) { | 48 if (!info->closure().is_null()) { |
48 // If we are compiling a JS function, use a JS call descriptor, | 49 // If we are compiling a JS function, use a JS call descriptor, |
49 // plus the receiver. | 50 // plus the receiver. |
50 SharedFunctionInfo* shared = info->closure()->shared(); | 51 SharedFunctionInfo* shared = info->closure()->shared(); |
51 return GetJSCallDescriptor(1 + shared->formal_parameter_count(), zone); | 52 return GetJSCallDescriptor(1 + shared->formal_parameter_count(), zone, |
| 53 CallDescriptor::kNoFlags); |
52 } | 54 } |
53 if (info->code_stub() != NULL) { | 55 if (info->code_stub() != NULL) { |
54 // Use the code stub interface descriptor. | 56 // Use the code stub interface descriptor. |
55 CallInterfaceDescriptor descriptor = | 57 CallInterfaceDescriptor descriptor = |
56 info->code_stub()->GetCallInterfaceDescriptor(); | 58 info->code_stub()->GetCallInterfaceDescriptor(); |
57 return GetStubCallDescriptor(descriptor, 0, CallDescriptor::kNoFlags, zone); | 59 return GetStubCallDescriptor(descriptor, 0, CallDescriptor::kNoFlags, zone); |
58 } | 60 } |
59 return NULL; // TODO(titzer): ? | 61 return NULL; // TODO(titzer): ? |
60 } | 62 } |
61 | 63 |
(...skipping 19 matching lines...) Expand all Loading... |
81 // No frame. Retrieve all parameters relative to stack pointer. | 83 // No frame. Retrieve all parameters relative to stack pointer. |
82 DCHECK(spill_slot < 0); // Must be a parameter. | 84 DCHECK(spill_slot < 0); // Must be a parameter. |
83 int register_save_area_size = frame->GetRegisterSaveAreaSize(); | 85 int register_save_area_size = frame->GetRegisterSaveAreaSize(); |
84 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + | 86 int offset = register_save_area_size - (spill_slot + 1) * kPointerSize + |
85 kPCOnStackSize + extra; | 87 kPCOnStackSize + extra; |
86 return FrameOffset::FromStackPointer(offset); | 88 return FrameOffset::FromStackPointer(offset); |
87 } | 89 } |
88 } | 90 } |
89 | 91 |
90 | 92 |
91 CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count) const { | 93 CallDescriptor* Linkage::GetJSCallDescriptor( |
92 return GetJSCallDescriptor(parameter_count, zone_); | 94 int parameter_count, CallDescriptor::Flags flags) const { |
| 95 return GetJSCallDescriptor(parameter_count, zone_, flags); |
93 } | 96 } |
94 | 97 |
95 | 98 |
96 CallDescriptor* Linkage::GetRuntimeCallDescriptor( | 99 CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
97 Runtime::FunctionId function, int parameter_count, | 100 Runtime::FunctionId function, int parameter_count, |
98 Operator::Properties properties) const { | 101 Operator::Properties properties) const { |
99 return GetRuntimeCallDescriptor(function, parameter_count, properties, zone_); | 102 return GetRuntimeCallDescriptor(function, parameter_count, properties, zone_); |
100 } | 103 } |
101 | 104 |
102 | 105 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 | 244 |
242 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | 245 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, |
243 MachineSignature* sig) { | 246 MachineSignature* sig) { |
244 UNIMPLEMENTED(); | 247 UNIMPLEMENTED(); |
245 return NULL; | 248 return NULL; |
246 } | 249 } |
247 #endif // !V8_TURBOFAN_BACKEND | 250 #endif // !V8_TURBOFAN_BACKEND |
248 } | 251 } |
249 } | 252 } |
250 } // namespace v8::internal::compiler | 253 } // namespace v8::internal::compiler |
OLD | NEW |