Mercurial > hg > truffle
comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java @ 18751:e55e18c1f40d
Truffle: add putObject to node reflection.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Mon, 29 Dec 2014 23:38:12 +0100 |
parents | 8a758dce7d80 |
children | 6ba170cb6f53 |
comparison
equal
deleted
inserted
replaced
18750:8a758dce7d80 | 18751:e55e18c1f40d |
---|---|
116 | 116 |
117 public long getOffset() { | 117 public long getOffset() { |
118 return offset; | 118 return offset; |
119 } | 119 } |
120 | 120 |
121 public void putObject(Object receiver, Object value) { | |
122 assert value == null || type.isInstance(value); | |
123 unsafe.putObject(receiver, offset, value); | |
124 } | |
125 | |
121 public Object loadValue(Node node) { | 126 public Object loadValue(Node node) { |
122 if (type == boolean.class) { | 127 if (type == boolean.class) { |
123 return unsafe.getBoolean(node, offset); | 128 return unsafe.getBoolean(node, offset); |
124 } else if (type == byte.class) { | 129 } else if (type == byte.class) { |
125 return unsafe.getByte(node, offset); | 130 return unsafe.getByte(node, offset); |