OLD | NEW |
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 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 } | 1197 } |
1198 } | 1198 } |
1199 | 1199 |
1200 | 1200 |
1201 namespace { | 1201 namespace { |
1202 // A helper for tests that require a module environment for functions and | 1202 // A helper for tests that require a module environment for functions and |
1203 // globals. | 1203 // globals. |
1204 class TestModuleEnv : public ModuleEnv { | 1204 class TestModuleEnv : public ModuleEnv { |
1205 public: | 1205 public: |
1206 TestModuleEnv() { | 1206 TestModuleEnv() { |
1207 mem_start = 0; | 1207 instance = nullptr; |
1208 mem_end = 0; | |
1209 module = &mod; | 1208 module = &mod; |
1210 linker = nullptr; | 1209 linker = nullptr; |
1211 function_code = nullptr; | |
1212 mod.globals = new std::vector<WasmGlobal>; | 1210 mod.globals = new std::vector<WasmGlobal>; |
1213 mod.signatures = new std::vector<FunctionSig*>; | 1211 mod.signatures = new std::vector<FunctionSig*>; |
1214 mod.functions = new std::vector<WasmFunction>; | 1212 mod.functions = new std::vector<WasmFunction>; |
1215 } | 1213 } |
1216 byte AddGlobal(MachineType mem_type) { | 1214 byte AddGlobal(MachineType mem_type) { |
1217 mod.globals->push_back({0, mem_type, 0, false}); | 1215 mod.globals->push_back({0, mem_type, 0, false}); |
1218 CHECK(mod.globals->size() <= 127); | 1216 CHECK(mod.globals->size() <= 127); |
1219 return static_cast<byte>(mod.globals->size() - 1); | 1217 return static_cast<byte>(mod.globals->size() - 1); |
1220 } | 1218 } |
1221 byte AddSignature(FunctionSig* sig) { | 1219 byte AddSignature(FunctionSig* sig) { |
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2430 EXPECT_ARITY(1, kExprF64SConvertI64); | 2428 EXPECT_ARITY(1, kExprF64SConvertI64); |
2431 EXPECT_ARITY(1, kExprF64UConvertI64); | 2429 EXPECT_ARITY(1, kExprF64UConvertI64); |
2432 EXPECT_ARITY(1, kExprF64ConvertF32); | 2430 EXPECT_ARITY(1, kExprF64ConvertF32); |
2433 EXPECT_ARITY(1, kExprF64ReinterpretI64); | 2431 EXPECT_ARITY(1, kExprF64ReinterpretI64); |
2434 EXPECT_ARITY(1, kExprI32ReinterpretF32); | 2432 EXPECT_ARITY(1, kExprI32ReinterpretF32); |
2435 EXPECT_ARITY(1, kExprI64ReinterpretF64); | 2433 EXPECT_ARITY(1, kExprI64ReinterpretF64); |
2436 } | 2434 } |
2437 } // namespace wasm | 2435 } // namespace wasm |
2438 } // namespace internal | 2436 } // namespace internal |
2439 } // namespace v8 | 2437 } // namespace v8 |
OLD | NEW |