• 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
Name
Last commit
Last update
..
benchmarks Loading commit data...
cctest Loading commit data...
common Loading commit data...
debugger Loading commit data...
fuzzer Loading commit data...
inspector Loading commit data...
intl Loading commit data...
js-perf-test Loading commit data...
memory Loading commit data...
message Loading commit data...
mjsunit Loading commit data...
mkgrokdump Loading commit data...
mozilla Loading commit data...
preparser Loading commit data...
test262 Loading commit data...
torque Loading commit data...
unittests Loading commit data...
wasm-spec-tests Loading commit data...
webkit Loading commit data...
BUILD.gn Loading commit data...