Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.truffle.test/sl/TestDeoptInInlinedFunction.sl @ 21061:a671d592a8da
Modify semantics of StressInvokeWithExceptionNode.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 21 Apr 2015 01:27:08 +0200 |
parents | eebb05f2d1e8 |
children |
rev | line source |
---|---|
20985
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
1 /* |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
2 * This tests that simple arithmetic gets inlined. |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
3 */ |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
4 function add(a, b) { |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
5 deoptimizeWhenCompiled(a == 50); |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
6 return a + b; |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
7 } |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
8 |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
9 |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
10 function test() { |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
11 i = 0; |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
12 while (i < 100) { |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
13 i = add(i, 1); |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
14 } |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
15 return i; |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
16 } |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
17 |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
18 function main() { |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
19 waitForOptimization(callUntilOptimized(test, 1 == 2)); |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
20 test(); |
eebb05f2d1e8
Fixes for GraphPE
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
21 } |