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 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 // A helper for tests that require a module environment for functions and | 1030 // A helper for tests that require a module environment for functions and |
1031 // globals. | 1031 // globals. |
1032 class TestModuleEnv : public ModuleEnv { | 1032 class TestModuleEnv : public ModuleEnv { |
1033 public: | 1033 public: |
1034 TestModuleEnv() { | 1034 TestModuleEnv() { |
1035 instance = nullptr; | 1035 instance = nullptr; |
1036 module = &mod; | 1036 module = &mod; |
1037 linker = nullptr; | 1037 linker = nullptr; |
1038 } | 1038 } |
1039 byte AddGlobal(MachineType mem_type) { | 1039 byte AddGlobal(MachineType mem_type) { |
1040 mod.globals.push_back({0, mem_type, 0, false}); | 1040 mod.globals.push_back({0, 0, mem_type, 0, false}); |
1041 CHECK(mod.globals.size() <= 127); | 1041 CHECK(mod.globals.size() <= 127); |
1042 return static_cast<byte>(mod.globals.size() - 1); | 1042 return static_cast<byte>(mod.globals.size() - 1); |
1043 } | 1043 } |
1044 byte AddSignature(FunctionSig* sig) { | 1044 byte AddSignature(FunctionSig* sig) { |
1045 mod.signatures.push_back(sig); | 1045 mod.signatures.push_back(sig); |
1046 CHECK(mod.signatures.size() <= 127); | 1046 CHECK(mod.signatures.size() <= 127); |
1047 return static_cast<byte>(mod.signatures.size() - 1); | 1047 return static_cast<byte>(mod.signatures.size() - 1); |
1048 } | 1048 } |
1049 byte AddFunction(FunctionSig* sig) { | 1049 byte AddFunction(FunctionSig* sig) { |
1050 mod.functions.push_back({sig, 0, 0, 0, 0, 0, 0, 0, false, false}); | 1050 mod.functions.push_back({sig, 0, 0, 0, 0, 0, 0, 0, false, false}); |
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2288 pos = ExpectRun(map, pos, kAstI32, 1337); | 2288 pos = ExpectRun(map, pos, kAstI32, 1337); |
2289 pos = ExpectRun(map, pos, kAstI64, 212); | 2289 pos = ExpectRun(map, pos, kAstI64, 212); |
2290 | 2290 |
2291 if (map) delete map; | 2291 if (map) delete map; |
2292 delete[] data; | 2292 delete[] data; |
2293 } | 2293 } |
2294 | 2294 |
2295 } // namespace wasm | 2295 } // namespace wasm |
2296 } // namespace internal | 2296 } // namespace internal |
2297 } // namespace v8 | 2297 } // namespace v8 |
OLD | NEW |