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 #ifndef V8_WASM_MODULE_RUNNER_H_ | 5 #ifndef V8_WASM_MODULE_RUNNER_H_ |
6 #define V8_WASM_MODULE_RUNNER_H_ | 6 #define V8_WASM_MODULE_RUNNER_H_ |
7 | 7 |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
11 #include "src/wasm/wasm-interpreter.h" | 11 #include "src/wasm/wasm-interpreter.h" |
12 #include "src/wasm/wasm-module.h" | 12 #include "src/wasm/wasm-module.h" |
13 #include "src/wasm/wasm-result.h" | 13 #include "src/wasm/wasm-result.h" |
14 #include "src/zone/zone.h" | 14 #include "src/zone/zone.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 namespace wasm { | 18 namespace wasm { |
19 namespace testing { | 19 namespace testing { |
20 | 20 |
21 // Decodes the given encoded module. | 21 // Decodes the given encoded module. |
22 const WasmModule* DecodeWasmModuleForTesting(Isolate* isolate, | 22 const WasmModule* DecodeWasmModuleForTesting( |
23 ErrorThrower* thrower, | 23 Isolate* isolate, ErrorThrower* thrower, const byte* module_start, |
24 const byte* module_start, | 24 const byte* module_end, ModuleOrigin origin, bool verify_functions = false); |
25 const byte* module_end, | |
26 ModuleOrigin origin); | |
27 | 25 |
28 // Instantiates a module without any imports and exports. | 26 // Instantiates a module without any imports and exports. |
29 const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate, | 27 const Handle<JSObject> InstantiateModuleForTesting(Isolate* isolate, |
30 ErrorThrower* thrower, | 28 ErrorThrower* thrower, |
31 const WasmModule* module); | 29 const WasmModule* module); |
32 | 30 |
33 int32_t CallWasmFunctionForTesting(Isolate* isolate, Handle<JSObject> instance, | 31 int32_t CallWasmFunctionForTesting(Isolate* isolate, Handle<JSObject> instance, |
34 ErrorThrower* thrower, const char* name, | 32 ErrorThrower* thrower, const char* name, |
35 int argc, Handle<Object> argv[], | 33 int argc, Handle<Object> argv[], |
36 ModuleOrigin origin); | 34 ModuleOrigin origin); |
(...skipping 20 matching lines...) Expand all Loading... |
57 int argc, Handle<Object> argv[], | 55 int argc, Handle<Object> argv[], |
58 ModuleOrigin origin); | 56 ModuleOrigin origin); |
59 // Install function map, module symbol for testing | 57 // Install function map, module symbol for testing |
60 void SetupIsolateForWasmModule(Isolate* isolate); | 58 void SetupIsolateForWasmModule(Isolate* isolate); |
61 } // namespace testing | 59 } // namespace testing |
62 } // namespace wasm | 60 } // namespace wasm |
63 } // namespace internal | 61 } // namespace internal |
64 } // namespace v8 | 62 } // namespace v8 |
65 | 63 |
66 #endif // V8_WASM_MODULE_RUNNER_H_ | 64 #endif // V8_WASM_MODULE_RUNNER_H_ |
OLD | NEW |