• 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
..
DIR_METADATA Loading commit data...
OWNERS Loading commit data...
expression-scope.h Loading commit data...
func-name-inferrer.cc Loading commit data...
func-name-inferrer.h Loading commit data...
keywords-gen.h Loading commit data...
keywords.txt Loading commit data...
literal-buffer.cc Loading commit data...
literal-buffer.h Loading commit data...
parse-info.cc Loading commit data...
parse-info.h Loading commit data...
parser-base.h Loading commit data...
parser.cc Loading commit data...
parser.h Loading commit data...
parsing.cc Loading commit data...
parsing.h Loading commit data...
pending-compilation-error-handler.cc Loading commit data...
pending-compilation-error-handler.h Loading commit data...
preparse-data-impl.h Loading commit data...
preparse-data.cc Loading commit data...
preparse-data.h Loading commit data...
preparser-logger.h Loading commit data...
preparser.cc Loading commit data...
preparser.h Loading commit data...
rewriter.cc Loading commit data...
rewriter.h Loading commit data...
scanner-character-streams.cc Loading commit data...
scanner-character-streams.h Loading commit data...
scanner-inl.h Loading commit data...
scanner.cc Loading commit data...
scanner.h Loading commit data...
token.cc Loading commit data...
token.h Loading commit data...