Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java @ 9278:8cf939b349dd
Frame API: automatically change frame slot type for uninitialized slots
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Wed, 24 Apr 2013 14:14:22 +0200 |
parents | 07f8d136a05e |
children | 447465567e6f |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java Wed Apr 24 13:35:14 2013 +0200 +++ b/graal/com.oracle.truffle.sl/src/com/oracle/truffle/sl/nodes/WriteLocalNode.java Wed Apr 24 14:14:22 2013 +0200 @@ -38,29 +38,13 @@ @Specialization(rewriteOn = FrameSlotTypeException.class) public int write(VirtualFrame frame, int right) throws FrameSlotTypeException { - try { - frame.setInt(slot, right); - } catch (FrameSlotTypeException e) { - if (slot.getType() == null) { - FrameUtil.setIntSafe(frame, slot, right); - } else { - throw e; - } - } + frame.setInt(slot, right); return right; } @Specialization(rewriteOn = FrameSlotTypeException.class) public boolean write(VirtualFrame frame, boolean right) throws FrameSlotTypeException { - try { - frame.setBoolean(slot, right); - } catch (FrameSlotTypeException e) { - if (slot.getType() == null) { - FrameUtil.setBooleanSafe(frame, slot, right); - } else { - throw e; - } - } + frame.setBoolean(slot, right); return right; }