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

Unified Diff: test/unittests/wasm/ast-decoder-unittest.cc

Issue 1745863002: [wasm] Allocate WasmModule and WasmModuleInstance vectors inline. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/wasm-run-utils.h ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/wasm/ast-decoder-unittest.cc
diff --git a/test/unittests/wasm/ast-decoder-unittest.cc b/test/unittests/wasm/ast-decoder-unittest.cc
index 672158714af3ab7695fc67063e7ea22657e918e0..0d0449b205965a109ad8857ff3aaee95c5bd4cb0 100644
--- a/test/unittests/wasm/ast-decoder-unittest.cc
+++ b/test/unittests/wasm/ast-decoder-unittest.cc
@@ -1189,30 +1189,26 @@ class TestModuleEnv : public ModuleEnv {
instance = nullptr;
module = &mod;
linker = nullptr;
- mod.globals = new std::vector<WasmGlobal>;
- mod.signatures = new std::vector<FunctionSig*>;
- mod.functions = new std::vector<WasmFunction>;
- mod.import_table = new std::vector<WasmImport>;
}
byte AddGlobal(MachineType mem_type) {
- mod.globals->push_back({0, mem_type, 0, false});
- CHECK(mod.globals->size() <= 127);
- return static_cast<byte>(mod.globals->size() - 1);
+ mod.globals.push_back({0, mem_type, 0, false});
+ CHECK(mod.globals.size() <= 127);
+ return static_cast<byte>(mod.globals.size() - 1);
}
byte AddSignature(FunctionSig* sig) {
- mod.signatures->push_back(sig);
- CHECK(mod.signatures->size() <= 127);
- return static_cast<byte>(mod.signatures->size() - 1);
+ mod.signatures.push_back(sig);
+ CHECK(mod.signatures.size() <= 127);
+ return static_cast<byte>(mod.signatures.size() - 1);
}
byte AddFunction(FunctionSig* sig) {
- mod.functions->push_back({sig, 0, 0, 0, 0, 0, 0, 0, false, false});
- CHECK(mod.functions->size() <= 127);
- return static_cast<byte>(mod.functions->size() - 1);
+ mod.functions.push_back({sig, 0, 0, 0, 0, 0, 0, 0, false, false});
+ CHECK(mod.functions.size() <= 127);
+ return static_cast<byte>(mod.functions.size() - 1);
}
byte AddImport(FunctionSig* sig) {
- mod.import_table->push_back({sig, 0, 0});
- CHECK(mod.import_table->size() <= 127);
- return static_cast<byte>(mod.import_table->size() - 1);
+ mod.import_table.push_back({sig, 0, 0});
+ CHECK(mod.import_table.size() <= 127);
+ return static_cast<byte>(mod.import_table.size() - 1);
}
private:
« no previous file with comments | « test/cctest/wasm/wasm-run-utils.h ('k') | test/unittests/wasm/module-decoder-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698