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 #ifndef V8_WASM_MODULE_H_ | 5 #ifndef V8_WASM_MODULE_H_ |
6 #define V8_WASM_MODULE_H_ | 6 #define V8_WASM_MODULE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "src/api.h" | 10 #include "src/api.h" |
11 #include "src/handles.h" | 11 #include "src/handles.h" |
| 12 #include "src/parsing/preparse-data.h" |
| 13 |
12 #include "src/wasm/wasm-opcodes.h" | 14 #include "src/wasm/wasm-opcodes.h" |
13 #include "src/wasm/wasm-result.h" | 15 #include "src/wasm/wasm-result.h" |
14 | 16 |
15 namespace v8 { | 17 namespace v8 { |
16 namespace internal { | 18 namespace internal { |
17 | 19 |
18 namespace compiler { | 20 namespace compiler { |
19 class CallDescriptor; | 21 class CallDescriptor; |
20 class WasmCompilationUnit; | 22 class WasmCompilationUnit; |
21 } | 23 } |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // Constructs a single function table as a FixedArray of double size, | 391 // Constructs a single function table as a FixedArray of double size, |
390 // populating it with function signature indices and function indices. | 392 // populating it with function signature indices and function indices. |
391 Handle<FixedArray> BuildFunctionTable(Isolate* isolate, uint32_t index, | 393 Handle<FixedArray> BuildFunctionTable(Isolate* isolate, uint32_t index, |
392 const WasmModule* module); | 394 const WasmModule* module); |
393 | 395 |
394 // Populates a function table by replacing function indices with handles to | 396 // Populates a function table by replacing function indices with handles to |
395 // the compiled code. | 397 // the compiled code. |
396 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, | 398 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, |
397 const std::vector<Handle<Code>>* code_table); | 399 const std::vector<Handle<Code>>* code_table); |
398 | 400 |
| 401 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate, |
| 402 Handle<FixedArray> compiled_module); |
| 403 |
399 namespace testing { | 404 namespace testing { |
400 | 405 |
401 // Decode, verify, and run the function labeled "main" in the | 406 // Decode, verify, and run the function labeled "main" in the |
402 // given encoded module. The module should have no imports. | 407 // given encoded module. The module should have no imports. |
403 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 408 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
404 const byte* module_end, bool asm_js = false); | 409 const byte* module_end, bool asm_js = false); |
405 | 410 |
406 } // namespace testing | 411 } // namespace testing |
407 } // namespace wasm | 412 } // namespace wasm |
408 } // namespace internal | 413 } // namespace internal |
409 } // namespace v8 | 414 } // namespace v8 |
410 | 415 |
411 #endif // V8_WASM_MODULE_H_ | 416 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |