summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorschinz <schinz@epfl.ch>2005-03-25 15:06:21 +0000
committerschinz <schinz@epfl.ch>2005-03-25 15:06:21 +0000
commit90b4dc0509d7e789619ec127056fb535865e1196 (patch)
treea143f9e9ed7f7646e7c0354b8c425f76b3966433 /sources
parent424f8b40d525b05e88f88719ec4aceb5ce147431 (diff)
downloadscala-90b4dc0509d7e789619ec127056fb535865e1196.tar.gz
scala-90b4dc0509d7e789619ec127056fb535865e1196.tar.bz2
scala-90b4dc0509d7e789619ec127056fb535865e1196.zip
- added statistics
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/Type.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/scala/Type.java b/sources/scala/Type.java
index 26666d59f9..a077f3b563 100644
--- a/sources/scala/Type.java
+++ b/sources/scala/Type.java
@@ -25,6 +25,7 @@ import scala.runtime.types.TypeAll;
import scala.runtime.types.TypeAllRef;
import scala.runtime.types.TypeAny;
import scala.runtime.types.TypeAnyVal;
+import scala.runtime.types.Statistics;
import scala.runtime.FNV_Hash;
import scala.runtime.PearsonHash;
@@ -37,6 +38,10 @@ import scala.runtime.PearsonHash;
*/
abstract public class Type implements java.io.Serializable {
+ public Type() {
+ assert Statistics.incInstances(getClass().getName());
+ }
+
/** @meta method [?T](scala.Int) scala.Array[?T]; */
abstract public Array newArray(int size);
@@ -67,6 +72,8 @@ abstract public class Type implements java.io.Serializable {
* asInstanceOf operation).
*/
public Object cast(Object o) {
+ assert Statistics.incTypeCast();
+ assert (o == null) || Statistics.decInstanceOf();
if (! (o == null || isInstance(o)))
throw new ClassCastException("\n" + ((ScalaObject)o).getType() + "\n" + this.toString());
return o;