annotate graal/com.oracle.graal.truffle.test/sl/TestInliningMaxCallerSize.sl @ 19960:999430bcc941

Small fix for memory schedule verification. The begin node is not always the first node in the block if it is at the same time also the end node.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 19 Mar 2015 15:38:33 +0100
parents 04d6bb76cfb3
children bb7e95512781
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17007
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
1 /*
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
2 * This test verifies that CallTargets cannot exceed the TruffleInliningMaxCallerSize limit when inlining.
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
3 */
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
4 function inlinableFunction() {
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
5 generateDummyNodes(getOption("TruffleInliningMaxCallerSize") - 8);
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
6 }
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
7
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
8 function notInlinableFunction() {
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
9 generateDummyNodes(getOption("TruffleInliningMaxCallerSize") - 7);
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
10 }
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
11
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
12 function test1() {
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
13 inlinableFunction();
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
14 }
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
15
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
16 function test2() {
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
17 notInlinableFunction();
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
18 }
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
19
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
20 function main() {
17370
5c06895b1aec sl inlining test: override default setting for max caller size to a smaller value
Bernhard Urban <bernhard.urban@jku.at>
parents: 17257
diff changeset
21 originalMaxCallerSize = getOption("TruffleInliningMaxCallerSize");
5c06895b1aec sl inlining test: override default setting for max caller size to a smaller value
Bernhard Urban <bernhard.urban@jku.at>
parents: 17257
diff changeset
22 setOption("TruffleInliningMaxCallerSize", 20);
17405
04d6bb76cfb3 Truffle: update callUntilOptimized to wait for the compilation and call it once optimized.
Christian Humer <christian.humer@gmail.com>
parents: 17399
diff changeset
23 callUntilOptimized(test1);
17257
f735aa886cf6 Truffle: add new inlining tests; adapt tests for context sensitive inlining.
Christian Humer <christian.humer@gmail.com>
parents: 17007
diff changeset
24 assertTrue(isInlined(test1, test1, inlinableFunction), "inlinableFunction is not inlined");
17007
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
25
17405
04d6bb76cfb3 Truffle: update callUntilOptimized to wait for the compilation and call it once optimized.
Christian Humer <christian.humer@gmail.com>
parents: 17399
diff changeset
26 callUntilOptimized(test2);
17399
5787218bad91 Truffle: implemented recursive node iterator and node streams for the graal runtime.
Christian Humer <christian.humer@gmail.com>
parents: 17370
diff changeset
27 assertFalse(isInlined(test2, test2, notInlinableFunction), "notInlinableFunction is inlined");
17370
5c06895b1aec sl inlining test: override default setting for max caller size to a smaller value
Bernhard Urban <bernhard.urban@jku.at>
parents: 17257
diff changeset
28 setOption("TruffleInliningMaxCallerSize", originalMaxCallerSize);
17007
004e3f0a0517 Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff changeset
29 }