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 | 10 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 js_parameter_count, // js_parameter_count | 127 js_parameter_count, // js_parameter_count |
128 properties, // properties | 128 properties, // properties |
129 kNoCalleeSaved, // callee-saved | 129 kNoCalleeSaved, // callee-saved |
130 flags, // flags | 130 flags, // flags |
131 function->name); // debug name | 131 function->name); // debug name |
132 } | 132 } |
133 | 133 |
134 | 134 |
135 // TODO(turbofan): cache call descriptors for code stub calls. | 135 // TODO(turbofan): cache call descriptors for code stub calls. |
136 static CallDescriptor* GetStubCallDescriptor( | 136 static CallDescriptor* GetStubCallDescriptor( |
137 Zone* zone, const CallInterfaceDescriptor& descriptor, | 137 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
138 int stack_parameter_count, CallDescriptor::Flags flags, | 138 int stack_parameter_count, CallDescriptor::Flags flags, |
139 Operator::Properties properties) { | 139 Operator::Properties properties) { |
140 const int register_parameter_count = | 140 const int register_parameter_count = |
141 descriptor.GetEnvironmentParameterCount(); | 141 descriptor.GetEnvironmentParameterCount(); |
142 const int js_parameter_count = | 142 const int js_parameter_count = |
143 register_parameter_count + stack_parameter_count; | 143 register_parameter_count + stack_parameter_count; |
144 const int context_count = 1; | 144 const int context_count = 1; |
145 const size_t return_count = 1; | 145 const size_t return_count = 1; |
146 const size_t parameter_count = | 146 const size_t parameter_count = |
147 static_cast<size_t>(js_parameter_count + context_count); | 147 static_cast<size_t>(js_parameter_count + context_count); |
(...skipping 28 matching lines...) Expand all Loading... |
176 return new (zone) CallDescriptor( // -- | 176 return new (zone) CallDescriptor( // -- |
177 CallDescriptor::kCallCodeObject, // kind | 177 CallDescriptor::kCallCodeObject, // kind |
178 target_type, // target MachineType | 178 target_type, // target MachineType |
179 target_loc, // target location | 179 target_loc, // target location |
180 types.Build(), // machine_sig | 180 types.Build(), // machine_sig |
181 locations.Build(), // location_sig | 181 locations.Build(), // location_sig |
182 js_parameter_count, // js_parameter_count | 182 js_parameter_count, // js_parameter_count |
183 properties, // properties | 183 properties, // properties |
184 kNoCalleeSaved, // callee-saved registers | 184 kNoCalleeSaved, // callee-saved registers |
185 flags, // flags | 185 flags, // flags |
186 descriptor.DebugName(zone->isolate())); | 186 descriptor.DebugName(isolate)); |
187 } | 187 } |
188 | 188 |
189 static CallDescriptor* GetSimplifiedCDescriptor(Zone* zone, | 189 static CallDescriptor* GetSimplifiedCDescriptor(Zone* zone, |
190 MachineSignature* msig) { | 190 MachineSignature* msig) { |
191 LocationSignature::Builder locations(zone, msig->return_count(), | 191 LocationSignature::Builder locations(zone, msig->return_count(), |
192 msig->parameter_count()); | 192 msig->parameter_count()); |
193 // Add return location(s). | 193 // Add return location(s). |
194 AddReturnLocations(&locations); | 194 AddReturnLocations(&locations); |
195 | 195 |
196 // Add register and/or stack parameter(s). | 196 // Add register and/or stack parameter(s). |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 return incoming_->GetInputLocation(parameter_index); | 247 return incoming_->GetInputLocation(parameter_index); |
248 } | 248 } |
249 } | 249 } |
250 | 250 |
251 | 251 |
252 } // namespace compiler | 252 } // namespace compiler |
253 } // namespace internal | 253 } // namespace internal |
254 } // namespace v8 | 254 } // namespace v8 |
255 | 255 |
256 #endif // V8_COMPILER_LINKAGE_IMPL_H_ | 256 #endif // V8_COMPILER_LINKAGE_IMPL_H_ |
OLD | NEW |