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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // Constructs a single function table as a FixedArray of double size, | 390 // Constructs a single function table as a FixedArray of double size, |
389 // populating it with function signature indices and function indices. | 391 // populating it with function signature indices and function indices. |
390 Handle<FixedArray> BuildFunctionTable(Isolate* isolate, uint32_t index, | 392 Handle<FixedArray> BuildFunctionTable(Isolate* isolate, uint32_t index, |
391 const WasmModule* module); | 393 const WasmModule* module); |
392 | 394 |
393 // Populates a function table by replacing function indices with handles to | 395 // Populates a function table by replacing function indices with handles to |
394 // the compiled code. | 396 // the compiled code. |
395 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, | 397 void PopulateFunctionTable(Handle<FixedArray> table, uint32_t table_size, |
396 const std::vector<Handle<Code>>* code_table); | 398 const std::vector<Handle<Code>>* code_table); |
397 | 399 |
| 400 ScriptData* SerializeWasmCompiledModule(Isolate* isolate, |
| 401 Handle<FixedArray> compiled_module); |
| 402 |
| 403 MaybeHandle<FixedArray> DeserializeWasmCompiledModule(Isolate* isolate, |
| 404 ScriptData* data); |
| 405 Handle<JSObject> CreateCompiledModuleObject(Isolate* isolate, |
| 406 Handle<FixedArray> compiled_module); |
| 407 |
398 namespace testing { | 408 namespace testing { |
399 | 409 |
400 // Decode, verify, and run the function labeled "main" in the | 410 // Decode, verify, and run the function labeled "main" in the |
401 // given encoded module. The module should have no imports. | 411 // given encoded module. The module should have no imports. |
402 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, | 412 int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start, |
403 const byte* module_end, bool asm_js = false); | 413 const byte* module_end, bool asm_js = false); |
404 | 414 |
405 } // namespace testing | 415 } // namespace testing |
406 } // namespace wasm | 416 } // namespace wasm |
407 } // namespace internal | 417 } // namespace internal |
408 } // namespace v8 | 418 } // namespace v8 |
409 | 419 |
410 #endif // V8_WASM_MODULE_H_ | 420 #endif // V8_WASM_MODULE_H_ |
OLD | NEW |