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 #ifndef V8_CCTEST_COMPILER_CALL_TESTER_H_ | 5 #ifndef V8_CCTEST_COMPILER_CALL_TESTER_H_ |
6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_ | 6 #define V8_CCTEST_COMPILER_CALL_TESTER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/simulator.h" | 10 #include "src/simulator.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 template <> | 121 template <> |
122 struct ParameterTraits<int*> { | 122 struct ParameterTraits<int*> { |
123 static uintptr_t Cast(int* r) { return reinterpret_cast<uintptr_t>(r); } | 123 static uintptr_t Cast(int* r) { return reinterpret_cast<uintptr_t>(r); } |
124 }; | 124 }; |
125 | 125 |
126 template <typename T> | 126 template <typename T> |
127 struct ParameterTraits<T*> { | 127 struct ParameterTraits<T*> { |
128 static uintptr_t Cast(void* r) { return reinterpret_cast<uintptr_t>(r); } | 128 static uintptr_t Cast(void* r) { return reinterpret_cast<uintptr_t>(r); } |
129 }; | 129 }; |
130 | 130 |
| 131 |
| 132 #if !V8_TARGET_ARCH_32_BIT |
| 133 |
131 // Additional template specialization required for mips64 to sign-extend | 134 // Additional template specialization required for mips64 to sign-extend |
132 // parameters defined by calling convention. | 135 // parameters defined by calling convention. |
133 template <> | 136 template <> |
134 struct ParameterTraits<int32_t> { | 137 struct ParameterTraits<int32_t> { |
135 static int64_t Cast(int32_t r) { return static_cast<int64_t>(r); } | 138 static int64_t Cast(int32_t r) { return static_cast<int64_t>(r); } |
136 }; | 139 }; |
137 | 140 |
138 template <> | 141 template <> |
139 struct ParameterTraits<uint32_t> { | 142 struct ParameterTraits<uint32_t> { |
140 static int64_t Cast(uint32_t r) { | 143 static int64_t Cast(uint32_t r) { |
141 return static_cast<int64_t>(static_cast<int32_t>(r)); | 144 return static_cast<int64_t>(static_cast<int32_t>(r)); |
142 } | 145 } |
143 }; | 146 }; |
144 | 147 |
| 148 #endif // !V8_TARGET_ARCH_64_BIT |
| 149 |
| 150 |
145 class CallHelper { | 151 class CallHelper { |
146 public: | 152 public: |
147 explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig) | 153 explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig) |
148 : machine_sig_(machine_sig), isolate_(isolate) { | 154 : machine_sig_(machine_sig), isolate_(isolate) { |
149 USE(isolate_); | 155 USE(isolate_); |
150 } | 156 } |
151 virtual ~CallHelper() {} | 157 virtual ~CallHelper() {} |
152 | 158 |
153 static MachineSignature* MakeMachineSignature( | 159 static MachineSignature* MakeMachineSignature( |
154 Zone* zone, MachineType return_type, MachineType p0 = kMachNone, | 160 Zone* zone, MachineType return_type, MachineType p0 = kMachNone, |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 | 442 |
437 private: | 443 private: |
438 CallHelper* helper() { return static_cast<C*>(this); } | 444 CallHelper* helper() { return static_cast<C*>(this); } |
439 }; | 445 }; |
440 | 446 |
441 } // namespace compiler | 447 } // namespace compiler |
442 } // namespace internal | 448 } // namespace internal |
443 } // namespace v8 | 449 } // namespace v8 |
444 | 450 |
445 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ | 451 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ |
OLD | NEW |