Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: test/cctest/compiler/call-tester.h

Issue 1031113002: Make ParameterTraits specializations for 32-bit integers valid for all arches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 #if V8_TARGET_ARCH_MIPS64
132 // Additional template specialization required for mips64 to sign-extend 131 // Additional template specialization required for mips64 to sign-extend
133 // parameters defined by calling convention. 132 // parameters defined by calling convention.
134 template <> 133 template <>
135 struct ParameterTraits<int32_t> { 134 struct ParameterTraits<int32_t> {
136 static int64_t Cast(int32_t r) { return static_cast<int64_t>(r); } 135 static int64_t Cast(int32_t r) { return static_cast<int64_t>(r); }
137 }; 136 };
138 137
139 template <> 138 template <>
140 struct ParameterTraits<uint32_t> { 139 struct ParameterTraits<uint32_t> {
141 static int64_t Cast(uint32_t r) { 140 static int64_t Cast(uint32_t r) {
142 return static_cast<int64_t>(static_cast<int32_t>(r)); 141 return static_cast<int64_t>(static_cast<int32_t>(r));
143 } 142 }
144 }; 143 };
145 #endif
146 144
147 class CallHelper { 145 class CallHelper {
148 public: 146 public:
149 explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig) 147 explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig)
150 : machine_sig_(machine_sig), isolate_(isolate) { 148 : machine_sig_(machine_sig), isolate_(isolate) {
151 USE(isolate_); 149 USE(isolate_);
152 } 150 }
153 virtual ~CallHelper() {} 151 virtual ~CallHelper() {}
154 152
155 static MachineSignature* MakeMachineSignature( 153 static MachineSignature* MakeMachineSignature(
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 436
439 private: 437 private:
440 CallHelper* helper() { return static_cast<C*>(this); } 438 CallHelper* helper() { return static_cast<C*>(this); }
441 }; 439 };
442 440
443 } // namespace compiler 441 } // namespace compiler
444 } // namespace internal 442 } // namespace internal
445 } // namespace v8 443 } // namespace v8
446 444
447 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_ 445 #endif // V8_CCTEST_COMPILER_CALL_TESTER_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698