| Index: test/cctest/wasm/test-run-wasm-relocation.cc
|
| diff --git a/test/cctest/wasm/test-run-wasm-relocation.cc b/test/cctest/wasm/test-run-wasm-relocation.cc
|
| index bd3d3ba39f482cc803af421112adb456a5719b5e..a0d8a07189ae7d3193d51afe32651cead0e7fcf3 100644
|
| --- a/test/cctest/wasm/test-run-wasm-relocation.cc
|
| +++ b/test/cctest/wasm/test-run-wasm-relocation.cc
|
| @@ -20,41 +20,42 @@ using namespace v8::internal::compiler;
|
| TEST_BODY(float, WASM_F32_ADD) \
|
| TEST_BODY(double, WASM_F64_ADD)
|
|
|
| -#define LOAD_SET_GLOBAL_TEST_BODY(C_TYPE, ADD) \
|
| - TEST(WasmRelocateGlobal_##C_TYPE) { \
|
| - WasmRunner<C_TYPE, C_TYPE> r(kExecuteCompiled); \
|
| - \
|
| - r.module().AddGlobal<C_TYPE>(); \
|
| - r.module().AddGlobal<C_TYPE>(); \
|
| - \
|
| - /* global = global + p0 */ \
|
| - BUILD(r, WASM_SET_GLOBAL(1, ADD(WASM_GET_GLOBAL(0), WASM_GET_LOCAL(0))), \
|
| - WASM_GET_GLOBAL(0)); \
|
| - CHECK_EQ(1, r.module().instance->function_code.size()); \
|
| - \
|
| - int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \
|
| - \
|
| - Handle<Code> code = r.module().instance->function_code[0]; \
|
| - \
|
| - Address old_start = r.module().instance->globals_start; \
|
| - Address new_start = old_start + 1; \
|
| - \
|
| - Address old_addresses[4]; \
|
| - uint32_t address_index = 0U; \
|
| - for (RelocIterator it(*code, filter); !it.done(); it.next()) { \
|
| - old_addresses[address_index] = it.rinfo()->wasm_global_reference(); \
|
| - it.rinfo()->update_wasm_global_reference(old_start, new_start); \
|
| - ++address_index; \
|
| - } \
|
| - CHECK_LE(address_index, 4U); \
|
| - \
|
| - address_index = 0U; \
|
| - for (RelocIterator it(*code, filter); !it.done(); it.next()) { \
|
| - CHECK_EQ(old_addresses[address_index] + 1, \
|
| - it.rinfo()->wasm_global_reference()); \
|
| - ++address_index; \
|
| - } \
|
| - CHECK_LE(address_index, 4U); \
|
| +#define LOAD_SET_GLOBAL_TEST_BODY(C_TYPE, ADD) \
|
| + TEST(WasmRelocateGlobal_##C_TYPE) { \
|
| + WasmRunner<C_TYPE, C_TYPE> r(kExecuteCompiled); \
|
| + Isolate* isolate = CcTest::i_isolate(); \
|
| + \
|
| + r.module().AddGlobal<C_TYPE>(); \
|
| + r.module().AddGlobal<C_TYPE>(); \
|
| + \
|
| + /* global = global + p0 */ \
|
| + BUILD(r, WASM_SET_GLOBAL(1, ADD(WASM_GET_GLOBAL(0), WASM_GET_LOCAL(0))), \
|
| + WASM_GET_GLOBAL(0)); \
|
| + CHECK_EQ(1, r.module().instance->function_code.size()); \
|
| + \
|
| + int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \
|
| + \
|
| + Handle<Code> code = r.module().instance->function_code[0]; \
|
| + \
|
| + Address old_start = r.module().instance->globals_start; \
|
| + Address new_start = old_start + 1; \
|
| + \
|
| + Address old_addresses[4]; \
|
| + uint32_t address_index = 0U; \
|
| + for (RelocIterator it(*code, filter); !it.done(); it.next()) { \
|
| + old_addresses[address_index] = it.rinfo()->wasm_global_reference(); \
|
| + it.rinfo()->update_wasm_global_reference(isolate, old_start, new_start); \
|
| + ++address_index; \
|
| + } \
|
| + CHECK_LE(address_index, 4U); \
|
| + \
|
| + address_index = 0U; \
|
| + for (RelocIterator it(*code, filter); !it.done(); it.next()) { \
|
| + CHECK_EQ(old_addresses[address_index] + 1, \
|
| + it.rinfo()->wasm_global_reference()); \
|
| + ++address_index; \
|
| + } \
|
| + CHECK_LE(address_index, 4U); \
|
| }
|
|
|
| FOREACH_TYPE(LOAD_SET_GLOBAL_TEST_BODY)
|
|
|