• Daniel Clark's avatar
    [modules] Add refactored API to get ModuleRequests and expose import assertions · f588c889
    Daniel Clark authored
    This change refactors the v8.h API as discussed in
    https://docs.google.com/document/d/1yuXgNHSbTAPubT1Mg0JXp5uTrfirkvO1g5cHHCe-LmY/edit#heading=h.q0c9h4p928mn
    such that a v8::Module exposes module requests as a FixedArray of
    ModuleRequest objects, which can then be used to obtain their module
    specifier and source code offset.  This replaces the old functions that
    passed back individual specifier Strings and Locations via repeated
    calls to getters that take an index.  These are marked as deprecated.
    
    The new ModuleRequest interface includes a getter for an
    ImportAssertions FixedArray, which will contain the import assertions
    for the request if --harmony-import-assertions is set, and will be
    empty otherwise.
    
    One notable change here is that the APIs now return source code offsets
    rather than v8::Locations.  The host must then call the new
    Module::SourceOffsetToLocation to convert these offsets into line/column
    numbers. This requires a bit more back-and-forth, but allows the host to
    defer the cost of converting from source offset to line/column numbers
    until an error needs to be reported, potentially skipping the work
    altogether.
    
    Bug: v8:10958
    Change-Id: I181639737c701e467324e6c781aa4d7bdd87ae8c
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2545577
    Commit-Queue: Dan Clark <daniec@microsoft.com>
    Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#71387}
    f588c889
Name
Last commit
Last update
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...