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

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

Issue 2771803005: Hide WasmModule.origin field behind readable accessors. (Closed)
Patch Set: Use boolean accessors instead of get_origin. Created 3 years, 9 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 | « src/wasm/wasm-objects.cc ('k') | test/unittests/wasm/function-body-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 8bc28c23f1fff143cf17ac8c7ee9429f8429ec98..8b678efffe2e777583cbaf93ec9f87a56881cc58 100644
--- a/test/cctest/wasm/wasm-run-utils.h
+++ b/test/cctest/wasm/wasm-run-utils.h
@@ -98,7 +98,7 @@ class TestingModule : public ModuleEnv {
~TestingModule() {
if (instance->mem_start) {
- if (EnableGuardRegions() && module_.origin == kWasmOrigin) {
+ if (EnableGuardRegions() && module_.is_wasm()) {
// See the corresponding code in AddMemory. We use a different
// allocation path when guard regions are enabled, which means we have
// to free it differently too.
@@ -112,14 +112,14 @@ class TestingModule : public ModuleEnv {
if (interpreter_) delete interpreter_;
}
- void ChangeOriginToAsmjs() { module_.origin = kAsmJsOrigin; }
+ void ChangeOriginToAsmjs() { module_.set_origin(kAsmJsOrigin); }
byte* AddMemory(uint32_t size) {
CHECK(!module_.has_memory);
CHECK_NULL(instance->mem_start);
CHECK_EQ(0, instance->mem_size);
module_.has_memory = true;
- if (EnableGuardRegions() && module_.origin == kWasmOrigin) {
+ if (EnableGuardRegions() && module_.is_wasm()) {
const size_t alloc_size =
RoundUp(kWasmMaxHeapOffset, v8::base::OS::CommitPageSize());
instance->mem_start = reinterpret_cast<byte*>(
@@ -235,7 +235,7 @@ class TestingModule : public ModuleEnv {
uint32_t index = AddFunction(sig, Handle<Code>::null(), nullptr);
Handle<Code> code = CompileWasmToJSWrapper(
isolate_, jsfunc, sig, index, Handle<String>::null(),
- Handle<String>::null(), module->origin);
+ Handle<String>::null(), module->get_origin());
instance->function_code[index] = code;
return index;
}
« no previous file with comments | « src/wasm/wasm-objects.cc ('k') | test/unittests/wasm/function-body-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698