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

Unified Diff: test/cctest/wasm/wasm-run-utils.h

Issue 2165633006: [wasm] Remove special memory type for (internal) globals and use local type instead. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [wasm] Remove special memory type for (internal) globals and use local type instead. Created 4 years, 5 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-relocation.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/wasm-run-utils.h
diff --git a/test/cctest/wasm/wasm-run-utils.h b/test/cctest/wasm/wasm-run-utils.h
index 9b1eac2eb5837f90b872beffdf96d3005f9307ee..ff8d78bae63dc18500cadfebfb588b52a90a1a0f 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -112,8 +112,8 @@ class TestingModule : public ModuleEnv {
}
template <typename T>
- T* AddGlobal(MachineType mem_type) {
- const WasmGlobal* global = AddGlobal(mem_type);
+ T* AddGlobal(LocalType type) {
+ const WasmGlobal* global = AddGlobal(type);
return reinterpret_cast<T*>(instance->globals_start + global->offset);
}
@@ -257,10 +257,10 @@ class TestingModule : public ModuleEnv {
V8_ALIGNED(8) byte global_data[kMaxGlobalsSize]; // preallocated global data.
WasmInterpreter* interpreter_;
- const WasmGlobal* AddGlobal(MachineType mem_type) {
- byte size = WasmOpcodes::MemSize(mem_type);
+ const WasmGlobal* AddGlobal(LocalType type) {
+ byte size = WasmOpcodes::MemSize(WasmOpcodes::MachineTypeFor(type));
global_offset = (global_offset + size - 1) & ~(size - 1); // align
- module_.globals.push_back({0, 0, mem_type, global_offset, false});
+ module_.globals.push_back({0, 0, type, global_offset, false});
global_offset += size;
// limit number of globals.
CHECK_LT(global_offset, kMaxGlobalsSize);
« no previous file with comments | « test/cctest/wasm/test-run-wasm-relocation.cc ('k') | test/unittests/wasm/ast-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698