Exemple #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);
     }
 }
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     if (this._ptr != null)
     {
         *(TypedReference *)typedRef = *(TypedReference *)this._ptr.Value;
     }
     else
     {
         *(PseudoTypedRef *)typedRef = this._typedRef;
     }
 }
Exemple #3
0
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     if (_ptr != null)
     {
         *(TypedReference *)typedRef = *(TypedReference *)_ptr.Value;
     }
     else
     {
         *(PseudoTypedRef *)typedRef = _typedRef;
     }
 }
Exemple #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);
     }
 }
 public TypedRef(TypedRefPtr ptr)
 {
     this._ptr = ptr;
 }
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.MakeTypedRef(ptr, typedRef, type);
 }
Exemple #7
0
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     ctx.Stack.ToTypedReference(StackPos, typedRef, type);
 }
Exemple #8
0
 public TypedRef(TypedRefPtr ptr)
 {
     _ptr = ptr;
 }
Exemple #9
0
 public void ToTypedReference(DarksVMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.GetFieldAddr(ctx, this.instance, this.field, typedRef);
 }
Exemple #10
0
 public void ToTypedReference(VMContext ctx, TypedRefPtr typedRef, Type type)
 {
     TypedReferenceHelpers.GetFieldAddr(ctx, instance, field, typedRef);
 }
Exemple #11
0
 public unsafe void ToTypedReferencePrimitive(TypedRefPtr typedRef)
 {
     *(TypedReference *)typedRef = __makeref(this.u4);
 }