view graal/com.oracle.truffle.sl.test/tests/DefineFunction.sl @ 15968:42eaa579e134

more improvements to runtime initialization: - replaced HotSpotSymbol with native method for reading a symbol - moved more ForeignCallDescriptors to HotSpotBackend to reduce class initialization
author Doug Simon <doug.simon@oracle.com>
date Wed, 28 May 2014 17:41:59 +0200
parents b16ec83edc73
children
line wrap: on
line source

function foo() {
  println(test(40, 2));
}

function main() {
  defineFunction("function test(a, b) { return a + b; }");
  foo();

  defineFunction("function test(a, b) { return a - b; }");
  foo();
}