view graal/com.oracle.truffle.sl.test/tests/DefineFunction.sl @ 15481:09d721bcffe2

Introduce API for lookup of VM-internals of method handles
author Christian Wimmer <christian.wimmer@oracle.com>
date Fri, 02 May 2014 11:04:51 -0700
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();
}