OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/common/wasm/wasm-module-runner.h" | 5 #include "test/common/wasm/wasm-module-runner.h" |
6 | 6 |
7 #include "src/handles.h" | 7 #include "src/handles.h" |
8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 uint32_t GetMinModuleMemSize(const WasmModule* module) { | 24 uint32_t GetMinModuleMemSize(const WasmModule* module) { |
25 return WasmModule::kPageSize * module->min_mem_pages; | 25 return WasmModule::kPageSize * module->min_mem_pages; |
26 } | 26 } |
27 | 27 |
28 std::unique_ptr<WasmModule> DecodeWasmModuleForTesting( | 28 std::unique_ptr<WasmModule> DecodeWasmModuleForTesting( |
29 Isolate* isolate, ErrorThrower* thrower, const byte* module_start, | 29 Isolate* isolate, ErrorThrower* thrower, const byte* module_start, |
30 const byte* module_end, ModuleOrigin origin, bool verify_functions) { | 30 const byte* module_end, ModuleOrigin origin, bool verify_functions) { |
31 // Decode the module, but don't verify function bodies, since we'll | 31 // Decode the module, but don't verify function bodies, since we'll |
32 // be compiling them anyway. | 32 // be compiling them anyway. |
33 ModuleResult decoding_result = DecodeWasmModule( | 33 ModuleResult decoding_result = SyncDecodeWasmModule( |
34 isolate, module_start, module_end, verify_functions, origin); | 34 isolate, module_start, module_end, verify_functions, origin); |
35 | 35 |
36 if (decoding_result.failed()) { | 36 if (decoding_result.failed()) { |
37 // Module verification failed. throw. | 37 // Module verification failed. throw. |
38 thrower->CompileError("DecodeWasmModule failed: %s", | 38 thrower->CompileError("DecodeWasmModule failed: %s", |
39 decoding_result.error_msg().c_str()); | 39 decoding_result.error_msg().c_str()); |
40 } | 40 } |
41 | 41 |
42 return std::move(decoding_result.val); | 42 return std::move(decoding_result.val); |
43 } | 43 } |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 return -1; | 202 return -1; |
203 } | 203 } |
204 | 204 |
205 void SetupIsolateForWasmModule(Isolate* isolate) { | 205 void SetupIsolateForWasmModule(Isolate* isolate) { |
206 WasmJs::Install(isolate); | 206 WasmJs::Install(isolate); |
207 } | 207 } |
208 } // namespace testing | 208 } // namespace testing |
209 } // namespace wasm | 209 } // namespace wasm |
210 } // namespace internal | 210 } // namespace internal |
211 } // namespace v8 | 211 } // namespace v8 |
OLD | NEW |