public VMSlot GetValue(VMContext ctx, PointerType type) { var inst = instance; if (field.DeclaringType.IsValueType && instance is IReference) { inst = ((IReference)instance).GetValue(ctx, PointerType.OBJECT).ToObject(field.DeclaringType); } return(VMSlot.FromObject(field.GetValue(inst), field.FieldType)); }
public unsafe void SetValue(VMContext ctx, VMSlot slot, PointerType type) { if (field.DeclaringType.IsValueType && instance is IReference) { TypedReference typedRef; ((IReference)instance).ToTypedReference(ctx, &typedRef, field.DeclaringType); field.SetValueDirect(typedRef, slot.ToObject(field.FieldType)); } else { field.SetValue(instance, slot.ToObject(field.FieldType)); } }
public VMSlot GetValue(VMContext ctx, PointerType type) { TypedReference typedRef; if (_ptr != null) { *&typedRef = *(TypedReference *)_ptr.Value; } else { *(PseudoTypedRef *)&typedRef = _typedRef; } return(VMSlot.FromObject(TypedReference.ToObject(typedRef), __reftype(typedRef))); }
public void SetValue(VMContext ctx, VMSlot slot, PointerType type) { if (type == PointerType.BYTE) { slot.U8 = slot.U1; } else if (type == PointerType.WORD) { slot.U8 = slot.U2; } else if (type == PointerType.DWORD) { slot.U8 = slot.U4; } ctx.Stack[StackPos] = slot; }
public void SetValue(VMContext ctx, VMSlot slot, PointerType type) { TypedReference typedRef; if (_ptr != null) { *&typedRef = *(TypedReference *)_ptr.Value; } else { *(PseudoTypedRef *)&typedRef = _typedRef; } var refType = __reftype(typedRef); var value = slot.ToObject(refType); TypedReferenceHelpers.SetTypedRef(value, &typedRef); }
public void SetValue(VMContext ctx, VMSlot slot, PointerType type) { throw new NotSupportedException(); }