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_DECODER_H_ | 5 #ifndef V8_WASM_MODULE_DECODER_H_ |
6 #define V8_WASM_MODULE_DECODER_H_ | 6 #define V8_WASM_MODULE_DECODER_H_ |
7 | 7 |
8 #include "src/globals.h" | 8 #include "src/globals.h" |
9 #include "src/wasm/ast-decoder.h" | 9 #include "src/wasm/ast-decoder.h" |
10 #include "src/wasm/wasm-module.h" | 10 #include "src/wasm/wasm-module.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Decodes the bytes of a WASM function between | 37 // Decodes the bytes of a WASM function between |
38 // {function_start} and {function_end}. | 38 // {function_start} and {function_end}. |
39 V8_EXPORT_PRIVATE FunctionResult DecodeWasmFunction(Isolate* isolate, | 39 V8_EXPORT_PRIVATE FunctionResult DecodeWasmFunction(Isolate* isolate, |
40 Zone* zone, ModuleEnv* env, | 40 Zone* zone, ModuleEnv* env, |
41 const byte* function_start, | 41 const byte* function_start, |
42 const byte* function_end); | 42 const byte* function_end); |
43 | 43 |
44 // Extracts the function offset table from the wasm module bytes. | 44 // Extracts the function offset table from the wasm module bytes. |
45 // Returns a vector with <offset, length> entries, or failure if the wasm bytes | 45 // Returns a vector with <offset, length> entries, or failure if the wasm bytes |
46 // are detected as invalid. Note that this validation is not complete. | 46 // are detected as invalid. Note that this validation is not complete. |
47 FunctionOffsetsResult DecodeWasmFunctionOffsets( | 47 FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start, |
48 const byte* module_start, const byte* module_end, | 48 const byte* module_end); |
49 uint32_t num_imported_functions); | |
50 | 49 |
51 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, | 50 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, |
52 const byte* end); | 51 const byte* end); |
53 | 52 |
54 // Extracts the mapping from wasm byte offset to asm.js source position per | 53 // Extracts the mapping from wasm byte offset to asm.js source position per |
55 // function. | 54 // function. |
56 // Returns a vector of vectors with <byte_offset, source_position> entries, or | 55 // Returns a vector of vectors with <byte_offset, source_position> entries, or |
57 // failure if the wasm bytes are detected as invalid. Note that this validation | 56 // failure if the wasm bytes are detected as invalid. Note that this validation |
58 // is not complete. | 57 // is not complete. |
59 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, | 58 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, |
60 const byte* module_end, | 59 const byte* module_end); |
61 uint32_t num_imported_functions); | |
62 | 60 |
63 } // namespace wasm | 61 } // namespace wasm |
64 } // namespace internal | 62 } // namespace internal |
65 } // namespace v8 | 63 } // namespace v8 |
66 | 64 |
67 #endif // V8_WASM_MODULE_DECODER_H_ | 65 #endif // V8_WASM_MODULE_DECODER_H_ |
OLD | NEW |