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

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

Issue 2929853003: Fix use of history timers in background threads. (Closed)
Patch Set: Merge with master. Created 3 years, 6 months 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
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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 typedef Result<FunctionOffsets> FunctionOffsetsResult; 53 typedef Result<FunctionOffsets> FunctionOffsetsResult;
54 struct AsmJsOffsetEntry { 54 struct AsmJsOffsetEntry {
55 int byte_offset; 55 int byte_offset;
56 int source_position_call; 56 int source_position_call;
57 int source_position_number_conversion; 57 int source_position_number_conversion;
58 }; 58 };
59 typedef std::vector<std::vector<AsmJsOffsetEntry>> AsmJsOffsets; 59 typedef std::vector<std::vector<AsmJsOffsetEntry>> AsmJsOffsets;
60 typedef Result<AsmJsOffsets> AsmJsOffsetsResult; 60 typedef Result<AsmJsOffsets> AsmJsOffsetsResult;
61 61
62 // Decodes the bytes of a wasm module between {module_start} and {module_end}. 62 // Decodes the bytes of a wasm module between {module_start} and {module_end}.
63 V8_EXPORT_PRIVATE ModuleResult DecodeWasmModule( 63 V8_EXPORT_PRIVATE ModuleResult SyncDecodeWasmModule(Isolate* isolate,
64 const byte* module_start,
65 const byte* module_end,
66 bool verify_functions,
67 ModuleOrigin origin);
68
69 V8_EXPORT_PRIVATE ModuleResult AsyncDecodeWasmModule(
64 Isolate* isolate, const byte* module_start, const byte* module_end, 70 Isolate* isolate, const byte* module_start, const byte* module_end,
65 bool verify_functions, ModuleOrigin origin, bool is_sync = true); 71 bool verify_functions, ModuleOrigin origin,
72 const std::shared_ptr<Counters>& counters);
66 73
67 // Exposed for testing. Decodes a single function signature, allocating it 74 // Exposed for testing. Decodes a single function signature, allocating it
68 // in the given zone. Returns {nullptr} upon failure. 75 // in the given zone. Returns {nullptr} upon failure.
69 V8_EXPORT_PRIVATE FunctionSig* DecodeWasmSignatureForTesting(Zone* zone, 76 V8_EXPORT_PRIVATE FunctionSig* DecodeWasmSignatureForTesting(Zone* zone,
70 const byte* start, 77 const byte* start,
71 const byte* end); 78 const byte* end);
72 79
73 // Decodes the bytes of a wasm function between 80 // Decodes the bytes of a wasm function between
74 // {function_start} and {function_end}. 81 // {function_start} and {function_end}.
75 V8_EXPORT_PRIVATE FunctionResult DecodeWasmFunction( 82 V8_EXPORT_PRIVATE FunctionResult
76 Isolate* isolate, Zone* zone, ModuleBytesEnv* env, 83 SyncDecodeWasmFunction(Isolate* isolate, Zone* zone, ModuleBytesEnv* env,
77 const byte* function_start, const byte* function_end, bool is_sync = true); 84 const byte* function_start, const byte* function_end);
85
86 V8_EXPORT_PRIVATE FunctionResult
87 AsyncDecodeWasmFunction(Isolate* isolate, Zone* zone, ModuleBytesEnv* env,
88 const byte* function_start, const byte* function_end,
89 const std::shared_ptr<Counters>& counters);
78 90
79 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, 91 V8_EXPORT_PRIVATE WasmInitExpr DecodeWasmInitExprForTesting(const byte* start,
80 const byte* end); 92 const byte* end);
81 93
82 struct CustomSectionOffset { 94 struct CustomSectionOffset {
83 uint32_t section_start; 95 uint32_t section_start;
84 uint32_t name_offset; 96 uint32_t name_offset;
85 uint32_t name_length; 97 uint32_t name_length;
86 uint32_t payload_offset; 98 uint32_t payload_offset;
87 uint32_t payload_length; 99 uint32_t payload_length;
88 uint32_t section_length; 100 uint32_t section_length;
89 }; 101 };
90 102
91 V8_EXPORT_PRIVATE std::vector<CustomSectionOffset> DecodeCustomSections( 103 V8_EXPORT_PRIVATE std::vector<CustomSectionOffset> DecodeCustomSections(
92 const byte* start, const byte* end); 104 const byte* start, const byte* end);
93 105
94 // Extracts the mapping from wasm byte offset to asm.js source position per 106 // Extracts the mapping from wasm byte offset to asm.js source position per
95 // function. 107 // function.
96 // Returns a vector of vectors with <byte_offset, source_position> entries, or 108 // Returns a vector of vectors with <byte_offset, source_position> entries, or
97 // failure if the wasm bytes are detected as invalid. Note that this validation 109 // failure if the wasm bytes are detected as invalid. Note that this validation
98 // is not complete. 110 // is not complete.
99 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, 111 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start,
100 const byte* module_end); 112 const byte* module_end);
101 113
102 } // namespace wasm 114 } // namespace wasm
103 } // namespace internal 115 } // namespace internal
104 } // namespace v8 116 } // namespace v8
105 117
106 #endif // V8_WASM_MODULE_DECODER_H_ 118 #endif // V8_WASM_MODULE_DECODER_H_
OLDNEW
« src/isolate.h ('K') | « src/wasm/module-compiler.cc ('k') | src/wasm/module-decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698