コード例 #1
0
        unsafe private static IntPtr RhpCastableObjectResolve(IntPtr callerTransitionBlockParam, IntPtr pCell)
        {
            IntPtr locationOfThisPointer = callerTransitionBlockParam + TransitionBlock.GetThisOffset();
            object pObject = Unsafe.As <IntPtr, Object>(ref *(IntPtr *)locationOfThisPointer);

            DispatchCellInfo cellInfo;

            InternalCalls.RhpGetDispatchCellInfo(pCell, out cellInfo);
            if (cellInfo.CellType != DispatchCellType.InterfaceAndSlot)
            {
                // Dispatch cell used for castable object resolve is not InterfaceAndSlot. This should not be possible
                // as all metadata based cells should have been converted to interface and slot cells by this time.
                EH.FallbackFailFast(RhFailFastReason.InternalError, null);
                return(IntPtr.Zero);
            }

            EEType *pInterfaceType = cellInfo.InterfaceType.ToPointer();

            Exception e            = null;
            object    targetObject = GetCastableTargetIfPossible((ICastableObject)pObject, pInterfaceType, false, ref e);

            if (targetObject == null)
            {
                EH.FailFastViaClasslib(RhFailFastReason.InternalError, null, pObject.EEType->GetAssociatedModuleAddress());
            }

            Unsafe.As <IntPtr, Object>(ref *(IntPtr *)locationOfThisPointer) = targetObject;

            InternalCalls.RhpSetTLSDispatchCell(pCell);
            return(InternalCalls.RhpGetTailCallTLSDispatchCell());
        }
コード例 #2
0
 public static bool IsEmpty(Block block)
 {
     if (TransitionBlock.IsWater(block)) return false;
     if (block.IsPathSolid) return false;
     if (block.shape.IsTerrain()) return false;
     return true;
 }
コード例 #3
0
        unsafe private static IntPtr RhpCidResolve(IntPtr callerTransitionBlockParam, IntPtr pCell)
        {
            IntPtr locationOfThisPointer = callerTransitionBlockParam + TransitionBlock.GetThisOffset();
            object pObject = Unsafe.As <IntPtr, Object>(ref *(IntPtr *)locationOfThisPointer);

            return(RhpCidResolve_Worker(pObject, pCell));
        }
コード例 #4
0
        private static unsafe IntPtr RhpCidResolve(IntPtr callerTransitionBlockParam, IntPtr pCell)
        {
            IntPtr locationOfThisPointer = callerTransitionBlockParam + TransitionBlock.GetThisOffset();
            object pObject = Unsafe.As <IntPtr, object>(ref *(IntPtr *)locationOfThisPointer);
            IntPtr dispatchResolveTarget = RhpCidResolve_Worker(pObject, pCell);

            return(dispatchResolveTarget);
        }
コード例 #5
0
        unsafe private static IntPtr RhpCidResolve(IntPtr callerTransitionBlockParam, IntPtr pCell)
        {
            IntPtr locationOfThisPointer = callerTransitionBlockParam + TransitionBlock.GetThisOffset();
            object pObject = Unsafe.As <IntPtr, Object>(ref *(IntPtr *)locationOfThisPointer);
            IntPtr dispatchResolveTarget = RhpCidResolve_Worker(pObject, pCell);

            if (dispatchResolveTarget == InternalCalls.RhpGetCastableObjectDispatchHelper())
            {
                // Swap it out for the one which reads the TLS slot to put the cell in a consistent
                // location
                dispatchResolveTarget = InternalCalls.RhpGetCastableObjectDispatchHelper_TailCalled();
                InternalCalls.RhpSetTLSDispatchCell(pCell);
            }

            return(dispatchResolveTarget);
        }
コード例 #6
0
 public static bool IsEmpty(Block block)
 {
     if (TransitionBlock.IsWater(block))
     {
         return(false);
     }
     if (block.IsPathSolid)
     {
         return(false);
     }
     if (block.shape.IsTerrain())
     {
         return(false);
     }
     return(true);
 }
コード例 #7
0
 public BlockWaterTransitionSimple()
 {
     base.IsNotifyOnLoadUnload = true;
     this.IsRandomlyTick       = true;   // false; //
     Transition = new TransitionBlock(this);
 }
コード例 #8
0
 public BlockLiquidv2Transition()
 {
     base.IsNotifyOnLoadUnload = true;
     this.IsRandomlyTick       = true;   // false; //
     Transition = new TransitionBlock(this);
 }