1. 27 Nov, 2018 1 commit
  2. 19 Nov, 2018 1 commit
  3. 14 Nov, 2018 1 commit
  4. 13 Nov, 2018 1 commit
  5. 09 Nov, 2018 1 commit
  6. 05 Nov, 2018 2 commits
    • Tobias Tebbi's avatar
      [torque] allow qualified access to different modules/namespaces · ece9156c
      Tobias Tebbi authored
      This introduces a new syntax for identifiers and calls: modulename::foo.
      Such a name is resolved by trying to find a module modulename in one of
      the parent scopes and looking for foo there. So this roughly corresponds
      to C++ qualified namespace lookup.
      
      Bug: v8:7793
      Change-Id: Iedc43e6ebe125cd74575cbbcbf990bbcc0155a1f
      Reviewed-on: https://chromium-review.googlesource.com/c/1309818
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57238}
      ece9156c
    • Tobias Tebbi's avatar
      [torque] cleanup generics and scopes · 06c8ce59
      Tobias Tebbi authored
      - Name lookup in module scopes has namespace semantics now: All
        overloads from all parent modules are combined before overload
        resolution.
      - Allow overloads of different callables: runtime-functions,
        macros, builtins, and generics.
      - The duplication between the DeclarationVisitor and the
        ImplementationVisitor is removed: The DeclarationVisitor creates
        declarables for everything except for implicit generic specializations.
        The ImplementationVisitor iterates over declarables.
        The DeclarationVisitor only looks at the header of declarations, not
        at the body.
      - Modules become Declarable's, which will enable them to be nested.
      - Modules replace the existing Scope chain mechanism, which will make it
        easier to inline macros.
      - The DeclarationVisitor and Declarations become stateless. All state is
        moved to contextual variables and the GlobalContext.
      - Implicit specializations are created directly from the
        ImplementationVisitor. This will enable template parameter inference.
      - As a consequence, the list of all builtins is only available after the
        ImplementationVisitor has run. Thus GenerateBuiltinDefinitions has to
        move to the ImplementationVisitor. Also, this makes it necessary to
        resolve the link from function pointer types to example builtins only
        at this point.
      
      
      Bug: v8:7793
      Change-Id: I61cef2fd3e954ab148c252974344a6e38ee2d01d
      Reviewed-on: https://chromium-review.googlesource.com/c/1304294
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#57231}
      06c8ce59
  7. 31 Oct, 2018 4 commits
  8. 24 Oct, 2018 1 commit
  9. 08 Oct, 2018 1 commit
    • Daniel Clifford's avatar
      [torque] Allow atomarStatements in otherwise statements · 6f5600e2
      Daniel Clifford authored
      In the process:
      - Convert TryLabelStatements into TryLabelExpressions
      - Change TryLabelExpressions to support only single label blocks and de-sugar
        try/labels into nested try/label statements. This allows the code in a label
        block to goto subsequent labels in the same try/label statement.
      - Make otherwise expressions either take IdentifierExpressions which get
        converted into simple label names OR atomarStatements, which make useful
        non-label operations, like 'break' and 'continue', useful together with
        otherwise. Non-label otherwise statements get de-sugared into try/label
        blocks.
      
      Bug: v8:7793
      Change-Id: Ie56ede6306e2a3182f6aa1bb8750ed418bda01db
      Reviewed-on: https://chromium-review.googlesource.com/c/1266997
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56447}
      6f5600e2
  10. 04 Oct, 2018 1 commit
  11. 24 Sep, 2018 1 commit
    • Daniel Clifford's avatar
      [torque] Improve formatting in format-torque · f088840a
      Daniel Clifford authored
      Issues/problems addressed:
      
      - Fix line-wrapping and indenting for long declarations including strings,
        e.g. generates and constexpr clauses.
      - Implement proper formatting for typeswitch statements
      - Fix formatting of operator declarations
      - Fix formatting of constexpr if-clauses (the constexpr is now included on the
        same line as the if and it doesn't mess up the formatting that
      - Fix formatting of label declarations on callables, the "label" keyword now
        always starts a new line with indentation.
      - Remove space after identifier name in generic parameter declarations, e.g.
        "<a : T>" is now "<a: T>" which is consistent with type specification
        formatting elsewhere.
      - Indent "otherwise" clauses that have been pushed to the next line.
      
      Also ran the formatter over all existing .tq files.
      
      Bug: v8:7793
      Change-Id: I5adbb2ffa3d573deed062f9a5c1da57348c8fc71
      Reviewed-on: https://chromium-review.googlesource.com/1238580
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#56158}
      f088840a
  12. 11 Sep, 2018 1 commit
  13. 10 Sep, 2018 1 commit
    • Tobias Tebbi's avatar
      [torque] disallow using logical operators in value contexts · e569438b
      Tobias Tebbi authored
      This CL makes sure, that logical operators (||, &&) always have return
      type never. Together with a check that never is never passed as a
      function argument, this prevents faulty evaluation as in !(x || y).
      
      Before, the logical operators had a behavior similar to
      (bool labels Taken, NotTaken), with a fast exit if the left-hand side
      allowed shor-circuit evaluation, but returning the right-hand side
      otherwise. Since we want to allow existing (a || b || c) patterns in
      the codebase, this requires weakening the restriction that the left-
      and right-hand side need to have the same type. Now the possibilites
      are:
      bool, never
      never, bool
      never, never
      bool, bool
      constexpr bool, constexpr bool
      
      Bug: v8:8137
      Change-Id: I9576b337dc4008ac58b4625e77fef4e73bcdd6e3
      Reviewed-on: https://chromium-review.googlesource.com/1215162Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#55750}
      e569438b
  14. 13 Aug, 2018 1 commit
  15. 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
  16. 07 Aug, 2018 1 commit
  17. 03 Aug, 2018 1 commit
  18. 31 Jul, 2018 1 commit
  19. 27 Jul, 2018 2 commits
  20. 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
  21. 13 Jul, 2018 1 commit
  22. 03 Jul, 2018 1 commit
    • Tobias Tebbi's avatar
      [torque] fix variables, returns and conditionals with constexpr · 81186ff4
      Tobias Tebbi authored
      Variables/return values with constexpr type cannot have multiple
      assignments. We check this now.
      For conditionals, it is important to always infer a non-constexpr type.
      This CL adds the ability to map any type (including union types) to be
      mapped to their non-constexpr variant. Conditionals infer their type as
      the non-constexpr version of a combination of the two branch types.
      
      In addition, this improves subtyping for constexpr types:
      If A extends B, then constexpr A extends constexpr B.
      This makes it necessary to clean up "constexpr String", which has nothing
      to do with tagged values.
      
      Bug: v8:7793
      Change-Id: Ia4d3cd5dc98f45b0ec89adf05c5c6111a0e51cc6
      Reviewed-on: https://chromium-review.googlesource.com/1122864
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#54167}
      81186ff4
  23. 28 Jun, 2018 1 commit
  24. 25 Jun, 2018 1 commit
  25. 13 Jun, 2018 1 commit
  26. 12 Jun, 2018 1 commit
    • Daniel Clifford's avatar
      [torque] Turn implicit converts/unsafe_casts into generics · bbbfd81c
      Daniel Clifford authored
      In the process:
        - Add strict ordering of Types so that name mangling is consistent
          and build time. Previously, the UnionType stored the union's
          types in a std::set<const Type*>, which did not have a consistent
          ordering of the types in the set.
        - Add a int31 type to enable consistency and correctness of
          handling of 'constexpr int31' values on the C++ side.
        - By removing the "implicit" keyword for operators, there is now
          one less difference between operators and calls, another
          incremental step in unifying operators and calls.
        - Enable external (i.e. C++-defined) generic specializations
        - Add CSA support for checking double ElementsKinds, including
          tests.
        - Clean up some constexpr/non-constexpr handling of ElementsKinds.
      
      Bug: v8:7793
      Change-Id: I27699aba70b98ebf5466e5b62b045d7b1dad62c8
      Reviewed-on: https://chromium-review.googlesource.com/1091155
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53664}
      bbbfd81c
  27. 05 Jun, 2018 2 commits
  28. 29 May, 2018 1 commit
    • Simon Zünd's avatar
      [torque] Add unsafe cast to Torque. · 9ef4df2f
      Simon Zünd authored
      This CL is a proposal to add "checked" casts (CAST in CSA) to the Torque language.
      The CL adds the "unsafe_cast<>" operator that emits a "CAST".
      
      Example:
      
      let n: Number = ...;
      ...
      if (TaggedIsSmi(n)) {
        let m: Smi = unsafe_cast<Smi>(n);
        ...
      }
      
      The cast wont incur a runtime overhead now.
      
      R=tebbi@chromium.org
      
      Change-Id: I9fca90d1d11e61617ba0270e5022fd66200e2195
      Reviewed-on: https://chromium-review.googlesource.com/1070151
      Commit-Queue: Simon Zünd <szuend@google.com>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53416}
      9ef4df2f
  29. 24 May, 2018 1 commit
  30. 22 May, 2018 2 commits
  31. 18 May, 2018 1 commit
  32. 16 May, 2018 1 commit