diff options
Diffstat (limited to 'deps/v8/test/cctest/test-assembler-s390.cc')
-rw-r--r-- | deps/v8/test/cctest/test-assembler-s390.cc | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/deps/v8/test/cctest/test-assembler-s390.cc b/deps/v8/test/cctest/test-assembler-s390.cc index df33b96752..d6bbe34e74 100644 --- a/deps/v8/test/cctest/test-assembler-s390.cc +++ b/deps/v8/test/cctest/test-assembler-s390.cc @@ -31,17 +31,18 @@ #include "src/factory.h" #include "src/macro-assembler.h" #include "src/s390/assembler-s390-inl.h" -#include "src/s390/simulator-s390.h" +#include "src/simulator.h" #include "test/cctest/cctest.h" namespace v8 { namespace internal { // Define these function prototypes to match JSEntryFunction in execution.cc. -typedef Object* (*F1)(int x, int p1, int p2, int p3, int p4); -typedef Object* (*F2)(int x, int y, int p2, int p3, int p4); -typedef Object* (*F3)(void* p0, int p1, int p2, int p3, int p4); -typedef Object* (*F4)(void* p0, void* p1, int p2, int p3, int p4); +// TODO(s390): Refine these signatures per test case. +using F1 = Object*(int x, int p1, int p2, int p3, int p4); +using F2 = Object*(int x, int y, int p2, int p3, int p4); +using F3 = Object*(void* p0, int p1, int p2, int p3, int p4); +using F4 = Object*(void* p0, void* p1, int p2, int p3, int p4); #define __ assm. @@ -66,9 +67,8 @@ TEST(0) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); - intptr_t res = reinterpret_cast<intptr_t>( - CALL_GENERATED_CODE(isolate, f, 3, 4, 0, 0, 0)); + auto f = GeneratedCode<F2>::FromCode(*code); + intptr_t res = reinterpret_cast<intptr_t>(f.Call(3, 4, 0, 0, 0)); ::printf("f() = %" V8PRIxPTR "\n", res); CHECK_EQ(7, static_cast<int>(res)); } @@ -106,9 +106,8 @@ TEST(1) { #ifdef DEBUG code->Print(); #endif - F1 f = FUNCTION_CAST<F1>(code->entry()); - intptr_t res = reinterpret_cast<intptr_t>( - CALL_GENERATED_CODE(isolate, f, 100, 0, 0, 0, 0)); + auto f = GeneratedCode<F1>::FromCode(*code); + intptr_t res = reinterpret_cast<intptr_t>(f.Call(100, 0, 0, 0, 0)); ::printf("f() = %" V8PRIxPTR "\n", res); CHECK_EQ(5050, static_cast<int>(res)); } @@ -158,9 +157,8 @@ TEST(2) { #ifdef DEBUG code->Print(); #endif - F1 f = FUNCTION_CAST<F1>(code->entry()); - intptr_t res = reinterpret_cast<intptr_t>( - CALL_GENERATED_CODE(isolate, f, 10, 0, 0, 0, 0)); + auto f = GeneratedCode<F1>::FromCode(*code); + intptr_t res = reinterpret_cast<intptr_t>(f.Call(10, 0, 0, 0, 0)); ::printf("f() = %" V8PRIxPTR "\n", res); CHECK_EQ(3628800, static_cast<int>(res)); } @@ -255,9 +253,9 @@ TEST(4) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); + auto f = GeneratedCode<F2>::FromCode(*code); intptr_t res = reinterpret_cast<intptr_t>( - CALL_GENERATED_CODE(isolate, f, 3, 4, 3, 0, 0)); + f.Call(3, 4, 3, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); CHECK_EQ(4, static_cast<int>(res)); } @@ -283,9 +281,9 @@ TEST(5) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); + auto f = GeneratedCode<F2>::FromCode(*code); intptr_t res = - reinterpret_cast<intptr_t>(CALL_GENERATED_CODE(isolate, f, 3, 4, 3, 0, 0)); + reinterpret_cast<intptr_t>(f.Call(3, 4, 3, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); CHECK_EQ(2, static_cast<int>(res)); } @@ -317,9 +315,9 @@ TEST(6) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); + auto f = GeneratedCode<F2>::FromCode(*code); intptr_t res = - reinterpret_cast<intptr_t>(CALL_GENERATED_CODE(isolate, f, 3, 4, 3, 0, 0)); + reinterpret_cast<intptr_t>(f.Call(3, 4, 3, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); CHECK_EQ(1, static_cast<int>(res)); } @@ -349,9 +347,9 @@ TEST(7) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); + auto f = GeneratedCode<F2>::FromCode(*code); intptr_t res = - reinterpret_cast<intptr_t>(CALL_GENERATED_CODE(isolate, f, 3, 4, 3, 0, 0)); + reinterpret_cast<intptr_t>(f.Call(3, 4, 3, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); CHECK_EQ(0x2468, static_cast<int>(res)); } @@ -380,9 +378,9 @@ TEST(8) { #ifdef DEBUG code->Print(); #endif - F1 f = FUNCTION_CAST<F1>(code->entry()); + auto f = GeneratedCode<F1>::FromCode(*code); intptr_t res = - reinterpret_cast<intptr_t>(CALL_GENERATED_CODE(isolate, f, 100, 0, + reinterpret_cast<intptr_t>(f.Call(100, 0, 0, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); CHECK_EQ(0, static_cast<int>(res)); @@ -407,9 +405,9 @@ TEST(9) { #ifdef DEBUG code->Print(); #endif - F1 f = FUNCTION_CAST<F1>(code->entry()); + auto f = GeneratedCode<F1>::FromCode(*code); intptr_t res = - reinterpret_cast<intptr_t>(CALL_GENERATED_CODE(isolate, f, 0, 0, 0, 0, 0)); + reinterpret_cast<intptr_t>(f.Call(0, 0, 0, 0, 0)); ::printf("f() = %" V8PRIdPTR "\n", res); } #endif @@ -492,9 +490,8 @@ TEST(10) { #ifdef DEBUG code->Print(); #endif - F2 f = FUNCTION_CAST<F2>(code->entry()); - intptr_t res = reinterpret_cast<intptr_t>( - CALL_GENERATED_CODE(isolate, f, 3, 4, 0, 0, 0)); + auto f = GeneratedCode<F2>::FromCode(*code); + intptr_t res = reinterpret_cast<intptr_t>(f.Call(3, 4, 0, 0, 0)); ::printf("f() = %" V8PRIxPTR "\n", res); CHECK_EQ(0, static_cast<int>(res)); } |