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
3 // found in the LICENSE file.
5 #include "src/assembler.h"
6 #include "src/code-stubs.h"
7 #include "src/compiler/linkage.h"
8 #include "src/compiler/linkage-impl.h"
15 struct IA32LinkageHelperTraits {
16 static Register ReturnValueReg() { return eax; }
17 static Register ReturnValue2Reg() { return edx; }
18 static Register JSCallFunctionReg() { return edi; }
19 static Register ContextReg() { return esi; }
20 static Register RuntimeCallFunctionReg() { return ebx; }
21 static Register RuntimeCallArgCountReg() { return eax; }
22 static RegList CCalleeSaveRegisters() {
23 return esi.bit() | edi.bit() | ebx.bit();
25 static Register CRegisterParameter(int i) { return no_reg; }
26 static int CRegisterParametersLength() { return 0; }
29 typedef LinkageHelper<IA32LinkageHelperTraits> LH;
31 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
33 CallDescriptor::Flags flags) {
34 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags);
38 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
39 Zone* zone, Runtime::FunctionId function, int parameter_count,
40 Operator::Properties properties) {
41 return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
46 CallDescriptor* Linkage::GetStubCallDescriptor(
47 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
48 int stack_parameter_count, CallDescriptor::Flags flags,
49 Operator::Properties properties, MachineType return_type) {
50 return LH::GetStubCallDescriptor(isolate, zone, descriptor,
51 stack_parameter_count, flags, properties,
56 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
57 const MachineSignature* sig) {
58 return LH::GetSimplifiedCDescriptor(zone, sig);
61 } // namespace compiler
62 } // namespace internal