1. 04 Feb, 2022 1 commit
    • Nico Hartmann's avatar
      Reland "Reland "[Torque] Generalize Torque literals to larger size"" · 362b30eb
      Nico Hartmann authored
      This is a reland of 517ed4ad
      
      Original change's description:
      > Reland "[Torque] Generalize Torque literals to larger size"
      >
      > Previously, literals in Torque were stored as double values, which
      > made it impossible to precisely represent 64 bit integer values.
      > This CL replaces the old literal expression with an integer and
      > floating point literal expression that are unbounded in size. We
      > allow implicit conversion of these literals to arbitary integer
      > and floating point types respectively and insert a corresponding
      > bounds check into generated CSA.
      >
      > Changes in the reland: Simplified IntegerLiteral to single digit.
      >
      > Bug: v8:7793, chromium:1289282
      > Change-Id: I31c762c2f31165c7a1d0b07842b764e5851ce189
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3406750
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78811}
      
      Bug: v8:7793, chromium:1289282
      Change-Id: I7aadc4d2c9494f03eae85e94949c8f4cab7a075c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3437047Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78939}
      362b30eb
  2. 28 Jan, 2022 1 commit
    • Nico Hartmann's avatar
      Revert "Reland "[Torque] Generalize Torque literals to larger size"" · d96934c7
      Nico Hartmann authored
      This reverts commit 517ed4ad.
      
      Reason for revert: There still seems to be an issue on V8 Win msvc related to this CL (https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Win64%20-%20msvc/20568/overview).
      
      Original change's description:
      > Reland "[Torque] Generalize Torque literals to larger size"
      >
      > Previously, literals in Torque were stored as double values, which
      > made it impossible to precisely represent 64 bit integer values.
      > This CL replaces the old literal expression with an integer and
      > floating point literal expression that are unbounded in size. We
      > allow implicit conversion of these literals to arbitary integer
      > and floating point types respectively and insert a corresponding
      > bounds check into generated CSA.
      >
      > Changes in the reland: Simplified IntegerLiteral to single digit.
      >
      > Bug: v8:7793, chromium:1289282
      > Change-Id: I31c762c2f31165c7a1d0b07842b764e5851ce189
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3406750
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78811}
      
      Bug: v8:7793, chromium:1289282
      Change-Id: I818cec9625fbd827a4a30088d8c8b759fb6c50d7
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3424484
      Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78847}
      d96934c7
  3. 27 Jan, 2022 1 commit
  4. 20 Jan, 2022 1 commit
    • Nico Hartmann's avatar
      Revert "[Torque] Generalize Torque literals to larger size" · 362e265d
      Nico Hartmann authored
      This reverts commit 757830b0.
      
      Reason for revert: Speculatively revert due to a number of
      performance regressions
      
      Original change's description:
      > [Torque] Generalize Torque literals to larger size
      >
      > Previously, literals in Torque were stored as double values, which
      > made it impossible to precisely represent 64 bit integer values.
      > This CL replaces the old literal expression with an integer and
      > floating point literal expression that are unbounded in size. We
      > allow implicit conversion of these literals to arbitary integer
      > and floating point types respectively and insert a corresponding
      > bounds check into generated CSA.
      >
      > Bug: v8:7793
      > Change-Id: I46c231aab92bc2f0c26955d1876079f306b358c6
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3329792
      > Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      > Cr-Commit-Position: refs/heads/main@{#78671}
      
      Bug: v8:7793
      Change-Id: I9896e28b3c69b8cf2488bf93e993ec320d8c5d2e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3401866Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
      Owners-Override: Nico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
      Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/main@{#78706}
      362e265d
  5. 18 Jan, 2022 1 commit
  6. 06 Dec, 2021 1 commit
  7. 30 Sep, 2021 2 commits
  8. 23 Feb, 2021 1 commit
    • Seth Brenith's avatar
      [torque] Add LazyNode support · ede27407
      Seth Brenith authored
      This change adds a new abstract type Lazy<T> which can be used to
      interoperate with CSA code that uses LazyNode. This new type has special
      code-generation rules because its generated type is not TNode<...> but
      std::function<TNode<...>()>. Torque code can do nothing with this type
      except pass it around, but passing it to the CSA function RunLazy is an
      easy way to execute the std::function and get back a normal value.
      Torque code can also create Lazy<T> values using the intrinsic function
      %MakeLazy, which takes the name of a macro as its first parameter,
      followed by arguments to that macro which will be passed when the
      LazyNode is evaluated. We use the macro's name because the language
      doesn't support taking references to macros, and implementing such a
      feature would be complicated.
      
      Bug: v8:7793
      Change-Id: I09120960e3492dd51be0d4c57e14ff3826b99262
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2701752
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#72964}
      ede27407
  9. 19 Jan, 2021 1 commit
  10. 18 Jan, 2021 1 commit
  11. 30 Nov, 2020 1 commit
  12. 19 Nov, 2020 1 commit
  13. 06 Aug, 2020 2 commits
    • Tobias Tebbi's avatar
      Reland "[torque] typed context slot access" · 6647f292
      Tobias Tebbi authored
      This is a reland of 408e7240
      Change: Allow CSA load elimination accross code comments
      
      Original change's description:
      > [torque] typed context slot access
      >
      > This introduces a new type Slot<ContextType, SlotType> that is used
      > for enum values used to access context slots.
      > Together with new types for the various custom contexts used in
      > Torque, this results in fairly type-safe access to context slots,
      > including the NativeContext's slots.
      >
      > Drive-by changes:
      > - Introduce a new header file to specify headers needed for
      >   generated CSA headers, to reduce the amount of includes specified
      >   in implementation-visitor.cc
      > - Port AllocateSyntheticFunctionContext to Torque.
      >
      > Bug: v8:7793
      > Change-Id: I509a128916ca408eeeb636a9bcc376b2cc868532
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335064
      > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
      > Cr-Commit-Position: refs/heads/master@{#69249}
      
      Bug: v8:7793
      Change-Id: I1fe100d8d62e8220524eddb8ecc4faa85219748d
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2339462Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69264}
      6647f292
    • Jakob Gruber's avatar
      Revert "[torque] typed context slot access" · a55a2447
      Jakob Gruber authored
      This reverts commit 408e7240.
      
      Reason for revert: debug builds fail
      
      is_component_build = true
      is_debug = true
      use_goma = true
      v8_enable_backtrace = true
      v8_enable_debugging_features = true
      v8_enable_fast_mksnapshot = true
      v8_enable_slow_dchecks = true
      v8_enable_snapshot_code_comments = true
      v8_enable_verify_csa = true
      v8_optimized_debug = false
      v8_use_multi_snapshots = false
      
      # Fatal error in ../../src/compiler/backend/instruction-selector.cc, line 3088
      # Expected Turbofan static assert to hold, but got non-true input:
        static_assert(nativeContext == LoadNativeContext(context)) at src/builtins/promise-resolve.tq:45:5
      
      
      Original change's description:
      > [torque] typed context slot access
      > 
      > This introduces a new type Slot<ContextType, SlotType> that is used
      > for enum values used to access context slots.
      > Together with new types for the various custom contexts used in
      > Torque, this results in fairly type-safe access to context slots,
      > including the NativeContext's slots.
      > 
      > Drive-by changes:
      > - Introduce a new header file to specify headers needed for
      >   generated CSA headers, to reduce the amount of includes specified
      >   in implementation-visitor.cc
      > - Port AllocateSyntheticFunctionContext to Torque.
      > 
      > Bug: v8:7793
      > Change-Id: I509a128916ca408eeeb636a9bcc376b2cc868532
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2335064
      > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
      > Cr-Commit-Position: refs/heads/master@{#69249}
      
      TBR=tebbi@chromium.org,seth.brenith@microsoft.com
      
      Change-Id: I90c014022a808449aca4a9b9b3c3b8e036beb28e
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7793
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2340903Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Commit-Queue: Jakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#69256}
      a55a2447
  14. 05 Aug, 2020 2 commits
  15. 03 Aug, 2020 1 commit
  16. 27 Jul, 2020 1 commit
  17. 16 Jul, 2020 1 commit
  18. 10 Jul, 2020 1 commit
  19. 03 Jul, 2020 1 commit
  20. 23 Jun, 2020 1 commit
    • Daniel Clifford's avatar
      [torque] generate Cast<> macros from Torque-defined classes · 1052dfb3
      Daniel Clifford authored
      This change enables automatic generation of Cast<> operators for
      classes that are defined in Torque.
      
      * Cast<> macros are generated for all classes that are defined in
        Torque code that are neither shapes nor marked with a new
        @doNotGenerateCast annotation.
      
      * Implicitly generated Cast macros simply call through to an
        internally-defined "DownCastForTorqueClass" macro that implements
        the cast using one of three strategies for efficiency. If the class
        has subclasses (i.e. a range of instance types including subtypes),
        the DownCastForTorqueClass checks for inclusion in the instance type
        range. If the class has a single instance type (i.e. no subclasses),
        then either 1) a map check is used if the class has a globally-
        defined map constant or 2) an equality check for the instance type
        is used.
      
      * Added new intrinsics to introspect class information, e.g. fetching
        instance type ranges for a class, accessing the globally-defined map
        for a class.
      
      * Removed a whole pile of existing explicit Cast<> operators that are
        no longer needed because of the implicitly generated Cast<> macros.
      
      * Added tests for the new Cast<> implementations.
      
      Bug: v8:7793
      Change-Id: I3aadb0c62b720e9de4e7978b9ec4f05075771b8b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2250239
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#68478}
      1052dfb3
  21. 22 May, 2020 1 commit
    • Seth Brenith's avatar
      [torque] Generate better code when using `&` operator on bitfields · 98438d86
      Seth Brenith authored
      Sometimes CSA code carefully constructs a mask to check several
      bitfields at once. Thus far, such a check has been very awkward to write
      in Torque. This change adds a way to do so, using the
      non-short-circuiting binary `&` operator. So now you can write an
      expression that depends on several bitfields from a bitfield struct,
      like `x.a == 5 & x.b & !x.c & x.d == 2` (assuming b is a one-bit value),
      and it will be reduced to a single mask and equality check. To
      demonstrate a usage of this new reduction, this change ports the trivial
      macro IsSimpleObjectMap to Torque. I manually verified that the
      generated code for the builtin SetDataProperties, which uses that macro,
      is unchanged.
      
      Bug: v8:7793
      Change-Id: I4a23e0005d738a6699ea0f2a63f9fd67b01e7026
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2183276
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67948}
      98438d86
  22. 12 May, 2020 1 commit
  23. 07 May, 2020 1 commit
  24. 06 May, 2020 1 commit
  25. 04 May, 2020 1 commit
    • Tobias Tebbi's avatar
      [torque] improve GC visitors · f1400e43
      Tobias Tebbi authored
      Summary of changes:
      
      - GC visitors no longer rely on superclass visitors, but instead visit
        everything themselves. This enables generating better code.
      - Try to match simple body descriptors to reduce the amount of generated
        code.
      - Turn SizeFor(instance) into an AllocatedSize() method.
      - Remove the special handling of resizable object sizes from Torque
        and instead overwrite AllocatedSize in classes that need special
        handling in C++.
      - Split the visitor id lists depending on whether the class has pointer
        fields.
      - Turn Torque-generated body descriptors into an .inc file to
        simplify includes.
      - Fix generated size functions to properly align the size.
      - Generate GC visitors (and C++ class definitions) for all string
        classes and FixedArray, WeakFixedArray, and WeakArrayList.
      - Store generated instance types in Torque class types. This is only
        used to determine if a type has a single instance type in this CL.
      
      Bug: v8:7793
      Change-Id: I4d362e96b047c305bd6d065247734957b8958c42
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2110014
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67542}
      f1400e43
  26. 01 May, 2020 1 commit
    • Tobias Tebbi's avatar
      [torque] avoid ambiguity if a catch catches from other handlers · 7e7b24eb
      Tobias Tebbi authored
      Torque desugars try-catch/label constructs with several handlers
      into nested try structures, with the first handler ending-up
      innermost. So currently, if you write
      
      try {
      ...
      } label Foo {
        Throw(...);
      } catch (e) {
      
      }
      
      The catch will catch the preceding Throw in another handler.
      This is different from how multiple try-catch handlers are done in
      languages like Java, where throwing from a preceding catch handler
      is not caught by a later one. To avoid this possible ambiguity, this
      CL prohibits this pattern, enforcing that a catch handler comes first,
      before any other label-handler attached to the same try.
      This way, a catch handler never catches from any other handler on the
      same try, since they have to come later.
      
      Bug: v8:7793
      Change-Id: I943f14b2393d307c4254a3fc3a78f236dbcf86df
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2169098
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarNico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#67516}
      7e7b24eb
  27. 28 Apr, 2020 1 commit
  28. 23 Apr, 2020 1 commit
  29. 07 Apr, 2020 1 commit
  30. 18 Mar, 2020 1 commit
  31. 09 Mar, 2020 1 commit
    • Tobias Tebbi's avatar
      [torque] Generate GC object visitors for Torque classes · 4f4d73f2
      Tobias Tebbi authored
      In the process:
      
      * Augment C++-generated Torque classes with SizeFor methods to
        calculate size of instances.
      
      * Add a new "@generateBodyDescriptor" annotation that causes Torque to
        generate C++ BodyDescriptors code that can be used to visit objects
        compatible with existing V8 mechanisms, e.g. GC
      
      * Fully automate C++ macro machinery so that adding non-extern Torque
        class doesn't require any C++ changes, including ensuring generation
        of instance types and proper boilerplate for validators and
        printers.
      
      * Make handling of @export a true annotation, allowing the modifier to
        be used on class declarations.
      
      * Add functionality such that classes with the @export annotation are
        available to be used from C++. Field accessors for exported classes
        are public and factory methods are generated to create instances of
        the objects from C++.
      
      * Change the Torque compiler such that Non-exported classes implicitly
        have the @generateBodyDescriptor annotation added and causes both
        verifiers and printers to be generated.
      
      * Switch non-extern Torque classes from using existing Struct-based
        machinery to being first-class classes that support more existing
        Torque class features.
      
      Change-Id: Ic60e60c2c6bd7acd57f949bce086898ad14a3b03
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2007490
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#66621}
      4f4d73f2
  32. 16 Jan, 2020 1 commit
  33. 19 Dec, 2019 1 commit
  34. 18 Dec, 2019 1 commit
    • Nico Hartmann's avatar
      [torque] Enum language feature · fdc9fade
      Nico Hartmann authored
      This CL implements enums in Torque in three steps:
      
      1.) It implements necessary changes to Torque's type system. In
      particular, the constraints on constexpr types are relaxed such that
      constexpr types can exist without a corresponding non-constexpr
      version. Furthermore, constexpr and their non-constexpr counterpart
      need not be of the same kind of type. This allows an AbstractType to
      have a UnionType as its non-constexpr counterpart.
      
      2.) The enum feature itself is realized as a pure desugaring in the
      parser, where all required types, constants and macro specializations
      (like FromConstexpr<>) are generated from a simple enum declaration,
      such that enum entries are not just constants, but are namespace
      scoped and have distinct types so that they can be used within
      typeswitch constructs.
      
      3.) Almost all of the existing constants defined in torque
      (.tq files) are ported to new enum definitions.
      
      Bug: v8:10053
      Change-Id: I72426d3b1434f301fd690847e15603de0dc1021b
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1964392
      Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65503}
      fdc9fade
  35. 17 Dec, 2019 1 commit
    • Seth Brenith's avatar
      [torque] Load and store bitfields · d5f180b7
      Seth Brenith authored
      This change implements support for reading and writing bitfields from
      Torque code, and adds a couple of unit tests for this functionality. As
      Tobias suggested, the LocationReference for a bitfield access contains
      a nested LocationReference to where the bitfield struct is stored, so
      that store operations can read the original value, update part of it,
      and write it back.
      
      Bug: v8:7793
      Change-Id: I1004a5c7fcb6cf58df5ad50109b114bf89c80efc
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1957841
      Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#65487}
      d5f180b7
  36. 16 Dec, 2019 1 commit
  37. 24 Oct, 2019 1 commit