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

Unified Diff: test/cctest/wasm/test-run-wasm-relocation.cc

Issue 2345593003: [wasm] Master CL for Binary 0xC changes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test failures and TSAN races. Created 4 years, 3 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
« no previous file with comments | « test/cctest/wasm/test-run-wasm-module.cc ('k') | test/cctest/wasm/test-wasm-function-name-table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 65b1d57bc14bed74fd567b1b7d08275dc7be7131..e3a28f611b7c02e82cf10d8974beb90a5255d018 100644
--- a/test/cctest/wasm/test-run-wasm-relocation.cc
+++ b/test/cctest/wasm/test-run-wasm-relocation.cc
@@ -19,42 +19,43 @@ using namespace v8::internal::compiler;
TEST_BODY(float, F32, WASM_F32_ADD) \
TEST_BODY(double, F64, WASM_F64_ADD)
-#define LOAD_SET_GLOBAL_TEST_BODY(C_TYPE, MACHINE_TYPE, ADD) \
- TEST(WasmRelocateGlobal##MACHINE_TYPE) { \
- TestingModule module(kExecuteCompiled); \
- module.AddGlobal<C_TYPE>(kAst##MACHINE_TYPE); \
- module.AddGlobal<C_TYPE>(kAst##MACHINE_TYPE); \
- \
- WasmRunner<C_TYPE> r(&module, \
- WasmOpcodes::MachineTypeFor(kAst##MACHINE_TYPE)); \
- \
- /* global = global + p0 */ \
- BUILD(r, WASM_SET_GLOBAL(1, ADD(WASM_GET_GLOBAL(0), WASM_GET_LOCAL(0)))); \
- CHECK_EQ(1, module.instance->function_code.size()); \
- \
- int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \
- \
- Handle<Code> code = module.instance->function_code[0]; \
- \
- Address old_start = module.instance->globals_start; \
- Address new_start = old_start + 1; \
- \
- Address old_addresses[2]; \
- 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_EQ(2U, address_index); \
- \
- 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_EQ(2U, address_index); \
+#define LOAD_SET_GLOBAL_TEST_BODY(C_TYPE, MACHINE_TYPE, ADD) \
+ TEST(WasmRelocateGlobal##MACHINE_TYPE) { \
+ TestingModule module(kExecuteCompiled); \
+ module.AddGlobal<C_TYPE>(kAst##MACHINE_TYPE); \
+ module.AddGlobal<C_TYPE>(kAst##MACHINE_TYPE); \
+ \
+ WasmRunner<C_TYPE> r(&module, \
+ WasmOpcodes::MachineTypeFor(kAst##MACHINE_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, module.instance->function_code.size()); \
+ \
+ int filter = 1 << RelocInfo::WASM_GLOBAL_REFERENCE; \
+ \
+ Handle<Code> code = module.instance->function_code[0]; \
+ \
+ Address old_start = 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); \
}
FOREACH_TYPE(LOAD_SET_GLOBAL_TEST_BODY)
« no previous file with comments | « test/cctest/wasm/test-run-wasm-module.cc ('k') | test/cctest/wasm/test-wasm-function-name-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698