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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 msig, // machine_sig | 226 msig, // machine_sig |
227 locations.Build(), // location_sig | 227 locations.Build(), // location_sig |
228 0, // js_parameter_count | 228 0, // js_parameter_count |
229 Operator::kNoProperties, // properties | 229 Operator::kNoProperties, // properties |
230 LinkageTraits::CCalleeSaveRegisters(), // callee-saved registers | 230 LinkageTraits::CCalleeSaveRegisters(), // callee-saved registers |
231 LinkageTraits::CCalleeSaveFPRegisters(), // callee-saved fp regs | 231 LinkageTraits::CCalleeSaveFPRegisters(), // callee-saved fp regs |
232 CallDescriptor::kNoFlags, // flags | 232 CallDescriptor::kNoFlags, // flags |
233 "c-call"); | 233 "c-call"); |
234 } | 234 } |
235 | 235 |
236 static CallDescriptor* GetInterpreterDispatchDescriptor( | 236 static CallDescriptor* GetInterpreterDispatchDescriptor(Zone* zone) { |
237 Zone* zone, const MachineSignature* msig) { | 237 MachineSignature::Builder types(zone, 0, 2); |
238 DCHECK_EQ(0, msig->parameter_count()); | 238 LocationSignature::Builder locations(zone, 0, 2); |
239 LocationSignature::Builder locations(zone, msig->return_count(), | 239 |
240 msig->parameter_count()); | 240 // Add registers for fixed parameters passed via interpreter dispatch. |
241 AddReturnLocations(&locations); | 241 STATIC_ASSERT(0 == Linkage::kInterpreterBytecodeParameter); |
| 242 types.AddParam(kMachPtr); |
| 243 locations.AddParam(regloc(LinkageTraits::InterpreterBytecodePointerReg())); |
| 244 |
| 245 STATIC_ASSERT(1 == Linkage::kInterpreterDispatchTableParameter); |
| 246 types.AddParam(kMachPtr); |
| 247 locations.AddParam(regloc(LinkageTraits::InterpreterDispatchTableReg())); |
| 248 |
242 LinkageLocation target_loc = LinkageLocation::AnyRegister(); | 249 LinkageLocation target_loc = LinkageLocation::AnyRegister(); |
243 return new (zone) CallDescriptor( // -- | 250 return new (zone) CallDescriptor( // -- |
244 CallDescriptor::kInterpreterDispatch, // kind | 251 CallDescriptor::kInterpreterDispatch, // kind |
245 kMachNone, // target MachineType | 252 kMachNone, // target MachineType |
246 target_loc, // target location | 253 target_loc, // target location |
247 msig, // machine_sig | 254 types.Build(), // machine_sig |
248 locations.Build(), // location_sig | 255 locations.Build(), // location_sig |
249 0, // js_parameter_count | 256 0, // js_parameter_count |
250 Operator::kNoProperties, // properties | 257 Operator::kNoProperties, // properties |
251 kNoCalleeSaved, // callee-saved registers | 258 kNoCalleeSaved, // callee-saved registers |
252 kNoCalleeSaved, // callee-saved fp regs | 259 kNoCalleeSaved, // callee-saved fp regs |
253 CallDescriptor::kSupportsTailCalls, // flags | 260 CallDescriptor::kSupportsTailCalls, // flags |
254 "interpreter-dispatch"); | 261 "interpreter-dispatch"); |
255 } | 262 } |
256 | 263 |
257 static LinkageLocation regloc(Register reg) { | 264 static LinkageLocation regloc(Register reg) { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 int parameter_index = 1 + index; // skip index 0, which is the target. | 322 int parameter_index = 1 + index; // skip index 0, which is the target. |
316 return incoming_->GetInputLocation(parameter_index); | 323 return incoming_->GetInputLocation(parameter_index); |
317 } | 324 } |
318 } | 325 } |
319 | 326 |
320 } // namespace compiler | 327 } // namespace compiler |
321 } // namespace internal | 328 } // namespace internal |
322 } // namespace v8 | 329 } // namespace v8 |
323 | 330 |
324 #endif // V8_COMPILER_LINKAGE_IMPL_H_ | 331 #endif // V8_COMPILER_LINKAGE_IMPL_H_ |
OLD | NEW |