1. 12 Nov, 2020 1 commit
    • Daniel Clark's avatar
      Sort import assertions by code point order of the keys · 73f8a710
      Daniel Clark authored
      Per https://tc39.es/proposal-import-assertions/#sec-assert-clause-to-assertions,
      import assertions should be sorted by the import assertion [[Key]]s,
      in order to prevent hosts from relying on a changing order of the
      assertions to determine behavior.
      
      Prior to this change, the assertions were being sorted by pointer. With
      this CL, the keys are sorted using a code point ordering so that the
      order of the assertions received by the host will be stable and
      non-surprising.
      
      This CL also switches the SourceTextModuleDescriptor's ModuleRequestMap,
      RegularExportMap, and RegularImportMap to use the code point order
      comparison rather than their former shortlex sort.  This change will not
      be externally visible, but it seems best to make these consistent.
      
      In order to avoid #including the fairly large ast-value-factory.h
      into ast/modules.h, I changed ImportAssertions into a separate class
      definition rather than keeping it as a typedef.  The alternative would
      be to define a common AstRawStringComparer in ast-value-factory.h and
      then #include ast-value-factory.h in both ast/modules.h and
      parsing/parser.h so that the ImportAssertions typedef would have a
      full, shared definition of the AstRawStringComparer type.
      
      Bug: v8:10958
      Change-Id: I29c9544aa0a4340c56e1ee631be6cabb2a2eb921
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2533038
      Commit-Queue: Dan Clark <daniec@microsoft.com>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#71165}
      73f8a710
  2. 11 Nov, 2020 1 commit
  3. 10 Nov, 2020 1 commit
    • 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
  4. 19 Oct, 2020 1 commit
  5. 02 Mar, 2020 1 commit
  6. 10 Feb, 2020 1 commit
  7. 19 Jun, 2019 1 commit
  8. 27 May, 2019 1 commit
    • Clemens Hammacher's avatar
      [cleanup] Replace simple typedefs by using · a335f2ae
      Clemens Hammacher authored
      This replaces all typedefs that define types and not functions by the
      equivalent "using" declaration.
      
      This was done mostly automatically using this command:
      ag -l '\btypedef\b' src test | xargs -L1 \
           perl -i -p0e 's/typedef ([^*;{}]+) (\w+);/using \2 = \1;/sg'
      
      Patchset 2 then adds some manual changes for typedefs for pointer types,
      where the regular expression did not match.
      
      R=mstarzinger@chromium.org
      TBR=yangguo@chromium.org, jarin@chromium.org
      
      Bug: v8:9183
      Change-Id: I6f6ee28d1793b7ac34a58f980b94babc21874b78
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1631409
      Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
      Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#61849}
      a335f2ae
  9. 03 Apr, 2019 1 commit
  10. 20 Feb, 2019 1 commit
  11. 11 Jul, 2018 1 commit
    • Leszek Swirski's avatar
      [modules] Make exported variable indices stable · e39b90f6
      Leszek Swirski authored
      A module's exported variables are assigned a cell index based on their
      order in the exported variable map. This map is keyed by the variable
      name, an AstRawString*.
      
      Unfortunately, these string pointers are not guaranteed to increase
      monotonically as variables are encountered, which means that this map
      isn't stable across parses. In particular, it can cause failures for
      setVariableValue if the parser is unlucky.
      
      This patch adds a custom comparator to these AstRawString* keyed maps,
      which is stable across parses.
      
      Change-Id: Ie6e88fc2d252d873de661d7fc5278feba3955727
      Reviewed-on: https://chromium-review.googlesource.com/1131503Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54379}
      e39b90f6
  12. 19 Oct, 2017 1 commit
  13. 21 Jun, 2017 1 commit
  14. 17 Mar, 2017 1 commit
  15. 01 Feb, 2017 1 commit
  16. 07 Nov, 2016 2 commits
  17. 04 Nov, 2016 1 commit
    • neis's avatar
      [modules] Assign cell indices at validation time. · 1dd241c4
      neis authored
      Instead of having a MODULE variable's index be 0 or 1, let it be the index of
      its cell.  In this CL, we assign the indices but we continue to only use them to
      distinguish imports from exports.  Actually using them to directly access the
      cells will be done in a later CL.
      
      R=adamk@chromium.org
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2460233003
      Cr-Commit-Position: refs/heads/master@{#40752}
      1dd241c4
  18. 26 Oct, 2016 1 commit
  19. 23 Sep, 2016 2 commits
    • neis's avatar
      [modules] Simplify treatment of empty imports. · f9e9a016
      neis authored
      There's no reason (anymore) to have empty imports in special_imports.  Remove
      them from there and rename special_imports to namespace_imports to be more
      precise.
      
      R=adamk@chromium.org
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2368613002
      Cr-Commit-Position: refs/heads/master@{#39693}
      f9e9a016
    • neis's avatar
      [modules] Do basic linking. · d7858e35
      neis authored
      Resolve imports and indirect exports at instantiation time.
      
      With this CL we have some basic functionality for modules working.  Not yet
      supported: star exports, namespace imports, cycle detection, proper variable
      initialisation in mutually recursive modules.
      
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2362083002
      Cr-Commit-Position: refs/heads/master@{#39689}
      d7858e35
  20. 22 Sep, 2016 1 commit
  21. 21 Sep, 2016 1 commit
  22. 20 Sep, 2016 1 commit
  23. 19 Sep, 2016 1 commit
    • neis's avatar
      [modules] Explicitly keep track of module requests. · c5785bfb
      neis authored
      We must keep track of the exact order in which modules are requested.
      To do so, maintain a map from module specifiers to position while
      parsing (in ModuleDescriptor). Descriptor entries now refer to that
      position rather than the string.  When generating the ModuleInfo, turn
      this map into an array of specifiers. We don't need the map anymore
      later on, so we do not reconstruct it when deserializing again.
      
      BUG=v8:1569
      
      Review-Url: https://codereview.chromium.org/2353633002
      Cr-Commit-Position: refs/heads/master@{#39519}
      c5785bfb
  24. 15 Sep, 2016 1 commit
  25. 14 Sep, 2016 2 commits
  26. 12 Sep, 2016 3 commits
  27. 05 Sep, 2016 2 commits
  28. 29 Aug, 2016 1 commit
  29. 26 Aug, 2016 1 commit
  30. 25 Aug, 2016 1 commit
  31. 18 Aug, 2016 1 commit
  32. 10 Aug, 2016 2 commits
  33. 08 Aug, 2016 1 commit