Exemplo n.º 1
0
 @Override
 public void setVirtualEntry(State objectState, int index, ValueNode value) {
   ObjectState obj = (ObjectState) objectState;
   assert obj != null && obj.isVirtual() : "not virtual: " + obj;
   ObjectState valueState = state.getObjectState(value);
   ValueNode newValue = value;
   if (valueState == null) {
     newValue = getReplacedValue(value);
     assert obj.getEntry(index) == null
         || obj.getEntry(index).kind() == newValue.kind()
         || (isObjectEntry(obj.getEntry(index)) && isObjectEntry(newValue));
   } else {
     if (valueState.getState() != EscapeState.Virtual) {
       newValue = valueState.getMaterializedValue();
       assert newValue.kind() == Kind.Object;
     } else {
       newValue = valueState.getVirtualObject();
     }
     assert obj.getEntry(index) == null || isObjectEntry(obj.getEntry(index));
   }
   obj.setEntry(index, newValue);
 }
Exemplo n.º 2
0
 @Override
 public ValueNode getMaterializedValue(ValueNode value) {
   ObjectState obj = state.getObjectState(value);
   return obj != null && !obj.isVirtual() ? obj.getMaterializedValue() : null;
 }