Chromium Code Reviews| Index: test/cctest/test-assembler-a64.cc |
| diff --git a/test/cctest/test-assembler-a64.cc b/test/cctest/test-assembler-a64.cc |
| index 0ba9823c77326f1157bb730190e96c50f6995167..aac91da72b1181b299f66f7eeb390dc278452c84 100644 |
| --- a/test/cctest/test-assembler-a64.cc |
| +++ b/test/cctest/test-assembler-a64.cc |
| @@ -104,10 +104,14 @@ static void InitializeVM() { |
| #define __ masm. |
| #define BUF_SIZE 8192 |
| -#define SETUP() SETUP_SIZE(BUF_SIZE) |
| +#define SETUP() \ |
| + CcTest::InitializeVM(); \ |
| + SETUP_SIZE(BUF_SIZE) |
| + |
| +#define SETUP_HELPER() \ |
| + SETUP_SIZE(BUF_SIZE) |
| #define INIT_V8() \ |
| - CcTest::InitializeVM(); \ |
| Isolate* isolate = Isolate::Current(); \ |
| HandleScope scope(isolate); \ |
| ASSERT(isolate != NULL); |
| @@ -1108,7 +1112,7 @@ TEST(mul) { |
| static void SmullHelper(int64_t expected, int64_t a, int64_t b) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Mov(w0, a); |
| __ Mov(w1, b); |
| @@ -1121,6 +1125,7 @@ static void SmullHelper(int64_t expected, int64_t a, int64_t b) { |
| TEST(smull) { |
| + CcTest::InitializeVM(); |
|
ulan
2014/02/04 18:35:59
Is this OK, or should I put hide it behind macro?
m.m.capewell
2014/02/04 18:48:34
Is it possible to hide it in the TEST macro?
ulan
2014/02/05 08:24:54
That would probably break other tests because TEST
|
| SmullHelper(0, 0, 0); |
| SmullHelper(1, 1, 1); |
| SmullHelper(-1, -1, 1); |
| @@ -4579,7 +4584,7 @@ TEST(fmul) { |
| static void FmaddFmsubDoubleHelper(double n, double m, double a, |
| double fmadd, double fmsub) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Fmov(d0, n); |
| @@ -4603,6 +4608,7 @@ static void FmaddFmsubDoubleHelper(double n, double m, double a, |
| TEST(fmadd_fmsub_double) { |
| + CcTest::InitializeVM(); |
| double inputs[] = { |
| // Normal numbers, including -0.0. |
| DBL_MAX, DBL_MIN, 3.25, 2.0, 0.0, |
| @@ -4639,6 +4645,7 @@ TEST(fmadd_fmsub_double) { |
| TEST(fmadd_fmsub_double_rounding) { |
| + CcTest::InitializeVM(); |
| // Make sure we run plenty of tests where an intermediate rounding stage would |
| // produce an incorrect result. |
| const int limit = 1000; |
| @@ -4687,7 +4694,7 @@ TEST(fmadd_fmsub_double_rounding) { |
| static void FmaddFmsubFloatHelper(float n, float m, float a, |
| float fmadd, float fmsub) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Fmov(s0, n); |
| @@ -4707,6 +4714,7 @@ static void FmaddFmsubFloatHelper(float n, float m, float a, |
| TEST(fmadd_fmsub_float) { |
| + CcTest::InitializeVM(); |
| float inputs[] = { |
| // Normal numbers, including -0.0f. |
| FLT_MAX, FLT_MIN, 3.25f, 2.0f, 0.0f, |
| @@ -4743,6 +4751,7 @@ TEST(fmadd_fmsub_float) { |
| TEST(fmadd_fmsub_float_rounding) { |
| + CcTest::InitializeVM(); |
| // Make sure we run plenty of tests where an intermediate rounding stage would |
| // produce an incorrect result. |
| const int limit = 1000; |
| @@ -4920,7 +4929,7 @@ static double MinMaxHelper(double n, |
| static void FminFmaxDoubleHelper(double n, double m, double min, double max, |
| double minnm, double maxnm) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Fmov(d0, n); |
| @@ -4943,6 +4952,7 @@ static void FminFmaxDoubleHelper(double n, double m, double min, double max, |
| TEST(fmax_fmin_d) { |
| + CcTest::InitializeVM(); |
| // Bootstrap tests. |
| FminFmaxDoubleHelper(0, 0, 0, 0, 0, 0); |
| FminFmaxDoubleHelper(0, 1, 0, 1, 0, 1); |
| @@ -4983,7 +4993,7 @@ TEST(fmax_fmin_d) { |
| static void FminFmaxFloatHelper(float n, float m, float min, float max, |
| float minnm, float maxnm) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| // TODO(all): Signalling NaNs are sometimes converted by the C compiler to |
| @@ -5012,6 +5022,7 @@ static void FminFmaxFloatHelper(float n, float m, float min, float max, |
| TEST(fmax_fmin_s) { |
| + CcTest::InitializeVM(); |
| // Bootstrap tests. |
| FminFmaxFloatHelper(0, 0, 0, 0, 0, 0); |
| FminFmaxFloatHelper(0, 1, 0, 1, 0, 1); |
| @@ -5666,6 +5677,7 @@ TEST(fcvt_ds) { |
| TEST(fcvt_sd) { |
| + CcTest::InitializeVM(); |
| // There are a huge number of corner-cases to check, so this test iterates |
| // through a list. The list is then negated and checked again (since the sign |
| // is irrelevant in ties-to-even rounding), so the list shouldn't include any |
| @@ -5761,7 +5773,7 @@ TEST(fcvt_sd) { |
| ASSERT(std::signbit(in) == 0); |
| ASSERT(std::signbit(expected) == 0); |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Fmov(d10, in); |
| @@ -6623,7 +6635,7 @@ static void TestUScvtfHelper(uint64_t in, |
| double results_scvtf_w[33]; |
| double results_ucvtf_w[33]; |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x)); |
| @@ -6696,6 +6708,7 @@ static void TestUScvtfHelper(uint64_t in, |
| TEST(scvtf_ucvtf_double) { |
| + CcTest::InitializeVM(); |
| // Simple conversions of positive numbers which require no rounding; the |
| // results should not depened on the rounding mode, and ucvtf and scvtf should |
| // produce the same result. |
| @@ -6777,7 +6790,7 @@ static void TestUScvtf32Helper(uint64_t in, |
| float results_scvtf_w[33]; |
| float results_ucvtf_w[33]; |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Mov(x0, reinterpret_cast<int64_t>(results_scvtf_x)); |
| @@ -6852,6 +6865,7 @@ static void TestUScvtf32Helper(uint64_t in, |
| TEST(scvtf_ucvtf_float) { |
| + CcTest::InitializeVM(); |
| // Simple conversions of positive numbers which require no rounding; the |
| // results should not depened on the rounding mode, and ucvtf and scvtf should |
| // produce the same result. |
| @@ -7522,7 +7536,7 @@ static void PushPopJsspSimpleHelper(int reg_count, |
| int reg_size, |
| PushPopMethod push_method, |
| PushPopMethod pop_method) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| @@ -7634,6 +7648,7 @@ static void PushPopJsspSimpleHelper(int reg_count, |
| TEST(push_pop_jssp_simple_32) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| for (int count = 0; count <= 8; count++) { |
| PushPopJsspSimpleHelper(count, claim, kWRegSize, |
| @@ -7659,6 +7674,7 @@ TEST(push_pop_jssp_simple_32) { |
| TEST(push_pop_jssp_simple_64) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| for (int count = 0; count <= 8; count++) { |
| PushPopJsspSimpleHelper(count, claim, kXRegSize, |
| @@ -7701,7 +7717,7 @@ static void PushPopFPJsspSimpleHelper(int reg_count, |
| int reg_size, |
| PushPopMethod push_method, |
| PushPopMethod pop_method) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| @@ -7815,6 +7831,7 @@ static void PushPopFPJsspSimpleHelper(int reg_count, |
| TEST(push_pop_fp_jssp_simple_32) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| for (int count = 0; count <= 8; count++) { |
| PushPopFPJsspSimpleHelper(count, claim, kSRegSize, |
| @@ -7840,6 +7857,7 @@ TEST(push_pop_fp_jssp_simple_32) { |
| TEST(push_pop_fp_jssp_simple_64) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| for (int count = 0; count <= 8; count++) { |
| PushPopFPJsspSimpleHelper(count, claim, kDRegSize, |
| @@ -7867,7 +7885,7 @@ TEST(push_pop_fp_jssp_simple_64) { |
| // Push and pop data using an overlapping combination of Push/Pop and |
| // RegList-based methods. |
| static void PushPopJsspMixedMethodsHelper(int claim, int reg_size) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| // Registers x8 and x9 are used by the macro assembler for debug code (for |
| // example in 'Pop'), so we can't use them here. We can't use jssp because it |
| @@ -7954,6 +7972,7 @@ static void PushPopJsspMixedMethodsHelper(int claim, int reg_size) { |
| TEST(push_pop_jssp_mixed_methods_64) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| PushPopJsspMixedMethodsHelper(claim, kXRegSize); |
| } |
| @@ -7961,6 +7980,7 @@ TEST(push_pop_jssp_mixed_methods_64) { |
| TEST(push_pop_jssp_mixed_methods_32) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| PushPopJsspMixedMethodsHelper(claim, kWRegSize); |
| } |
| @@ -8156,6 +8176,7 @@ static void PushPopJsspWXOverlapHelper(int reg_count, int claim) { |
| TEST(push_pop_jssp_wx_overlap) { |
| + CcTest::InitializeVM(); |
| for (int claim = 0; claim <= 8; claim++) { |
| for (int count = 1; count <= 8; count++) { |
| PushPopJsspWXOverlapHelper(count, claim); |
| @@ -8981,7 +9002,7 @@ static void CopyFieldsHelper(CPURegList temps) { |
| dst_tagged[i] = reinterpret_cast<uint64_t>(dst[i]) + kHeapObjectTag; |
| } |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Mov(x0, dst_tagged[0]); |
| @@ -9008,6 +9029,7 @@ static void CopyFieldsHelper(CPURegList temps) { |
| // This is a V8-specific test. |
| TEST(copyfields) { |
| + CcTest::InitializeVM(); |
| CopyFieldsHelper(CPURegList(x10)); |
| CopyFieldsHelper(CPURegList(x10, x11)); |
| CopyFieldsHelper(CPURegList(x10, x11, x12)); |
| @@ -9016,7 +9038,7 @@ TEST(copyfields) { |
| static void DoSmiAbsTest(int32_t value, bool must_fail = false) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| Label end, slow; |
| @@ -9052,6 +9074,7 @@ static void DoSmiAbsTest(int32_t value, bool must_fail = false) { |
| TEST(smi_abs) { |
| + CcTest::InitializeVM(); |
| // Simple and edge cases. |
| DoSmiAbsTest(0); |
| DoSmiAbsTest(0x12345); |
| @@ -9199,7 +9222,7 @@ TEST(call_no_relocation) { |
| static void ECMA262ToInt32Helper(int32_t expected, double input) { |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| __ Fmov(d0, input); |
| @@ -9227,6 +9250,7 @@ static void ECMA262ToInt32Helper(int32_t expected, double input) { |
| TEST(ecma_262_to_int32) { |
| + CcTest::InitializeVM(); |
| // ==== exponent < 64 ==== |
| ECMA262ToInt32Helper(0, 0.0); |
| @@ -9301,7 +9325,7 @@ TEST(ecma_262_to_int32) { |
| static void AbsHelperX(int64_t value) { |
| int64_t expected; |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| Label fail; |
| @@ -9356,7 +9380,7 @@ static void AbsHelperX(int64_t value) { |
| static void AbsHelperW(int32_t value) { |
| int32_t expected; |
| - SETUP(); |
| + SETUP_HELPER(); |
| START(); |
| Label fail; |
| @@ -9411,6 +9435,7 @@ static void AbsHelperW(int32_t value) { |
| TEST(abs) { |
| + CcTest::InitializeVM(); |
| AbsHelperX(0); |
| AbsHelperX(42); |
| AbsHelperX(-42); |