• Daniel Clifford's avatar
    [torque] Implement parameter overloading in generics · 06f2a5c2
    Daniel Clifford authored
    This allows redifinitions of generics with the same name but differing parameter
    type lists, e.g.
    
      macro coerce<Dest: type>(from: HeapObject): Dest;
      coerce<int32>(from: HeapObject): int32 {...}
      macro coerce<Dest: type>(from: Smi): Dest;
      coerce<int32>(from: Smi): int32 {...}
    
    In order to allow multiple overloads of generic macros with the same name,
    a more nuanced lookup of calls has been implemented using the
    ParameterDifference utility class. There is still work to be done to unify
    when ParameterDifference is used for lookup (e.g. removing it from operator
    lookup when operators become simple aliases for macro names), but that work
    will be done in a separate CL.
    
    As part of this CL, the custom handling of "cast<>" operator in the .g4
    grammar has been removed and replaced by a handful of equivalent overloads of
    a generic "cast" macro.
    
    Bug: v8:7793
    Change-Id: Ibb2cdd3d58632b7f7f7ba683499f9688ae07f4f8
    Reviewed-on: https://chromium-review.googlesource.com/1087873
    Commit-Queue: Daniel Clifford <danno@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#53562}
    06f2a5c2
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.editorconfig Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...