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

Unified Diff: test/cctest/compiler/call-tester.h

Issue 1005123002: MIPS64: Unify and improve Word32 compares to use same instructions as Word64 compares. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: test/cctest/compiler/call-tester.h
diff --git a/test/cctest/compiler/call-tester.h b/test/cctest/compiler/call-tester.h
index ffafaf08039224f16422364ad5cec2612ccf422a..199c23c6cec07b0e24efab9a3452d698e3f184a8 100644
--- a/test/cctest/compiler/call-tester.h
+++ b/test/cctest/compiler/call-tester.h
@@ -128,6 +128,22 @@ struct ParameterTraits<T*> {
static uintptr_t Cast(void* r) { return reinterpret_cast<uintptr_t>(r); }
};
+#if V8_TARGET_ARCH_MIPS64
titzer 2015/03/24 14:37:22 This should be good enough for all architectures,
dusmil.imgtec 2015/03/24 18:41:12 Yes, after all this only concerns simulated archit
titzer 2015/03/24 18:43:33 If you remove the ifdef and it works on all platfo
+// Additional template specialization required for mips64 to sign-extend
+// parameters defined by calling convention.
+template <>
+struct ParameterTraits<int32_t> {
+ static int64_t Cast(int32_t r) { return static_cast<int64_t>(r); }
+};
+
+template <>
+struct ParameterTraits<uint32_t> {
+ static int64_t Cast(uint32_t r) {
+ return static_cast<int64_t>(static_cast<int32_t>(r));
+ }
+};
+#endif
+
class CallHelper {
public:
explicit CallHelper(Isolate* isolate, MachineSignature* machine_sig)
@@ -214,6 +230,7 @@ class CallHelper {
return static_cast<uintptr_t>(simulator->Call(f, 4, p1, p2, p3, p4));
}
+
template <typename R, typename F>
R DoCall(F* f) {
return ReturnValueTraits<R>::Cast(CallSimulator(FUNCTION_ADDR(f)));

Powered by Google App Engine
This is Rietveld 408576698