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