Mercurial > hg > truffle
annotate graal/com.oracle.truffle.sl.test/tests/FunctionLiteral.sl @ 13951:392b6ac8da36
Allow using run_java without the arguments from -J -Ja -Jp. Factor out the argument processing of mx_graal.vm and use it to pass tested-vm args down through the jmh harness
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Thu, 13 Feb 2014 17:59:27 +0100 |
parents | ff3136ecb5a7 |
children |
rev | line source |
---|---|
13883
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
1 function add(a, b) { |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
2 return a + b; |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
3 } |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
4 |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
5 function sub(a, b) { |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
6 return a - b; |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
7 } |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
8 |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
9 function foo(f) { |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
10 println(f(40, 2)); |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
11 } |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
12 |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
13 function main() { |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
14 foo(add); |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
15 foo(sub); |
ff3136ecb5a7
SL: small changes
Christian Wimmer <christian.wimmer@oracle.com>
parents:
diff
changeset
|
16 } |