1. 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
  2. 24 May, 2018 1 commit
  3. 22 May, 2018 2 commits
  4. 18 May, 2018 1 commit
  5. 16 May, 2018 2 commits
    • Tobias Tebbi's avatar
      [torque] implement function pointers to builtins · 07f19a08
      Tobias Tebbi authored
      This CL adds the new type expression
      builtin(Context, ArgType1, ...) => ReturnType
      and allows to use Torque-defined builtins as values of this type, as well
      as calling values of this type.
      The new function pointer types are subtypes of Code.
      
      Change-Id: Ib7ba3ce6ef7a8591a4c79230dd189fd25698d5b9
      Reviewed-on: https://chromium-review.googlesource.com/1060056
      Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
      Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53217}
      07f19a08
    • Daniel Clifford's avatar
      [torque]: Implement Generics for Builtins and Macros · 3d2cb0b4
      Daniel Clifford authored
      Including specialization, e.g.:
      
        // Declare parameterized generic
        macro GenericMacroTest<T: type>(param: T): Object {
          return Undefined;
        }
      
        // Declare specialization of generic
        GenericMacroTest<Object>(param: Object): Object {
          return param;
        }
      
        ...
        assert(GenericMacroTest<Smi>(0) == Undefined);
        assert(GenericMacroTest<Smi>(1) == Undefined);
        assert(GenericMacroTest<Object>(Null) == Null);
        assert(GenericMacroTest<Object>(False) == False);
        ...
      
      Known issue: specialization doesn't rigorously checked to verify
      that specialization signature precisely matches generic declaration.
      
      Change-Id: I9d9d96da4c5c8c9a76550844680e9e133a5edaed
      Reviewed-on: https://chromium-review.googlesource.com/1043986
      Commit-Queue: Daniel Clifford <danno@chromium.org>
      Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
      Cr-Commit-Position: refs/heads/master@{#53203}
      3d2cb0b4
  6. 15 May, 2018 1 commit
  7. 13 May, 2018 2 commits