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

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

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: feedback Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « test/cctest/wasm/wasm-run-utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "test/unittests/test-utils.h" 5 #include "test/unittests/test-utils.h"
6 6
7 #include "src/v8.h" 7 #include "src/v8.h"
8 8
9 #include "test/cctest/wasm/test-signatures.h" 9 #include "test/cctest/wasm/test-signatures.h"
10 10
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 } 1149 }
1150 1150
1151 namespace { 1151 namespace {
1152 // A helper for tests that require a module environment for functions and 1152 // A helper for tests that require a module environment for functions and
1153 // globals. 1153 // globals.
1154 class TestModuleEnv : public ModuleEnv { 1154 class TestModuleEnv : public ModuleEnv {
1155 public: 1155 public:
1156 TestModuleEnv() { 1156 TestModuleEnv() {
1157 instance = nullptr; 1157 instance = nullptr;
1158 module = &mod; 1158 module = &mod;
1159 linker = nullptr;
1160 } 1159 }
1161 byte AddGlobal(MachineType mem_type) { 1160 byte AddGlobal(MachineType mem_type) {
1162 mod.globals.push_back({0, 0, mem_type, 0, false}); 1161 mod.globals.push_back({0, 0, mem_type, 0, false});
1163 CHECK(mod.globals.size() <= 127); 1162 CHECK(mod.globals.size() <= 127);
1164 return static_cast<byte>(mod.globals.size() - 1); 1163 return static_cast<byte>(mod.globals.size() - 1);
1165 } 1164 }
1166 byte AddSignature(FunctionSig* sig) { 1165 byte AddSignature(FunctionSig* sig) {
1167 mod.signatures.push_back(sig); 1166 mod.signatures.push_back(sig);
1168 CHECK(mod.signatures.size() <= 127); 1167 CHECK(mod.signatures.size() <= 127);
1169 return static_cast<byte>(mod.signatures.size() - 1); 1168 return static_cast<byte>(mod.signatures.size() - 1);
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
2434 LocalTypeMap map = Expand(decls); 2433 LocalTypeMap map = Expand(decls);
2435 size_t pos = 0; 2434 size_t pos = 0;
2436 pos = ExpectRun(map, pos, kAstF32, 5); 2435 pos = ExpectRun(map, pos, kAstF32, 5);
2437 pos = ExpectRun(map, pos, kAstI32, 1337); 2436 pos = ExpectRun(map, pos, kAstI32, 1337);
2438 pos = ExpectRun(map, pos, kAstI64, 212); 2437 pos = ExpectRun(map, pos, kAstI64, 212);
2439 } 2438 }
2440 2439
2441 } // namespace wasm 2440 } // namespace wasm
2442 } // namespace internal 2441 } // namespace internal
2443 } // namespace v8 2442 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/wasm/wasm-run-utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698