# HG changeset patch # User Thomas Wuerthinger # Date 1397822967 -7200 # Node ID 27afd57655bab7071bf38af367510f868d3d5a94 # Parent 7aa0ef5348e526588c008a3e9c53a116d1604bc1# Parent 25a18b4a5b90ec0d7037fb69650748676ad9880a Merge. diff -r 7aa0ef5348e5 -r 27afd57655ba graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.output --- a/graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.output Fri Apr 18 14:02:40 2014 +0200 +++ b/graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.output Fri Apr 18 14:09:27 2014 +0200 @@ -0,0 +1,90 @@ +Initial stack trace: +Frame: root doIt, a=0, hello=null +Frame: root main, i=0 +After 123 assignment: +Frame: root doIt, a=0, hello=123 +Frame: root main, i=0 +After hello assignment: +Frame: root doIt, a=0, hello=world +Frame: root main, i=0 +Initial stack trace: +Frame: root doIt, a=1, hello=null +Frame: root main, i=1 +After 123 assignment: +Frame: root doIt, a=1, hello=123 +Frame: root main, i=1 +After hello assignment: +Frame: root doIt, a=1, hello=world +Frame: root main, i=1 +Initial stack trace: +Frame: root doIt, a=2, hello=null +Frame: root main, i=2 +After 123 assignment: +Frame: root doIt, a=2, hello=123 +Frame: root main, i=2 +After hello assignment: +Frame: root doIt, a=2, hello=world +Frame: root main, i=2 +Initial stack trace: +Frame: root doIt, a=3, hello=null +Frame: root main, i=3 +After 123 assignment: +Frame: root doIt, a=3, hello=123 +Frame: root main, i=3 +After hello assignment: +Frame: root doIt, a=3, hello=world +Frame: root main, i=3 +Initial stack trace: +Frame: root doIt, a=4, hello=null +Frame: root main, i=4 +After 123 assignment: +Frame: root doIt, a=4, hello=123 +Frame: root main, i=4 +After hello assignment: +Frame: root doIt, a=4, hello=world +Frame: root main, i=4 +Initial stack trace: +Frame: root doIt, a=5, hello=null +Frame: root main, i=5 +After 123 assignment: +Frame: root doIt, a=5, hello=123 +Frame: root main, i=5 +After hello assignment: +Frame: root doIt, a=5, hello=world +Frame: root main, i=5 +Initial stack trace: +Frame: root doIt, a=6, hello=null +Frame: root main, i=6 +After 123 assignment: +Frame: root doIt, a=6, hello=123 +Frame: root main, i=6 +After hello assignment: +Frame: root doIt, a=6, hello=world +Frame: root main, i=6 +Initial stack trace: +Frame: root doIt, a=7, hello=null +Frame: root main, i=7 +After 123 assignment: +Frame: root doIt, a=7, hello=123 +Frame: root main, i=7 +After hello assignment: +Frame: root doIt, a=7, hello=world +Frame: root main, i=7 +Initial stack trace: +Frame: root doIt, a=8, hello=null +Frame: root main, i=8 +After 123 assignment: +Frame: root doIt, a=8, hello=123 +Frame: root main, i=8 +After hello assignment: +Frame: root doIt, a=8, hello=world +Frame: root main, i=8 +Initial stack trace: +Frame: root doIt, a=9, hello=null +Frame: root main, i=9 +After 123 assignment: +Frame: root doIt, a=9, hello=123 +Frame: root main, i=9 +After hello assignment: +Frame: root doIt, a=9, hello=world +Frame: root main, i=9 \ No newline at end of file diff -r 7aa0ef5348e5 -r 27afd57655ba graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.sl --- a/graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.sl Fri Apr 18 14:02:40 2014 +0200 +++ b/graal/com.oracle.truffle.sl.test/tests/HelloEqualsWorld.sl Fri Apr 18 14:09:27 2014 +0200 @@ -1,14 +1,14 @@ function doIt(a) { -// println("Initial stack trace:"); -// println(stacktrace()); + println("Initial stack trace:"); + println(stacktrace()); hello = 123; -// println("After 123 assignment:"); -// println(stacktrace()); + println("After 123 assignment:"); + println(stacktrace()); -// helloEqualsWorld(); -// println("After hello assignment:"); -// println(stacktrace()); + helloEqualsWorld(); + println("After hello assignment:"); + println(stacktrace()); // readln(); } diff -r 7aa0ef5348e5 -r 27afd57655ba graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLHelloEqualsWorldBuiltin.java --- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLHelloEqualsWorldBuiltin.java Fri Apr 18 14:02:40 2014 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/builtins/SLHelloEqualsWorldBuiltin.java Fri Apr 18 14:09:27 2014 +0200 @@ -35,11 +35,11 @@ public abstract class SLHelloEqualsWorldBuiltin extends SLBuiltinNode { @Specialization - public Object change() { + public String change() { FrameInstance frameInstance = Truffle.getRuntime().getStackTrace().iterator().next(); Frame frame = frameInstance.getFrame(FrameAccess.READ_WRITE, false); FrameSlot slot = frame.getFrameDescriptor().findOrAddFrameSlot("hello"); frame.setObject(slot, "world"); - return null; + return "world"; } }