summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-11-08 18:13:08 +0000
committerPaul Phillips <paulp@improving.org>2010-11-08 18:13:08 +0000
commit942bf86c7bb28c7d9aeae82204ae060ae330d9b6 (patch)
treeb88f130c5294617439949d77858b3e4538eb223f /src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
parent8009f723b905509e9dfa22d8746787ebb0cd11a2 (diff)
downloadscala-942bf86c7bb28c7d9aeae82204ae060ae330d9b6.tar.gz
scala-942bf86c7bb28c7d9aeae82204ae060ae330d9b6.tar.bz2
scala-942bf86c7bb28c7d9aeae82204ae060ae330d9b6.zip
This is work on -Ycheck:icode.
distribution can now be built with that option, with or without optimization, and almost all tests cases can. (Those which can't are due to different -Ycheck: issues.) Major changes of interest are as follows: * LOAD_EXCEPTION and THROW are parameterized on the throwable symbol. * Does not squash all traits down to AnyRef, but instead deals with issues as they arise. By observation the cases where one needs a "Foo with Product" to manifest as both a "Foo" and a "Product" at different places are quite rare, so we need not throw out the whole baby. * Exception handlers now have positions. * The remaining checker failures removed, such as CALL_METHOD wanting to pop a value off the stack after calling a constructor. * Many multiply defined values such as REFERENCE(ObjectClass) put in one place (ICodes.scala) and reused. * -Ycheck:icode output (if also given -Ydebug) worthy of Michelangelo. Here is a class and the -Ycheck:icode -Ydebug output for f's block. class A { def f(x: Int, y: String) = try println(x + y.length) catch { case x: NullPointerException => () } } ** Checking Block 4 [S: 3, 2] [P: 1] <closed> 1-> REF(singleton class Predef) 3 + LOAD_MODULE object Predef 2-> INT 3 + LOAD_LOCAL(value x) 3-> REF(class String) 3 + LOAD_LOCAL(value y) 2<- REF(class String) 3 - CALL_METHOD java.lang.String.length (dynamic) 3-> INT 3 + CALL_METHOD java.lang.String.length (dynamic) 2<- INT 3 - CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - """ 2-> INT 3 + CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - BOX INT 2-> REF(class Integer) 3 + BOX INT 1<- REF(class Integer) 3 - CALL_METHOD scala.Predef.println (dynamic) 0<- REF(singleton class Predef) 3 - CALL_METHOD scala.Predef.println (dynamic) Review by dragos (I marked the specific spots I thought of interest with "PP to ID" which makes it sound like I'm talking to my primal self. Next week on programmer theater: "PP to SUPEREGO.")
Diffstat (limited to 'src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
index 701e5d3815..9bb704f8b7 100644
--- a/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
+++ b/src/compiler/scala/tools/nsc/backend/icode/Linearizers.scala
@@ -73,7 +73,7 @@ trait Linearizers { self: ICodes =>
case SWITCH(_, labels) =>
add(labels);
case RETURN(_) => ();
- case THROW() => ();
+ case THROW(clasz) => ();
}
}