| 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 #include "src/assembler.h" | 5 #include "src/assembler.h" |
| 6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
| 7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
| 8 #include "src/compiler/linkage-impl.h" | 8 #include "src/compiler/linkage-impl.h" |
| 9 #include "src/zone.h" | 9 #include "src/zone.h" |
| 10 | 10 |
| 11 namespace v8 { | 11 namespace v8 { |
| 12 namespace internal { | 12 namespace internal { |
| 13 namespace compiler { | 13 namespace compiler { |
| 14 | 14 |
| 15 struct MipsLinkageHelperTraits { | 15 struct MipsLinkageHelperTraits { |
| 16 static Register ReturnValueReg() { return v0; } | 16 static Register ReturnValueReg() { return v0; } |
| 17 static Register ReturnValue2Reg() { return v1; } | 17 static Register ReturnValue2Reg() { return v1; } |
| 18 static Register JSCallFunctionReg() { return a1; } | 18 static Register JSCallFunctionReg() { return a1; } |
| 19 static Register ContextReg() { return cp; } | 19 static Register ContextReg() { return cp; } |
| 20 static Register InterpreterBytecodePointerReg() { return s0; } | 20 static Register InterpreterBytecodePointerReg() { return s0; } |
| 21 static Register InterpreterDispatchTableReg() { return s1; } | 21 static Register InterpreterDispatchTableReg() { return s1; } |
| 22 static Register RuntimeCallFunctionReg() { return a1; } | 22 static Register RuntimeCallFunctionReg() { return a1; } |
| 23 static Register RuntimeCallArgCountReg() { return a0; } | 23 static Register RuntimeCallArgCountReg() { return a0; } |
| 24 static RegList CCalleeSaveRegisters() { | |
| 25 return s0.bit() | s1.bit() | s2.bit() | s3.bit() | s4.bit() | s5.bit() | | |
| 26 s6.bit() | s7.bit(); | |
| 27 } | |
| 28 static RegList CCalleeSaveFPRegisters() { | |
| 29 return f20.bit() | f22.bit() | f24.bit() | f26.bit() | f28.bit() | | |
| 30 f30.bit(); | |
| 31 } | |
| 32 static Register CRegisterParameter(int i) { | |
| 33 static Register register_parameters[] = {a0, a1, a2, a3}; | |
| 34 return register_parameters[i]; | |
| 35 } | |
| 36 static int CRegisterParametersLength() { return 4; } | |
| 37 static int CStackBackingStoreLength() { return 0; } | |
| 38 }; | 24 }; |
| 39 | 25 |
| 40 | 26 |
| 41 typedef LinkageHelper<MipsLinkageHelperTraits> LH; | 27 typedef LinkageHelper<MipsLinkageHelperTraits> LH; |
| 42 | 28 |
| 43 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, | 29 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
| 44 int parameter_count, | 30 int parameter_count, |
| 45 CallDescriptor::Flags flags) { | 31 CallDescriptor::Flags flags) { |
| 46 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags); | 32 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags); |
| 47 } | 33 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 58 CallDescriptor* Linkage::GetStubCallDescriptor( | 44 CallDescriptor* Linkage::GetStubCallDescriptor( |
| 59 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | 45 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
| 60 int stack_parameter_count, CallDescriptor::Flags flags, | 46 int stack_parameter_count, CallDescriptor::Flags flags, |
| 61 Operator::Properties properties, MachineType return_type) { | 47 Operator::Properties properties, MachineType return_type) { |
| 62 return LH::GetStubCallDescriptor(isolate, zone, descriptor, | 48 return LH::GetStubCallDescriptor(isolate, zone, descriptor, |
| 63 stack_parameter_count, flags, properties, | 49 stack_parameter_count, flags, properties, |
| 64 return_type); | 50 return_type); |
| 65 } | 51 } |
| 66 | 52 |
| 67 | 53 |
| 68 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | |
| 69 const MachineSignature* sig) { | |
| 70 return LH::GetSimplifiedCDescriptor(zone, sig); | |
| 71 } | |
| 72 | |
| 73 | |
| 74 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { | 54 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { |
| 75 return LH::GetInterpreterDispatchDescriptor(zone); | 55 return LH::GetInterpreterDispatchDescriptor(zone); |
| 76 } | 56 } |
| 77 | 57 |
| 78 } // namespace compiler | 58 } // namespace compiler |
| 79 } // namespace internal | 59 } // namespace internal |
| 80 } // namespace v8 | 60 } // namespace v8 |
| OLD | NEW |