Mercurial > hg > truffle
annotate graal/com.oracle.graal.truffle.test/sl/TestCompilationThreshold.sl @ 18985:867058575979
Truffle: Improved support for "probing" AST nodes:
- Node.isSafelyReplacaeableBy(Node) checks in advance if Node.replace(Node) would be unsafe (crash the VM).
- Hoist Probe() from language imlementations into Node; now completely language agnostic.
- Language implementations support probing by implementing Node.isInstrumentable() and Node.createWrapperNode()
- Node.Probe() throws ProbeException (without side effects) if the probe fails.
-- ProbeException contains an instance of ProbeFailure that diagnoses the failure in detail
- Additional measures to prevent instrumentation from being applied to internal InstrumentationNodes.
- Promote ProbeListener to top level interface and add a default implementation
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Tue, 27 Jan 2015 20:24:54 -0800 |
parents | 004e3f0a0517 |
children |
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 the compilation threshold property. |
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 test() { |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
5 } |
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 function main() { |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
8 /* TODO disableSplitting is required because otherwise it needs more calls to warm up. This still needs to be fixed. */ |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
9 disableSplitting(test); |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
10 threshold = getOption("TruffleCompilationThreshold"); |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
11 i = 0; |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
12 while (i < threshold -1) { |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
13 test(); |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
14 i = i + 1; |
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 assertFalse(isOptimized(waitForOptimization(test))); |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
17 test(); // triggers compilation |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
18 assertTrue(isOptimized(waitForOptimization(test))); |
004e3f0a0517
Truffle: added new infrastructure for graal truffle runtime tests using SL.
Christian Humer <christian.humer@gmail.com>
parents:
diff
changeset
|
19 } |