Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
11311:c08d8fd6aa19 | 11312:f0c8303cf88e |
---|---|
1 public class Test { | |
2 public static void main(String[] args) { | |
3 Test t = new Test(); | |
4 Test2 t2 = new Test2(); | |
5 for (int i = 0; i < 5000; ++i) { | |
6 test2(t2); | |
7 } | |
8 for (int i = 0; i < 100000; ++i) { | |
9 test(t); | |
10 } | |
11 } | |
12 | |
13 public static int test(Object t) { | |
14 if (t instanceof Test) { | |
15 test2(t); | |
16 } | |
17 return 3; | |
18 } | |
19 | |
20 public static int test2(Object t) { | |
21 if (t instanceof Test) { | |
22 return 1; | |
23 } | |
24 return 2; | |
25 } | |
26 } | |
27 | |
28 | |
29 class Test2 extends Test { | |
30 } |