comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/frame/FrameUtil.java @ 11427:51dcddfa25a6

Truffle: add Byte to Frame
author Christian Wirth <christian.wirth@oracle.com>
date Mon, 26 Aug 2013 18:25:40 +0200
parents 494b818b527c
children 269e6794e1ec
comparison
equal deleted inserted replaced
11420:7c4c1a7c875a 11427:51dcddfa25a6
38 if (slot.getKind() != FrameSlotKind.Object) { 38 if (slot.getKind() != FrameSlotKind.Object) {
39 slot.setKind(FrameSlotKind.Object); 39 slot.setKind(FrameSlotKind.Object);
40 } 40 }
41 try { 41 try {
42 frame.setObject(slot, value); 42 frame.setObject(slot, value);
43 } catch (FrameSlotTypeException e) {
44 throw new IllegalStateException();
45 }
46 }
47
48 /**
49 * Write access to a local variable of type {@code byte}.
50 *
51 * Sets the frame slot type to {@code byte} if it isn't already.
52 *
53 * @param slot the slot of the local variable
54 * @param value the new value of the local variable
55 */
56 public static void setByteSafe(Frame frame, FrameSlot slot, byte value) {
57 if (slot.getKind() != FrameSlotKind.Byte) {
58 slot.setKind(FrameSlotKind.Byte);
59 }
60 try {
61 frame.setByte(slot, value);
43 } catch (FrameSlotTypeException e) { 62 } catch (FrameSlotTypeException e) {
44 throw new IllegalStateException(); 63 throw new IllegalStateException();
45 } 64 }
46 } 65 }
47 66