Mercurial > hg > truffle
diff graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java @ 9258:07f8d136a05e
Truffle API changes for the Frame API. Introduction of Assumptions class.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Tue, 23 Apr 2013 15:34:06 +0200 |
parents | f07cafa29db1 |
children | cd1a1d92b3e3 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java Tue Apr 23 15:08:11 2013 +0200 +++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/FrameTest.java Tue Apr 23 15:34:06 2013 +0200 @@ -64,7 +64,7 @@ public void test() { TruffleRuntime runtime = Truffle.getRuntime(); FrameDescriptor frameDescriptor = new FrameDescriptor(); - FrameSlot slot = frameDescriptor.addFrameSlot("localVar", Integer.class); + FrameSlot slot = frameDescriptor.addFrameSlot("localVar", int.class); TestRootNode rootNode = new TestRootNode(new AssignLocal(slot), new ReadLocal(slot)); CallTarget target = runtime.createCallTarget(rootNode, frameDescriptor); Object result = target.call(); @@ -109,7 +109,11 @@ @Override int execute(VirtualFrame frame) { - frame.setInt(slot, 42); + try { + frame.setInt(slot, 42); + } catch (FrameSlotTypeException e) { + throw new IllegalStateException(e); + } return 0; } } @@ -122,7 +126,11 @@ @Override int execute(VirtualFrame frame) { - return frame.getInt(slot); + try { + return frame.getInt(slot); + } catch (FrameSlotTypeException e) { + throw new IllegalStateException(e); + } } } }