Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
        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)));
        }
Exemplo n.º 4
0
 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;
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 public void SetValue(VMContext ctx, VMSlot slot, PointerType type)
 {
     throw new NotSupportedException();
 }