Exemplo n.º 1
0
 public unsafe void ToTypedReferenceObject(TypedRefPtr typedRef, Type type)
 {
     if (this.o is ValueType && type.IsValueType)
     {
         TypedReferenceHelpers.UnboxTypedRef(this.o, typedRef);
     }
     else
     {
         *(TypedReference *)typedRef = __makeref(this.o);
     }
 }
Exemplo n.º 2
0
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     if (this._ptr != null)
     {
         *(TypedReference *)typedRef = *(TypedReference *)this._ptr.Value;
     }
     else
     {
         *(PseudoTypedRef *)typedRef = this._typedRef;
     }
 }
Exemplo n.º 3
0
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     if (_ptr != null)
     {
         *(TypedReference *)typedRef = *(TypedReference *)_ptr.Value;
     }
     else
     {
         *(PseudoTypedRef *)typedRef = _typedRef;
     }
 }
Exemplo n.º 4
0
 public void ToTypedReference(uint pos, TypedRefPtr typedRef, Type type)
 {
     if(pos > topPos)
         throw new ExecutionEngineException();
     var section = sections[(int) (pos >> SectionSize)];
     var index = pos & IndexMask;
     if(type.IsEnum)
         type = Enum.GetUnderlyingType(type);
     if(type.IsPrimitive || type.IsPointer)
     {
         section[index].ToTypedReferencePrimitive(typedRef);
         TypedReferenceHelpers.CastTypedRef(typedRef, type);
     }
     else
     {
         section[index].ToTypedReferenceObject(typedRef, type);
     }
 }
Exemplo n.º 5
0
 public TypedRef(TypedRefPtr ptr)
 {
     this._ptr = ptr;
 }
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.MakeTypedRef(ptr, typedRef, type);
 }
Exemplo n.º 7
0
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     ctx.Stack.ToTypedReference(StackPos, typedRef, type);
 }
Exemplo n.º 8
0
 public TypedRef(TypedRefPtr ptr)
 {
     _ptr = ptr;
 }
Exemplo n.º 9
0
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.GetFieldAddr(ctx, this.instance, this.field, typedRef);
 }
Exemplo n.º 10
0
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.GetFieldAddr(ctx, instance, field, typedRef);
 }
Exemplo n.º 11
0
 public unsafe void ToTypedReferencePrimitive(TypedRefPtr typedRef)
 {
     *(TypedReference *)typedRef = __makeref(this.u4);
 }