• Daniel Clark's avatar
    Plumb import assertions through SourceTextModuleDescriptor's ModuleRequestMap · ea0ccc7e
    Daniel Clark authored
    This change plumbs import assertions from SourceTextModuleDescriptor's
    ModuleRequestMap into SourceTextModuleInfo via a new ModuleRequest
    type, where previously there had been only the specifier.
    
    SourceTextModuleDescriptor::module_map now deduplicates module requests
    using the specifier and the import assertions.  Continuing to use the
    specifier alone would cause a loss of information in the event that
    a module imports from the same specifier multiple times using different
    sets of assertions.  Failing to deduplicate at all would result in
    multiple requests for statements like `import {a,b,c} from "foo.js"`,
    which would be a potential performance issue.  See design doc at
    https://docs.google.com/document/d/1yuXgNHSbTAPubT1Mg0JXp5uTrfirkvO1g5cHHCe-LmY
    for more detail on this decision.
    
    v8::internal::ModuleRequest holds the assertions as an array of the form
    [key1, value1, position1, key2, value2, assertion2, ...].  However the
    parser still needs to use a map, since duplicate assertion keys need to
    be detected at parse time.  A follow-up  change will ensure that
    assertions are sorted using a proper lexicographic sort.
    
    Bug: v8:10958
    Change-Id: Iff13fb9a37d58fc1622cd3cce78925ad2b7a14bb
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2493060
    Commit-Queue: Dan Clark <daniec@microsoft.com>
    Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
    Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#71066}
    ea0ccc7e
Name
Last commit
Last update
..
arm Loading commit data...
arm64 Loading commit data...
ia32 Loading commit data...
mips Loading commit data...
mips64 Loading commit data...
ppc Loading commit data...
s390 Loading commit data...
x64 Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
basic-block-profiler.cc Loading commit data...
basic-block-profiler.h Loading commit data...
code-tracer.h Loading commit data...
compilation-statistics.cc Loading commit data...
compilation-statistics.h Loading commit data...
disasm.h Loading commit data...
disassembler.cc Loading commit data...
disassembler.h Loading commit data...
eh-frame.cc Loading commit data...
eh-frame.h Loading commit data...
gdb-jit.cc Loading commit data...
gdb-jit.h Loading commit data...
objects-debug.cc Loading commit data...
objects-printer.cc Loading commit data...
perf-jit.cc Loading commit data...
perf-jit.h Loading commit data...
unwinder.cc Loading commit data...
unwinder.h Loading commit data...
unwinding-info-win64.cc Loading commit data...
unwinding-info-win64.h Loading commit data...