1. 13 Sep, 2018 1 commit
  2. 12 Sep, 2018 2 commits
  3. 11 Sep, 2018 2 commits
  4. 10 Sep, 2018 2 commits
  5. 06 Sep, 2018 2 commits
  6. 05 Sep, 2018 1 commit
  7. 08 Aug, 2018 1 commit
    • Tobias Tebbi's avatar
      [torque] add typeswitch statement · 91ef86f9
      Tobias Tebbi authored
      This adds a typeswitch statement
      
      typeswitch (e)
      case (x1 : Type1) {
        ...
      } case (x2 : Type2) {
      
      } ...
      ... case (xn : TypeN) {
        ...
      }
      
      This checks to which of the given types the result of evaluating e can
      be cast, in the order in which they are listed. So if an earlier
      type matches, a value of this type won't reach a later case.
      
      The type-checks are performed by calling the cast<T>() macro.
      The type of the argument passed to the cast macro is dependent on the
      case and excludes all types checked earlier. For example, in
      
      const x : Object = ...
      typeswitch (x)
      case (x : Smi) {
        ...
      } case (x : HeapNumber) {
        ...
      } case (x : HeapObject) {
        ...
      }
      
      there will be calls to cast<Smi>(Object) and
      cast<HeapNumber>(HeapObject), because after the Smi check we know that
      x has to be a HeapObject. With the refactored base.tq definition of
      cast, this will generate efficient code and avoid repeating the Smi
      check in the second case.
      
      The type system ensures that all cases are reachable and that the type
      given to the last case is safe without a runtime check (in other words,
      the union of all checked types covers the type of e).
      
      The cases can also be written as
      case (Type) { ... }
      , in which case the switched value is not re-bound with the checked
      type.
      
      Bug: v8:7793
      Change-Id: Iea4aed7465d62b445e3ae0d33f52921912e095e3
      Reviewed-on: https://chromium-review.googlesource.com/1156506
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54958}
      91ef86f9
  8. 07 Aug, 2018 2 commits
    • Tobias Tebbi's avatar
      [torque] allow overloading generic macros · 7957886b
      Tobias Tebbi authored
      Previously, we requested instantiation of generics prior to selecting
      a template overload, which resulted in unused templates being
      instantiated, possibly triggering unnecessary compile errors.
      
      Bug: v8:7793
      Change-Id: I45f4bdbf8aa93749ece416c6c7458d64e6e051f5
      Reviewed-on: https://chromium-review.googlesource.com/1154977
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54950}
      7957886b
    • Tobias Tebbi's avatar
      [torque] generate implicit_cast according to VisitResult types · 46952216
      Tobias Tebbi authored
      In the generated CSA, we called overloaded macros while relying on CSA
      subtyping of TNodes. This doesn't work well with overloads, because
      for C++ any TNode subtyping is treated as an implicit conversion, which
      makes these calls ambiguous for C++.
      As a solution, we insert implicit_cast conversions for arguments
      according to the type predicted by Torque. This way, a CSA overload is always
      called with exactly the signature declared in base.tq.
      This has the additional benefit that it validates the signatures declared in
      base.tq, which could previously be too permissive.
      Also, this triggered a bug in structs, where VisitResult's were
      carrying the wrong type.
      
      Bug: v8:7793
      TBR: danno@chromium.org
      Change-Id: I8ed4bfd04793c8a8805a4a3dd5cf2a85c20ce786
      Reviewed-on: https://chromium-review.googlesource.com/1165237
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54948}
      46952216
  9. 03 Aug, 2018 1 commit
  10. 31 Jul, 2018 1 commit
  11. 27 Jul, 2018 2 commits
  12. 25 Jul, 2018 1 commit
  13. 24 Jul, 2018 3 commits
  14. 23 Jul, 2018 1 commit
  15. 20 Jul, 2018 1 commit
  16. 19 Jul, 2018 2 commits
  17. 17 Jul, 2018 2 commits
    • Daniel Clifford's avatar
      [torque]: Implement structs · 1062ffb9
      Daniel Clifford authored
      Struct are bundles of value types. They are essentially just shorthand
      for passing around a group of individually defined values.
      
      Struct types are declared like this:
      
        struct A {
          x: Smi;
          y: int32;
        }
      
      and can be constructed explicitly like this:
      
        A{0, 0}
      
      Structs can be used wherever other types are used (e.g. variables,
      parameters, return values) except for parameter/return types of
      builtins and runtime functions.
      
      Struct use field access notation to set/get their values like this:
      
        let a: A = A{0, 0};
        let b: Smi = a.x;
        a.y = 0;
      
      Change-Id: I9fd36a6514c37882831256a49a50809c5db75b56
      Reviewed-on: https://chromium-review.googlesource.com/1122133
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54501}
      1062ffb9
    • Simon Zünd's avatar
      [torque] Add local const bindings · b95def34
      Simon Zünd authored
      This CL adds local const bindings. This means that instead of
      generating TVARIABLEs for variables, we can generate simple TNodes.
      
      Example:
      
      macro FooBar(): {
        const kSomeSmi: Smi = 10;
        ...
      }
      
      This CL also enforces that variables with a constexpr type are bound
      using 'const' and not 'let'.
      
      R=tebbi@chromium.org
      
      Bug: v8:7793
      Change-Id: Id20a18149df9fc374ce718bdb1478e3eabb6e6df
      Reviewed-on: https://chromium-review.googlesource.com/1138316
      Commit-Queue: Simon Zünd <szuend@google.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54479}
      b95def34
  18. 16 Jul, 2018 1 commit
  19. 13 Jul, 2018 1 commit
  20. 05 Jul, 2018 1 commit
    • Daniel Clifford's avatar
      [torque] Simplify handling of VisitResults · 1813e3d5
      Daniel Clifford authored
      Only pass around the unadulterated value identifier in the VisitResult class
      until the very last moment before code generation, at which point the
      declaration that was used to originally define the value is used to generate the
      correct final source code string in the context of a l-value or r-value.
      
      Bug: v8:7793
      Change-Id: Ifd0c0d245b2eb65c7f3ddb1ad4c87ee235c54a82
      Reviewed-on: https://chromium-review.googlesource.com/1125063
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54229}
      1813e3d5
  21. 03 Jul, 2018 4 commits
  22. 02 Jul, 2018 1 commit
  23. 28 Jun, 2018 1 commit
  24. 26 Jun, 2018 1 commit
  25. 22 Jun, 2018 2 commits
  26. 21 Jun, 2018 1 commit