1. 07 Jul, 2021 1 commit
  2. 26 Apr, 2021 1 commit
  3. 25 Jan, 2021 1 commit
  4. 16 Dec, 2020 1 commit
    • Daniel Clark's avatar
      [modules][api] Implement HostGetSupportedImportAssertions · 8ae4dc40
      Daniel Clark authored
      Implement the HostGetSupportedImportAssertions, whose purpose
      is to filter the list of import assertions exposed to the embedder to
      only those assertion with keys that the embedder recognizes. See
      https://tc39.es/proposal-import-assertions/#sec-hostgetsupportedimportassertions.
      
      This change doesn't actually implement it as a callback, but instead
      passes the supported assertions during creation of the Isolate via
      CreateParams. This expresses clearly the requirement that the supported
      assertions must never change for the lifetime of the Isolate.
      
      Note that we still need to maintain all assertions in a map
      while parsing the import assertions clause, because duplicate keys for
      an unsupported assertion still needs to be detected as a parse error. So,
      the filtering is done later during
      SourceTextModuleDescriptor::AstModuleRequest::Serialize.
      
      The actual filtering algorithm simply iterates the assertions and the
      supported assertion keys in a nested loop. There's currently only one
      assertion in use ("type"), so there should be no reason to get too
      clever here unless at least several more assertions are generally
      supported.
      
      Bug: v8:10958
      Change-Id: I9a2d965e9d452718d0ddfe9dca55b7b4ed963019
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2572173Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
      Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
      Commit-Queue: Dan Clark <daniec@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#71776}
      8ae4dc40
  5. 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
  6. 11 Nov, 2020 1 commit
  7. 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
  8. 19 Oct, 2020 1 commit
  9. 14 Aug, 2020 1 commit
    • Leszek Swirski's avatar
      [offthread] Change OffThreadIsolate to LocalIsolate · f1589bbe
      Leszek Swirski authored
      This patch introduces a new LocalIsolate and LocalFactory, which use
      LocalHeap and replace OffThreadIsolate and OffThreadFactory. This allows
      us to remove those classes, as well as the related OffThreadSpace,
      OffThreadLargeObjectSpace, OffThreadHeap, and OffThreadTransferHandle.
      OffThreadLogger becomes LocalLogger.
      
      LocalHeap behaves more like Heap than OffThreadHeap did, so this allows
      us to additionally remove the concept of "Finish" and "Publish" that the
      OffThreadIsolate had, and allows us to internalize strings directly with
      the newly-concurrent string table (where the implementation can now move
      to FactoryBase).
      
      This patch also removes the off-thread support from the deserializer
      entirely, as well as removing the LocalIsolateWrapper which allowed
      run-time distinction between Isolate and OffThreadIsolate. LocalHeap
      doesn't support the reservation model used by the deserializer, and we
      will likely move the deserializer to use LocalIsolate unconditionally
      once we figure out the details of how to do this.
      
      Bug: chromium:1011762
      
      Change-Id: I1a1a0a72952b19a8a4c167c11a863c153a1252fc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2315990
      Commit-Queue: Andreas Haas <ahaas@chromium.org>
      Auto-Submit: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69397}
      f1589bbe
  10. 10 Jul, 2020 1 commit
  11. 02 Mar, 2020 1 commit
  12. 10 Feb, 2020 1 commit
  13. 04 Feb, 2020 1 commit
    • Leszek Swirski's avatar
      [offthread] Add an OffThreadIsolate · 7a20b6b9
      Leszek Swirski authored
      The Factory/OffThreadFactory allows us to cleanly separate object
      construction behaviour between main-thread and off-thread in a
      syntactically consistent way (so that methods templated on the factory
      type can be made to work on both).
      
      However, there are cases where we also have to access the Isolate, for
      handle creation or exception throwing. So far we have been pushing more
      and more "customization points" into the factories to allow these
      factory-templated methods to dispatch on this isolate behaviour via
      these factory methods. Unfortunately, this is an increasing layering
      violation between Factory and Isolate, particularly around exception
      handling.
      
      Now, we introduce an OffThreadIsolate, analogous to Isolate in the same
      way as OffThreadFactory is analogous to Factory. All methods which were
      templated on Factory are now templated on Isolate, and methods which
      used to take an Isolate, and which were recently changed to take a
      templated Factory, are changed/reverted to take a templated Isolate.
      OffThreadFactory gets an isolate() method to match Factory's.
      
      Notably, FactoryHandle is changed to "HandleFor", where the template
      argument can be either of the Isolate type or the Factory type (allowing
      us to dispatch on both depending on what is available).
      
      Bug: chromium:1011762
      Change-Id: Id144176f7da534dd76f3d535ab2ade008b6845e3
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2030909
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#66101}
      7a20b6b9
  14. 16 Jan, 2020 1 commit
    • Leszek Swirski's avatar
      [offthread] Add OffThreadFactory support to AST strings · bcbb553d
      Leszek Swirski authored
      Add support for internalizing an AstValueFactory using the off-thread
      factory. Includes adding ConsString support to OffThreadFactory.
      
      This introduces a Handle union wrapper, which is used in locations that
      can store a Handle or an OffThreadHandle. This is used in this patch for
      the internalized "string" field of AST strings, and will be able to be
      used for other similar fields in other classes (e.g. the ScopeInfo
      handle in Scope, object boilerplate descriptor handles, the inferred
      name handle on FunctionLiterals, etc.). It has a Factory-templated
      getter which returns the appropriate handle for the factory, and a
      debug-only tag to make sure the right getter is used at runtime. This
      union wrapper currently decomposes implicitly to a Handle if the getter
      is not called, to minimise code changes, but this implicit conversion
      will likely be removed for clarity.
      
      Bug: chromium:1011762
      Change-Id: I5dd3a7bbdc483b66f5ff687e0079c545b636dc13
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1993971
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65816}
      bcbb553d
  15. 11 Oct, 2019 1 commit
    • Seth Brenith's avatar
      [torque] Generate instance types · 8c7ae314
      Seth Brenith authored
      Design doc:
      https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit
      
      Changes from the design doc:
      - Changed to use 'class' declarations rather than 'type' declarations
        for things that need instance types but whose layout is not known to
        Torque. These declarations end with a semicolon rather than having a
        full set of methods and fields surrounded by {}. If the class's name
        should not be treated as a class name in generated output (because
        it's actually a template, or doesn't exist at all), we use the
        standard 'generates' clause to declare the most appropriate C++ class.
      - Removed @instanceTypeName.
      - @highestInstanceType became @highestInstanceTypeWithinParentClassRange
        to indicate a semantic change: it no longer denotes the highest
        instance type globally, but only within the range of values for its
        immediate parent class. This lets us use it for Oddball, which is
        expected to be the highest primitive type.
      - Added new abstract classes JSCustomElementsObject and JSSpecialObject
        to help with some range checks.
      - Added @lowestInstanceTypeWithinParentClassRange so we can move the new
        classes JSCustomElementsObject and JSSpecialObject to the beginning of
        the JSObject range. This seems like the least-brittle way to establish
        ranges that also include JSProxy (and these ranges are verified with
        static assertions in instance-type.h).
      - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue.
      - Renamed @instanceTypeFlags to @reserveBitsInInstanceType.
      
      This change introduces the new annotations and adds the ability for
      Torque to assign instance types that satisfy those annotations. Torque
      now emits two new macros:
      - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the
        InstanceType enumeration
      - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String
        parts of INSTANCE_TYPE_LIST
      
      The design document mentions a couple of other macro lists that could
      easily be replaced, but I'd like to defer those to a subsequent checkin
      because this one is already pretty large.
      
      Bug: v8:7793
      Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarSathya Gunasekaran  <gsathya@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#64258}
      8c7ae314
  16. 29 Aug, 2019 1 commit
    • Seth Brenith's avatar
      [cleanup][torque] Use @generateCppClass in some simple cases, part 2 · a5811358
      Seth Brenith authored
      This patch is mostly mechanical. A few changes in
      implementation-visitor.cc might be worth mentioning:
      - Don't generate both field offset macros and class definitions for the
        same class. This was mostly just to keep me from forgetting to remove
        the DEFINE_FIELD_OFFSET_CONSTANTS part when converting classes, but
        also helpfully flagged that FixedArrayBase wasn't using the generated
        class that it requested.
      - Generate forward declarations for all tq-defined classes in
        internal-class-definitions-tq.h. This is helpful for making things
        compile when classes have fields of other class types.
      - When generating accessors for union types, use the nearest class type
        that contains the entire union rather than plain Object. This is
        important for compile-time type safety. It also required a few minor
        fixes elsewhere (isolate.cc, modules.cc, scope-info.cc,
        source-text-module.cc, and a correction of the field types in
        CallHandlerInfo to match how they're set in api.cc).
      
      Change-Id: I3b9280e30779ce57fb9f3629eecfec898e26d708
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1774976Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Cr-Commit-Position: refs/heads/master@{#63458}
      a5811358
  17. 19 Jun, 2019 1 commit
  18. 24 May, 2019 1 commit
  19. 23 May, 2019 1 commit
  20. 20 Feb, 2019 1 commit
  21. 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
  22. 24 May, 2018 1 commit
  23. 02 May, 2018 1 commit
    • Leszek Swirski's avatar
      Revert "[parser] Slice the source string where possible" · 18bc2856
      Leszek Swirski authored
      This reverts commit 2df5e7a7.
      
      Reason for revert: Mystery crashes https://bugs.chromium.org/p/chromium/issues/detail?id=838805
      
      Original change's description:
      > [parser] Slice the source string where possible
      > 
      > When internalizing string literals (for quoted strings or property names),
      > try to create a sliced string of the source string rather than allocating
      > a copy of the bytes.
      > 
      > This will not work for string literals that contain escapes (e.g. unicode
      > escapes), and currently does not support two-byte strings.
      > 
      > Bug: chromium:818642
      > Change-Id: I686e5ad36baecd1a84ce5e124118431249b6c980
      > Reviewed-on: https://chromium-review.googlesource.com/1010282
      > Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
      > Reviewed-by: Yang Guo <yangguo@chromium.org>
      > Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
      > Reviewed-by: Marja Hölttä <marja@chromium.org>
      > Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#52898}
      
      TBR=marja@chromium.org,yangguo@chromium.org,jarin@chromium.org,mlippautz@chromium.org,leszeks@chromium.org,verwaest@chromium.org
      
      Change-Id: I598b6668c43a3e843e2dd8e60852b2b2f3461954
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: chromium:818642
      Reviewed-on: https://chromium-review.googlesource.com/1039885
      Commit-Queue: Leszek Swirski <leszeks@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#52919}
      18bc2856
  24. 01 May, 2018 1 commit
  25. 23 Aug, 2017 1 commit
  26. 21 Jun, 2017 1 commit
  27. 01 Feb, 2017 1 commit
  28. 10 Jan, 2017 1 commit
  29. 09 Jan, 2017 1 commit
  30. 07 Nov, 2016 2 commits
  31. 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
  32. 26 Oct, 2016 1 commit
  33. 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
  34. 21 Sep, 2016 1 commit
  35. 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
  36. 15 Sep, 2016 1 commit
  37. 14 Sep, 2016 2 commits