diff Test.java @ 11312:f0c8303cf88e

Restructure Truffle API node intrinsics and introduce new intrinsics for type system modelling.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 16 Aug 2013 01:09:03 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Test.java	Fri Aug 16 01:09:03 2013 +0200
@@ -0,0 +1,30 @@
+public class Test {
+   public static void main(String[] args) {
+      Test t = new Test();
+      Test2 t2 = new Test2();
+      for (int i = 0; i < 5000; ++i) {
+	      test2(t2);
+      }
+      for (int i = 0; i < 100000; ++i) {
+	      test(t);
+      }
+   }
+
+   public static int test(Object t) {
+      if (t instanceof Test) {
+          test2(t);
+      }
+      return 3;
+   }
+
+   public static int test2(Object t) {
+         if (t instanceof Test) {
+             return 1;
+         }
+         return 2;
+   }
+}
+
+
+class Test2 extends Test {
+}