Index: src/wasm/module-decoder.h |
diff --git a/src/wasm/module-decoder.h b/src/wasm/module-decoder.h |
index 1e2b32a23c45f296e82eefcd30ec3e439ad3abd2..faaba1251f8d8d1d11d5637152b6cec92d7ec473 100644 |
--- a/src/wasm/module-decoder.h |
+++ b/src/wasm/module-decoder.h |
@@ -17,6 +17,8 @@ typedef Result<const WasmModule*> ModuleResult; |
typedef Result<WasmFunction*> FunctionResult; |
typedef std::vector<std::pair<int, int>> FunctionOffsets; |
typedef Result<FunctionOffsets> FunctionOffsetsResult; |
+typedef std::vector<std::vector<std::pair<int, int>>> AsmJsOffsets; |
+typedef Result<AsmJsOffsets> AsmJsOffsetsResult; |
// Decodes the bytes of a WASM module between {module_start} and {module_end}. |
V8_EXPORT_PRIVATE ModuleResult DecodeWasmModule(Isolate* isolate, Zone* zone, |
@@ -45,6 +47,15 @@ FunctionOffsetsResult DecodeWasmFunctionOffsets( |
WasmInitExpr DecodeWasmInitExprForTesting(const byte* start, const byte* end); |
+// Extracts the mapping from wasm byte offset to asm.js source position per |
+// function. |
+// Returns a vector of vectors with <byte_offset, source_position> entries, or |
+// failure if the wasm bytes are detected as invalid. Note that this validation |
+// is not complete. |
+AsmJsOffsetsResult DecodeAsmJsOffsets(const byte* module_start, |
+ const byte* module_end, |
+ uint32_t num_imported_functions); |
+ |
} // namespace wasm |
} // namespace internal |
} // namespace v8 |