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

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, 5 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 WireBytesRef section; 95 WireBytesRef section;
84 WireBytesRef name; 96 WireBytesRef name;
85 WireBytesRef payload; 97 WireBytesRef payload;
86 }; 98 };
87 99
88 V8_EXPORT_PRIVATE std::vector<CustomSectionOffset> DecodeCustomSections( 100 V8_EXPORT_PRIVATE std::vector<CustomSectionOffset> DecodeCustomSections(
89 const byte* start, const byte* end); 101 const byte* start, const byte* end);
90 102
91 // Extracts the mapping from wasm byte offset to asm.js source position per 103 // Extracts the mapping from wasm byte offset to asm.js source position per
92 // function. 104 // function.
93 // Returns a vector of vectors with <byte_offset, source_position> entries, or 105 // Returns a vector of vectors with <byte_offset, source_position> entries, or
94 // failure if the wasm bytes are detected as invalid. Note that this validation 106 // failure if the wasm bytes are detected as invalid. Note that this validation
95 // is not complete. 107 // is not complete.
96 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, 108 AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start,
97 const byte* module_end); 109 const byte* module_end);
98 110
99 } // namespace wasm 111 } // namespace wasm
100 } // namespace internal 112 } // namespace internal
101 } // namespace v8 113 } // namespace v8
102 114
103 #endif // V8_WASM_MODULE_DECODER_H_ 115 #endif // V8_WASM_MODULE_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698