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 MipsLinkageHelperTraits {
16 static Register ReturnValueReg() { return v0; }
17 static Register ReturnValue2Reg() { return v1; }
18 static Register JSCallFunctionReg() { return a1; }
19 static Register ContextReg() { return cp; }
20 static Register RuntimeCallFunctionReg() { return a1; }
21 static Register RuntimeCallArgCountReg() { return a0; }
22 static RegList CCalleeSaveRegisters() {
23 return s0.bit() | s1.bit() | s2.bit() | s3.bit() | s4.bit() | s5.bit() |
26 static Register CRegisterParameter(int i) {
27 static Register register_parameters[] = {a0, a1, a2, a3, a4, a5, a6, a7};
28 return register_parameters[i];
30 static int CRegisterParametersLength() { return 8; }
34 typedef LinkageHelper<MipsLinkageHelperTraits> 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) {
55 return LH::GetStubCallDescriptor(isolate, zone, descriptor,
56 stack_parameter_count, flags, properties);
60 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone,
61 const MachineSignature* sig) {
62 return LH::GetSimplifiedCDescriptor(zone, sig);
65 } // namespace compiler
66 } // namespace internal