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 ArmLinkageHelperTraits { | 15 struct ArmLinkageHelperTraits { |
16 static Register ReturnValueReg() { return r0; } | 16 static Register ReturnValueReg() { return r0; } |
17 static Register ReturnValue2Reg() { return r1; } | 17 static Register ReturnValue2Reg() { return r1; } |
18 static Register JSCallFunctionReg() { return r1; } | 18 static Register JSCallFunctionReg() { return r1; } |
19 static Register ContextReg() { return cp; } | 19 static Register ContextReg() { return cp; } |
20 static Register InterpreterBytecodePointerReg() { return r6; } | 20 static Register InterpreterBytecodePointerReg() { return r6; } |
21 static Register InterpreterDispatchTableReg() { return r8; } | 21 static Register InterpreterDispatchTableReg() { return r8; } |
22 static Register RuntimeCallFunctionReg() { return r1; } | 22 static Register RuntimeCallFunctionReg() { return r1; } |
23 static Register RuntimeCallArgCountReg() { return r0; } | 23 static Register RuntimeCallArgCountReg() { return r0; } |
24 static RegList CCalleeSaveRegisters() { | |
25 return r4.bit() | r5.bit() | r6.bit() | r7.bit() | r8.bit() | r9.bit() | | |
26 r10.bit(); | |
27 } | |
28 static RegList CCalleeSaveFPRegisters() { | |
29 return (1 << d8.code()) | (1 << d9.code()) | (1 << d10.code()) | | |
30 (1 << d11.code()) | (1 << d12.code()) | (1 << d13.code()) | | |
31 (1 << d14.code()) | (1 << d15.code()); | |
32 } | |
33 static Register CRegisterParameter(int i) { | |
34 static Register register_parameters[] = {r0, r1, r2, r3}; | |
35 return register_parameters[i]; | |
36 } | |
37 static int CRegisterParametersLength() { return 4; } | |
38 static int CStackBackingStoreLength() { return 0; } | |
39 }; | 24 }; |
40 | 25 |
41 | 26 |
42 typedef LinkageHelper<ArmLinkageHelperTraits> LH; | 27 typedef LinkageHelper<ArmLinkageHelperTraits> LH; |
43 | 28 |
44 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, | 29 CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
45 int parameter_count, | 30 int parameter_count, |
46 CallDescriptor::Flags flags) { | 31 CallDescriptor::Flags flags) { |
47 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags); | 32 return LH::GetJSCallDescriptor(zone, is_osr, parameter_count, flags); |
48 } | 33 } |
(...skipping 10 matching lines...) Expand all Loading... |
59 CallDescriptor* Linkage::GetStubCallDescriptor( | 44 CallDescriptor* Linkage::GetStubCallDescriptor( |
60 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, | 45 Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, |
61 int stack_parameter_count, CallDescriptor::Flags flags, | 46 int stack_parameter_count, CallDescriptor::Flags flags, |
62 Operator::Properties properties, MachineType return_type) { | 47 Operator::Properties properties, MachineType return_type) { |
63 return LH::GetStubCallDescriptor(isolate, zone, descriptor, | 48 return LH::GetStubCallDescriptor(isolate, zone, descriptor, |
64 stack_parameter_count, flags, properties, | 49 stack_parameter_count, flags, properties, |
65 return_type); | 50 return_type); |
66 } | 51 } |
67 | 52 |
68 | 53 |
69 CallDescriptor* Linkage::GetSimplifiedCDescriptor(Zone* zone, | |
70 const MachineSignature* sig) { | |
71 return LH::GetSimplifiedCDescriptor(zone, sig); | |
72 } | |
73 | |
74 | |
75 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { | 54 CallDescriptor* Linkage::GetInterpreterDispatchDescriptor(Zone* zone) { |
76 return LH::GetInterpreterDispatchDescriptor(zone); | 55 return LH::GetInterpreterDispatchDescriptor(zone); |
77 } | 56 } |
78 | 57 |
79 } // namespace compiler | 58 } // namespace compiler |
80 } // namespace internal | 59 } // namespace internal |
81 } // namespace v8 | 60 } // namespace v8 |
OLD | NEW |