v8/include
Ingvar Stepanyan 1b5f3be087 [wasm] Pretend that DWARF section is a fake source map
Unfortunately, codebase contains lots of places that use one of the two
formats as an internal representation for Wasm locations:
1) {line: 0, column: byte offset within entire module}
2) {line: function index, column: byte offset within function}

These places choose these formats interchangeably and convert from one
to another depending on the presence of source map URL in Wasm.

This is not very convenient and makes it hard to add support for DWARF
which should behave just like Wasm with source maps - that is, report a
raw Wasm script instead of fake scripts per each disassembled function,
and use representation (1) instead of (2) internally.

I tried to refactor these locations and avoid checking for source map
URLs in the previous CL - https://crrev.com/c/v8/v8/+/1833688. However,
it quickly got out of hand, and updating code in one place just kept
revealing yet another that gets broken by the changes, so I made a
decision to abandon it and leave to someone who knows the codebase
better.

Instead, this CL is based on https://crrev.com/c/v8/v8/+/1809375, but,
rather than trying to integrate DWARF separately and only for supported
agents, it pretends that encountering DWARF section is the same as
encountering a `sourceMappingURL` section with fake URL "wasm://dwarf".

This ensures that Wasm with DWARF behaves exactly in the same way as
Wasm with source maps, just like we want, with minimal changes to the
codebase. The only downside is that frontends without DWARF support
won't get even a disassembled version of Wasm that contains DWARF info.
This is unfortunate, but, as per previous discussions, should be fine
given current state of Wasm debugging.

Change-Id: Ia7256075e4bfd2f407d001d02b96883d7267436e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1834341
Commit-Queue: Ingvar Stepanyan <rreverser@google.com>
Reviewed-by: Yang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64157}
2019-10-08 10:54:09 +00:00
..
libplatform [iwyu] Add missing includes of <memory> for std::unique_ptr 2019-09-13 17:13:36 +00:00
APIDesign.md Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
DEPS [inspector] Build inspector under v8_enable_inspector build flag. 2016-09-06 23:26:35 +00:00
js_protocol-1.2.json Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
js_protocol-1.3.json Move inspector protocol definitions to include/ 2019-06-18 17:59:36 +00:00
js_protocol.pdl [wasm] Pretend that DWARF section is a fake source map 2019-10-08 10:54:09 +00:00
OWNERS Use relative paths to OWNERS files 2019-08-12 13:52:52 +00:00
v8-inspector-protocol.h [inspector] Build inspector under v8_enable_inspector build flag. 2016-09-06 23:26:35 +00:00
v8-inspector.h inspector: V8StackTraceId serialization/deserialization 2019-09-20 00:38:24 +00:00
v8-internal.h [ptr-compr] Set isolate root to the beginning of a 4Gb reservation 2019-10-07 17:26:30 +00:00
v8-platform.h Add crash keys via a callback to the embedder that created the isolate. 2019-08-13 00:35:59 +00:00
v8-profiler.h [log] report code relocation through CodeEventHandler 2019-09-24 10:50:05 +00:00
v8-testing.h Remove easy to remove calls to Isolate::Current() from api.cc 2015-11-30 08:16:59 +00:00
v8-util.h Reland "[api,heap] Remove deprecated Persistent APIs" 2019-04-24 09:34:27 +00:00
v8-value-serializer-version.h Expose the ValueSerializer data format version as a compile-time constant. 2017-04-27 15:14:41 +00:00
v8-version-string.h [build] Fix V8_VERSION_STRING with embedder string 2017-10-23 14:31:52 +00:00
v8-version.h Bump V8 version 2019-09-05 11:54:39 +00:00
v8-wasm-trap-handler-posix.h [api] Fix includes in trap handler API header files 2019-01-16 15:15:52 +00:00
v8-wasm-trap-handler-win.h [api] Fix includes in trap handler API header files 2019-01-16 15:15:52 +00:00
v8.h [api, heap] Implement TracedReference 2019-10-07 22:34:54 +00:00
v8config.h [build] Define V8_TARGET_OS_ and consider it in x64 codegen 2019-09-19 13:38:56 +00:00