Contains() public method

public Contains ( SlotIndex start ) : bool
start SlotIndex
return bool
        private bool TrySimplePartialFreeIntervalSplit(LiveInterval liveInterval)
        {
            SlotIndex furthestUsed = null;

            foreach (var track in LiveIntervalTracks)
            {
                if (track.IsReserved)
                {
                    continue;
                }

                if (track.IsFloatingPoint != liveInterval.VirtualRegister.IsFloatingPoint)
                {
                    continue;
                }

                var next = track.GetNextLiveRange(liveInterval.Start);

                if (next == null)
                {
                    continue;
                }

                Debug.Assert(next > liveInterval.Start);

                if (Trace.Active)
                {
                    Trace.Log("  Register " + track + " free up to " + next);
                }

                if (furthestUsed == null || furthestUsed < next)
                {
                    furthestUsed = next;
                }
            }

            if (furthestUsed == null)
            {
                if (Trace.Active)
                {
                    Trace.Log("  No partial free space available");
                }
                return(false);
            }

            if (furthestUsed < liveInterval.Minimum)
            {
                if (Trace.Active)
                {
                    Trace.Log("  No partial free space available");
                }
                return(false);
            }

            if (furthestUsed.IsBlockStartInstruction)
            {
                return(false);
            }

            if (furthestUsed <= liveInterval.Start)
            {
                if (Trace.Active)
                {
                    Trace.Log("  No partial free space available");
                }
                return(false);
            }

            if (Trace.Active)
            {
                Trace.Log("  Partial free up destination: " + furthestUsed);
            }

            if (liveInterval.UsePositions.Contains(furthestUsed) && liveInterval.Contains(furthestUsed.HalfStepBack))
            {
                furthestUsed = furthestUsed.HalfStepBack;
            }

            return(PreferBlockBoundaryIntervalSplit(liveInterval, furthestUsed, true));
        }
Ejemplo n.º 2
0
 private SlotIndex FindCallSiteInInterval(LiveInterval liveInterval)
 {
     foreach (SlotIndex slot in callSlots)
     {
         if (liveInterval.Contains(slot))
             return slot;
     }
     return null;
 }
Ejemplo n.º 3
0
        private bool TrySimplePartialFreeIntervalSplit(LiveInterval liveInterval)
        {
            var furthest = SlotIndex.NullSlot;

            foreach (var track in LiveIntervalTracks)
            {
                if (track.IsReserved)
                {
                    continue;
                }

                if (track.IsFloatingPoint != liveInterval.VirtualRegister.IsFloatingPoint)
                {
                    continue;
                }

                if (track.Intersects(liveInterval.Start))
                {
                    continue;
                }

                var intersections = track.GetIntersections(liveInterval);

                Debug.Assert(intersections.Count != 0);

                foreach (var interval in intersections)
                {
                    var start = interval.Start;

                    Trace?.Log($"  Register {track} free up to {start}");

                    if (furthest.IsNull || start > furthest)
                    {
                        furthest = start;
                    }
                }
            }

            if (furthest.IsNull)
            {
                Trace?.Log("  No partial free space available");
                return(false);
            }

            if (furthest < liveInterval.First)
            {
                Trace?.Log("  No partial free space available");
                return(false);
            }

            if (GetNode(furthest).IsBlockStartInstruction)
            {
                return(false);
            }

            if (furthest <= liveInterval.Start)
            {
                Trace?.Log("  No partial free space available");
                return(false);
            }

            Trace?.Log($"  Partial free up destination: {furthest}");

            if (liveInterval.LiveRange.ContainUse(furthest))
            {
                var nextfurthest = furthest.Before;

                if (liveInterval.Contains(nextfurthest))
                {
                    furthest = nextfurthest;
                }
            }

            return(PreferBlockBoundaryIntervalSplit(liveInterval, furthest, true));
        }
        private bool TrySimplePartialFreeIntervalSplit(LiveInterval liveInterval)
        {
            SlotIndex furthestUsed = null;

            foreach (var track in LiveIntervalTracks)
            {
                if (track.IsReserved)
                    continue;

                if (track.IsFloatingPoint != liveInterval.VirtualRegister.IsFloatingPoint)
                    continue;

                var next = track.GetNextLiveRange(liveInterval.Start);

                if (next == null)
                    continue;

                Debug.Assert(next > liveInterval.Start);

                if (Trace.Active) Trace.Log("  Register " + track.ToString() + " free up to " + next.ToString());

                if (furthestUsed == null || furthestUsed < next)
                    furthestUsed = next;
            }

            if (furthestUsed == null)
            {
                if (Trace.Active) Trace.Log("  No partial free space available");
                return false;
            }

            if (furthestUsed < liveInterval.Minimum)
            {
                if (Trace.Active) Trace.Log("  No partial free space available");
                return false;
            }

            if (furthestUsed.IsBlockStartInstruction)
            {
                return false;
            }

            if (furthestUsed <= liveInterval.Start)
            {
                if (Trace.Active) Trace.Log("  No partial free space available");
                return false;
            }

            if (Trace.Active) Trace.Log("  Partial free up destination: " + furthestUsed.ToString());

            if (liveInterval.UsePositions.Contains(furthestUsed) && liveInterval.Contains(furthestUsed.HalfStepBack))
                furthestUsed = furthestUsed.HalfStepBack;

            return PreferBlockBoundaryIntervalSplit(liveInterval, furthestUsed, true);
        }