1. 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
  2. 05 Aug, 2020 2 commits
  3. 03 Aug, 2020 1 commit
  4. 27 Jul, 2020 1 commit
  5. 16 Jul, 2020 1 commit
  6. 10 Jul, 2020 1 commit
  7. 03 Jul, 2020 1 commit
  8. 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
  9. 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
  10. 12 May, 2020 1 commit
  11. 07 May, 2020 1 commit
  12. 06 May, 2020 1 commit
  13. 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
  14. 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
  15. 28 Apr, 2020 1 commit
  16. 23 Apr, 2020 1 commit
  17. 07 Apr, 2020 1 commit
  18. 18 Mar, 2020 1 commit
  19. 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
  20. 16 Jan, 2020 1 commit
  21. 19 Dec, 2019 1 commit
  22. 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
  23. 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
  24. 16 Dec, 2019 1 commit
  25. 24 Oct, 2019 1 commit
  26. 30 Aug, 2019 1 commit
    • Georg Schmid's avatar
      [torque] Add HeapSlice location references to Torque · cbf01502
      Georg Schmid authored
      This CL adds a LocationReference specifically for slices to Torque. This allows us to safely reference arrays in objects and pass around such references. For an array of T-typed elements, referencing yields a Slice<T>. In addition, the traditional element access syntax ('o.array[i]') now internally produces a slice, indexes it at 'i' and dereferences the resulting HeapReference.
      
      Bug: v8:7793
      Change-Id: I4af58e4d2feac547c55a1f6f9350a6c510383df2
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1771782
      Commit-Queue: Georg Schmid <gsps@google.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63479}
      cbf01502
  27. 26 Aug, 2019 1 commit
    • Tobias Tebbi's avatar
      Reland "[torque] introduce JSAny type for user-accessible JavaScript values" · 1ef99b93
      Tobias Tebbi authored
      Changes in the reland: Rebased and added a check that JavaScript-linkage
      builtins use JSAny in parameters and return type, plus the necessary
      cleanups for this test to pass.
      
      Design Doc: https://docs.google.com/document/d/1z6j0pWHnNIfId0v00uWN2HBrGRDJxJfYuCr5K7Kr1xA
      
      This reverts commit 4418a7b9.
      
      Original change's description:
      > Revert "[torque] introduce JSAny type for user-accessible JavaScript values"
      >
      > This reverts commit 79b00555.
      >
      > Reason for revert: needs more discussion
      >
      > Original change's description:
      > > [torque] introduce JSAny type for user-accessible JavaScript values
      > >
      > > This CL introduces a JSAny type for user-exposed JavaScript values and
      > > a few new types to define it. Especially, it splits Symbol into
      > > PrivateSymbol (not exposed) and PublicSymbol (JavaScript exposed
      > > symbols).
      > >
      > > The change is mostly mechanical, but a few things are interesting:
      > > - PropertyKey and JSPrimitive were designed to coincide with the spec
      > >   notions of IsPropertyKey() and primitive value, respectively.
      > > - Since Name is an open type, we define AnyName to be the known
      > >   subtypes of Name. This is not too elegant, but by using AnyName
      > >   instead of Name, typeswitch can properly conclude something if a
      > >   subtype of Name is excluded.
      > >
      > > Small drive-by changes, which were necessary:
      > > - Allow subtyping on label parameters.
      > > - Fix the formatting of typeswitch, it was broken with union types
      > >   in case types.
      > >
      > > Bug: v8:7793
      > > Change-Id: I14b10507f8cf316ad85e048fe8d53d1df5e0bb13
      > > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1735322
      > > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      > > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > > Cr-Commit-Position: refs/heads/master@{#63114}
      >
      > TBR=neis@chromium.org,jgruber@chromium.org,tebbi@chromium.org
      >
      > Change-Id: Ifde7881d74afe407628f40047997339d54cb2424
      > No-Presubmit: true
      > No-Tree-Checks: true
      > No-Try: true
      > Bug: v8:7793
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1741652
      > Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
      > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63115}
      
      TBR=neis@chromium.org,jgruber@chromium.org,tebbi@chromium.org
      
      # Not skipping CQ checks because original CL landed > 1 day ago.
      
      Bug: v8:7793
      Change-Id: Icca34e3824f55009b984d9348fd21884400f0081
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1769316
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63395}
      1ef99b93
  28. 23 Aug, 2019 1 commit
  29. 21 Aug, 2019 1 commit
    • Georg Schmid's avatar
      [torque] Add user-defined Slice struct · 26e39d12
      Georg Schmid authored
      This CL consists of several preparatory steps for slices in Torque. Above all, it introduces a user-defined struct, torque_internal::Slice<T>, that performs bounds checking and returns references to elements in arrays. To enable this, several smaller changes were also made:
      
      - Constructors of internal classes such as torque_internal::Reference<T> now require a special 'Unsafe' argument, making it clear that there be dragons.
      - Struct methods are now declared during finalization. This allows instances of generic structs to have methods referring to the same struct. Previously, methods would be declared before the instance had been fully registered, leading to errors during type resolution. Furthermore, such methods were declared in a temporary namespace, that would then erroneously escape and lead to use-after-free issues.
      - Instances of TypeArgumentInference were not running in the correct (Torque) scopes, leading to type resolution errors.
      - The chain of ContextualVariable::Scope for any given ContextualVariable (such as CurrentScope) can now be walked, simplifying debugging.
      
      R=jgruber@chromium.org, tebbi@chromium.org
      
      Bug: v8:7793
      Change-Id: I36f808f63cc3ce441062dfc56f511f24f1e3121e
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1758322
      Commit-Queue: Georg Schmid <gsps@google.com>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63314}
      26e39d12
  30. 12 Aug, 2019 1 commit
  31. 07 Aug, 2019 2 commits
    • Tobias Tebbi's avatar
      Revert "[torque] introduce JSAny type for user-accessible JavaScript values" · 4418a7b9
      Tobias Tebbi authored
      This reverts commit 79b00555.
      
      Reason for revert: needs more discussion
      
      Original change's description:
      > [torque] introduce JSAny type for user-accessible JavaScript values
      > 
      > This CL introduces a JSAny type for user-exposed JavaScript values and
      > a few new types to define it. Especially, it splits Symbol into
      > PrivateSymbol (not exposed) and PublicSymbol (JavaScript exposed
      > symbols).
      > 
      > The change is mostly mechanical, but a few things are interesting:
      > - PropertyKey and JSPrimitive were designed to coincide with the spec
      >   notions of IsPropertyKey() and primitive value, respectively.
      > - Since Name is an open type, we define AnyName to be the known
      >   subtypes of Name. This is not too elegant, but by using AnyName
      >   instead of Name, typeswitch can properly conclude something if a
      >   subtype of Name is excluded.
      > 
      > Small drive-by changes, which were necessary:
      > - Allow subtyping on label parameters.
      > - Fix the formatting of typeswitch, it was broken with union types
      >   in case types.
      > 
      > Bug: v8:7793
      > Change-Id: I14b10507f8cf316ad85e048fe8d53d1df5e0bb13
      > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1735322
      > Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      > Reviewed-by: Jakob Gruber <jgruber@chromium.org>
      > Cr-Commit-Position: refs/heads/master@{#63114}
      
      TBR=neis@chromium.org,jgruber@chromium.org,tebbi@chromium.org
      
      Change-Id: Ifde7881d74afe407628f40047997339d54cb2424
      No-Presubmit: true
      No-Tree-Checks: true
      No-Try: true
      Bug: v8:7793
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1741652Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63115}
      4418a7b9
    • Tobias Tebbi's avatar
      [torque] introduce JSAny type for user-accessible JavaScript values · 79b00555
      Tobias Tebbi authored
      This CL introduces a JSAny type for user-exposed JavaScript values and
      a few new types to define it. Especially, it splits Symbol into
      PrivateSymbol (not exposed) and PublicSymbol (JavaScript exposed
      symbols).
      
      The change is mostly mechanical, but a few things are interesting:
      - PropertyKey and JSPrimitive were designed to coincide with the spec
        notions of IsPropertyKey() and primitive value, respectively.
      - Since Name is an open type, we define AnyName to be the known
        subtypes of Name. This is not too elegant, but by using AnyName
        instead of Name, typeswitch can properly conclude something if a
        subtype of Name is excluded.
      
      Small drive-by changes, which were necessary:
      - Allow subtyping on label parameters.
      - Fix the formatting of typeswitch, it was broken with union types
        in case types.
      
      Bug: v8:7793
      Change-Id: I14b10507f8cf316ad85e048fe8d53d1df5e0bb13
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1735322
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63114}
      79b00555
  32. 05 Aug, 2019 1 commit
  33. 02 Aug, 2019 1 commit
    • Georg Schmid's avatar
      [torque] Infer type arguments of generic struct initializers · b1db8d84
      Georg Schmid authored
      Previously when creating a new generic struct, one had to explicitly provide all type arguments, e.g., for the generic struct
      
        struct Box<T: type> {
          const value: T;
        }
      
      one would initialize a new box using
      
        const aSmi: Smi = ...;
        const box = Box<Smi> { value: aSmi };
      
      With the additions in this CL the explicit type argument can be omitted. Type inference proceeds analogously to specialization of generic callables.
      
      Additionally, this CL slightly refactors class and struct initialization, and make type inference more permissive in the presence of unsupported type constructors (concretely, union types and function types).
      
      R=jgruber@chromium.org, tebbi@chromium.org
      
      Change-Id: I529be5831a85d317d8caa6cb3a0ce398ad578c86
      Bug: v8:7793
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1728617
      Commit-Queue: Georg Schmid <gsps@google.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#63036}
      b1db8d84
  34. 31 Jul, 2019 1 commit
  35. 30 Jul, 2019 1 commit
  36. 26 Jul, 2019 1 commit
  37. 23 Jul, 2019 1 commit
    • Georg Schmid's avatar
      [torque] Add Generic Structs · 1d9a5d88
      Georg Schmid authored
      This CL introduces generic Torque structs. Generics are grounded early in the Torque compilation pipeline, meaning that every instantiation of a generic struct with concrete types will be turned into a distinct StructType.
      
      As an example, consider a Tuple of types T1, T2:
      
        struct Tuple<T1: type, T2: type> {
          const fst: T1;
          const snd: T2;
        }
      
      which can be manipulated using generic macros, such as
      
        macro Swap<T1: type, T2: type>(tuple: Tuple<T1, T2>): Tuple<T2, T1> {
          return Tuple<T2, T1>{fst: tuple.snd, snd: tuple.fst};
        }
      
      Currently there is no type inference for struct instantiation sites, so type arguments have to be provided explicitly:
      
        const intptrAndSmi = Tuple<intptr, Smi>{fst: 1, snd: 2};
      
      R=sigurds@chromium.org, tebbi@chromium.org
      
      Change-Id: I43111561cbe53144db473dc844a478045644ef6c
      Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1714868
      Commit-Queue: Georg Schmid <gsps@google.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#62878}
      1d9a5d88