Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: src/wasm/module-decoder.h

Issue 2540133002: [wasm] Remove raw byte pointers from WasmModule (Closed)
Patch Set: Address comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 // Exposed for testing. Decodes a single function signature, allocating it 31 // Exposed for testing. Decodes a single function signature, allocating it
32 // in the given zone. Returns {nullptr} upon failure. 32 // in the given zone. Returns {nullptr} upon failure.
33 V8_EXPORT_PRIVATE FunctionSig* DecodeWasmSignatureForTesting(Zone* zone, 33 V8_EXPORT_PRIVATE FunctionSig* DecodeWasmSignatureForTesting(Zone* zone,
34 const byte* start, 34 const byte* start,
35 const byte* end); 35 const byte* end);
36 36
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,
41 ModuleBytesEnv* env,
41 const byte* function_start, 42 const byte* function_start,
42 const byte* function_end); 43 const byte* function_end);
43 44
44 // Extracts the function offset table from the wasm module bytes. 45 // Extracts the function offset table from the wasm module bytes.
45 // Returns a vector with <offset, length> entries, or failure if the wasm bytes 46 // 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. 47 // are detected as invalid. Note that this validation is not complete.
47 FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start, 48 FunctionOffsetsResult DecodeWasmFunctionOffsets(const byte* module_start,
48 const byte* module_end); 49 const byte* module_end);
49 50
50 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, 51 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start,
51 const byte* end); 52 const byte* end);
52 53
53 // Extracts the mapping from wasm byte offset to asm.js source position per 54 // Extracts the mapping from wasm byte offset to asm.js source position per
54 // function. 55 // function.
55 // Returns a vector of vectors with <byte_offset, source_position> entries, or 56 // Returns a vector of vectors with <byte_offset, source_position> entries, or
56 // failure if the wasm bytes are detected as invalid. Note that this validation 57 // failure if the wasm bytes are detected as invalid. Note that this validation
57 // is not complete. 58 // is not complete.
58 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, 59 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start,
59 const byte* module_end); 60 const byte* module_end);
60 61
61 } // namespace wasm 62 } // namespace wasm
62 } // namespace internal 63 } // namespace internal
63 } // namespace v8 64 } // namespace v8
64 65
65 #endif // V8_WASM_MODULE_DECODER_H_ 66 #endif // V8_WASM_MODULE_DECODER_H_
OLDNEW
« no previous file with comments | « src/wasm/ast-decoder.cc ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698