diff options
author | schinz <schinz@epfl.ch> | 2005-03-26 17:50:46 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2005-03-26 17:50:46 +0000 |
commit | a274f949c3aa9db16bd5addd0eed4f85388e74ed (patch) | |
tree | 437fff9bdb61876ccbf5fee5ef8b78ffa611f25b /sources/scalac/symtab | |
parent | 9917c668018f845f55e09f74323509791063a463 (diff) | |
download | scala-a274f949c3aa9db16bd5addd0eed4f85388e74ed.tar.gz scala-a274f949c3aa9db16bd5addd0eed4f85388e74ed.tar.bz2 scala-a274f949c3aa9db16bd5addd0eed4f85388e74ed.zip |
- introduced isInstanceOf$erased and asInstance...
- introduced isInstanceOf$erased and asInstanceOf$erased methods, which
work on the erased types; things to note:
* before TypesAsValues phase, either variant can be used, although
the erased ones need to be used with caution, when speed
matters;
* after TypesAsValues phase, only the erased variants should be
used (done automatically by TreeGen);
* when run time types are disabled, the TypesAsValues phase is not
skipped anymore: it is turned into a trivial phase which
rewrites all non-erased instanceof/casts into erased ones.
Diffstat (limited to 'sources/scalac/symtab')
-rw-r--r-- | sources/scalac/symtab/Definitions.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sources/scalac/symtab/Definitions.java b/sources/scalac/symtab/Definitions.java index a5b3951ac8..6dda72353e 100644 --- a/sources/scalac/symtab/Definitions.java +++ b/sources/scalac/symtab/Definitions.java @@ -320,7 +320,9 @@ public class Definitions { public final Symbol ANY_TOSTRING; //public final Symbol ANY_PLUS; public final Symbol ANY_IS; + public final Symbol ANY_IS_ERASED; public final Symbol ANY_AS; + public final Symbol ANY_AS_ERASED; public final Symbol ANY_MATCH; //######################################################################## @@ -815,7 +817,9 @@ public class Definitions { ANY_TOSTRING = newMethod(ANY_CLASS,Names.toString ,0); // ANY_PLUS = newMethod(ANY_CLASS,Names.PLUS ,Modifiers.FINAL); ANY_IS = newMethod(ANY_CLASS,Names.isInstanceOf,Modifiers.FINAL); + ANY_IS_ERASED= newMethod(ANY_CLASS,Names.isInstanceOfE,Modifiers.FINAL); ANY_AS = newMethod(ANY_CLASS,Names.asInstanceOf,Modifiers.FINAL); + ANY_AS_ERASED= newMethod(ANY_CLASS,Names.asInstanceOfE,Modifiers.FINAL); ANY_MATCH = newMethod(ANY_CLASS,Names._match ,Modifiers.FINAL); initMethod(ANY_EQEQ , new Type[]{ANY_TYPE()} , boolean_TYPE()); @@ -827,9 +831,17 @@ public class Definitions { Symbol[] ANY_IS_TPARAMS = {newTParam(ANY_IS, 0, ANY_TYPE())}; ANY_IS.setInfo(Type.PolyType(ANY_IS_TPARAMS, boolean_TYPE())); + Symbol[] ANY_IS_ERASED_TPARAMS = + {newTParam(ANY_IS_ERASED, 0, ANY_TYPE())}; + ANY_IS_ERASED.setInfo(Type.PolyType(ANY_IS_ERASED_TPARAMS, + boolean_TYPE())); Symbol[] ANY_AS_TPARAMS = {newTParam(ANY_AS, 0, ANY_TYPE())}; ANY_AS.setInfo(Type.PolyType(ANY_AS_TPARAMS,ANY_AS_TPARAMS[0].type())); + Symbol[] ANY_AS_ERASED_TPARAMS = + {newTParam(ANY_AS_ERASED, 0, ANY_TYPE())}; + ANY_AS_ERASED.setInfo(Type.PolyType(ANY_AS_ERASED_TPARAMS, + ANY_AS_ERASED_TPARAMS[0].type())); Symbol[] ANY_MATCH_TPARAMS = { newTParam(ANY_MATCH, 0, ANY_TYPE()), |