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 ArmLinkageHelperTraits {
16 static Register ReturnValueReg() { return r0; }
17 static Register ReturnValue2Reg() { return r1; }
18 static Register JSCallFunctionReg() { return r1; }
19 static Register ContextReg() { return cp; }
20 static Register RuntimeCallFunctionReg() { return r1; }
21 static Register RuntimeCallArgCountReg() { return r0; }
22 static RegList CCalleeSaveRegisters() {
23 return r4.bit() | r5.bit() | r6.bit() | r7.bit() | r8.bit() | r9.bit() |
26 static Register CRegisterParameter(int i) {
27 static Register register_parameters[] = {r0, r1, r2, r3};
28 return register_parameters[i];
30 static int CRegisterParametersLength() { return 4; }
34 typedef LinkageHelper<ArmLinkageHelperTraits> LH;
36 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr,
38 CallDescriptor::Flags flags) {
39 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags);
43 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
44 Zone* zone, Runtime::FunctionId function, int parameter_count,
45 Operator::Properties properties) {
46 return LH::GetRuntimeCallDescriptor(zone, function, parameter_count,
51 CallDescriptor* Linkage::GetStubCallDescriptor(
52 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor,
53 int stack_parameter_count, CallDescriptor::Flags flags,
54 Operator::Properties properties, MachineType return_type) {
55 return LH::GetStubCallDescriptor(isolate, zone, descriptor,
56 stack_parameter_count, flags, properties,
61 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
62 const MachineSignature* sig) {
63 return LH::GetSimplifiedCDescriptor(zone, sig);
66 } // namespace compiler
67 } // namespace internal