Exemple #1
0
 internal unsafe void CopyToRegister(int fieldIdx, ref RegisterFrameInfo info, short reg)
 {
     if (fieldIdx < fields.Length && fieldIdx >= 0)
     {
         fixed(StackObject *ptr = fields)
         {
             info.Intepreter.CopyToRegister(ref info, reg, &ptr[fieldIdx], managedObjs);
         }
     }
     else
     {
         if (Type.FirstCLRBaseType != null && Type.FirstCLRBaseType is Enviorment.CrossBindingAdaptor)
         {
             CLRType clrType = info.Intepreter.AppDomain.GetType(((Enviorment.CrossBindingAdaptor)Type.FirstCLRBaseType).BaseCLRType) as CLRType;
             var     obj     = clrType.GetFieldValue(fieldIdx, clrInstance);
             if (obj is CrossBindingAdaptorType)
             {
                 obj = ((CrossBindingAdaptorType)obj).ILInstance;
             }
             ILIntepreter.AssignToRegister(ref info, reg, obj);
         }
         else
         {
             throw new TypeLoadException();
         }
     }
 }