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/function-body-decoder.h" | 9 #include "src/wasm/function-body-decoder.h" |
10 #include "src/wasm/wasm-module.h" | 10 #include "src/wasm/wasm-module.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 // Extracts the function offset table from the wasm module bytes. | 50 // Extracts the function offset table from the wasm module bytes. |
51 // Returns a vector with <offset, length> entries, or failure if the wasm bytes | 51 // Returns a vector with <offset, length> entries, or failure if the wasm bytes |
52 // are detected as invalid. Note that this validation is not complete. | 52 // are detected as invalid. Note that this validation is not complete. |
53 FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start, | 53 FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start, |
54 const byte* module_end); | 54 const byte* module_end); |
55 | 55 |
56 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, | 56 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, |
57 const byte* end); | 57 const byte* end); |
58 | 58 |
| 59 struct CustomSectionOffset { |
| 60 uint32_t section_start; |
| 61 uint32_t name_offset; |
| 62 uint32_t name_length; |
| 63 uint32_t payload_offset; |
| 64 uint32_t payload_length; |
| 65 uint32_t section_length; |
| 66 }; |
| 67 |
| 68 V8_EXPORT_PRIVATE std::vector<CustomSectionOffset> DecodeCustomSections( |
| 69 const byte* start, const byte* end); |
| 70 |
59 // Extracts the mapping from wasm byte offset to asm.js source position per | 71 // Extracts the mapping from wasm byte offset to asm.js source position per |
60 // function. | 72 // function. |
61 // Returns a vector of vectors with <byte_offset, source_position> entries, or | 73 // Returns a vector of vectors with <byte_offset, source_position> entries, or |
62 // failure if the wasm bytes are detected as invalid. Note that this validation | 74 // failure if the wasm bytes are detected as invalid. Note that this validation |
63 // is not complete. | 75 // is not complete. |
64 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, | 76 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, |
65 const byte* module_end); | 77 const byte* module_end); |
66 | 78 |
67 } // namespace wasm | 79 } // namespace wasm |
68 } // namespace internal | 80 } // namespace internal |
69 } // namespace v8 | 81 } // namespace v8 |
70 | 82 |
71 #endif // V8_WASM_MODULE_DECODER_H_ | 83 #endif // V8_WASM_MODULE_DECODER_H_ |
OLD | NEW |