summaryrefslogtreecommitdiff
path: root/sources/scalac/backend
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-03-26 17:50:46 +0000
committerschinz <schinz@epfl.ch>2005-03-26 17:50:46 +0000
commita274f949c3aa9db16bd5addd0eed4f85388e74ed (patch)
tree437fff9bdb61876ccbf5fee5ef8b78ffa611f25b /sources/scalac/backend
parent9917c668018f845f55e09f74323509791063a463 (diff)
downloadscala-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/backend')
-rw-r--r--sources/scalac/backend/Primitives.java4
-rw-r--r--sources/scalac/backend/jvm/GenJVM.java4
2 files changed, 4 insertions, 4 deletions
diff --git a/sources/scalac/backend/Primitives.java b/sources/scalac/backend/Primitives.java
index 3334b35748..76869c2f78 100644
--- a/sources/scalac/backend/Primitives.java
+++ b/sources/scalac/backend/Primitives.java
@@ -467,8 +467,8 @@ public class Primitives {
Definitions defs = definitions;
// scala.Any
- addPrimitive(defs.ANY_IS, Primitive.IS);
- addPrimitive(defs.ANY_AS, Primitive.AS);
+ addPrimitive(defs.ANY_IS_ERASED, Primitive.IS);
+ addPrimitive(defs.ANY_AS_ERASED, Primitive.AS);
addPrimitive(defs.ANY_EQEQ, Primitive.EQ);
addPrimitive(defs.ANY_BANGEQ, Primitive.NE);
// !!! addPrimitive(defs.ANY_EQUALS, Primitive.EQUALS);
diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java
index 84108ed57c..9ba9b67939 100644
--- a/sources/scalac/backend/jvm/GenJVM.java
+++ b/sources/scalac/backend/jvm/GenJVM.java
@@ -299,10 +299,10 @@ public class GenJVM {
genLoadQualifier(ctx, fun);
JType type = typeStoJ(args[0].type);
- if (fun.symbol() == defs.ANY_IS) {
+ if (fun.symbol() == defs.ANY_IS_ERASED) {
ctx.code.emitINSTANCEOF((JReferenceType)type);
generatedType = JType.BOOLEAN;
- } else if (fun.symbol() == defs.ANY_AS) {
+ } else if (fun.symbol() == defs.ANY_AS_ERASED) {
ctx.code.emitCHECKCAST((JReferenceType)type);
generatedType = type;
} else