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()); }
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; }
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)); }
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); }
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); }
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); }
public BlockWaterTransitionSimple() { base.IsNotifyOnLoadUnload = true; this.IsRandomlyTick = true; // false; // Transition = new TransitionBlock(this); }
public BlockLiquidv2Transition() { base.IsNotifyOnLoadUnload = true; this.IsRandomlyTick = true; // false; // Transition = new TransitionBlock(this); }