当前位置: 首页>>代码示例>>C#>>正文


C# SlotIndex.ToString方法代码示例

本文整理汇总了C#中Mosa.Compiler.Framework.RegisterAllocator.SlotIndex.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SlotIndex.ToString方法的具体用法?C# SlotIndex.ToString怎么用?C# SlotIndex.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mosa.Compiler.Framework.RegisterAllocator.SlotIndex的用法示例。


在下文中一共展示了SlotIndex.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetLowOptimalSplitLocation

        private SlotIndex GetLowOptimalSplitLocation(LiveInterval liveInterval, SlotIndex from, bool check)
        {
            Debug.Assert(liveInterval.Start != from);

            if (trace.Active) trace.Log("--Low Splitting: " + liveInterval.ToString() + " move: " + from.ToString());

            if (check)
            {
                if (liveInterval.UsePositions.Contains(from) || liveInterval.DefPositions.Contains(from))
                {
                    if (trace.Active) trace.Log("  No optimal. Split move: " + from.ToString());
                    return from;
                }
            }

            SlotIndex blockStart = GetBlockStart(from);
            if (trace.Active) trace.Log("  Block Start : " + blockStart.ToString());

            SlotIndex lowerBound = blockStart > liveInterval.Start ? blockStart : liveInterval.Start.Next;
            if (trace.Active) trace.Log("  Lower Bound : " + lowerBound.ToString());

            SlotIndex previousUse = liveInterval.GetPreviousDefOrUsePosition(from);
            if (trace.Active) trace.Log("  Previous Use: " + (previousUse != null ? previousUse.ToString() : "null"));

            if (previousUse != null && previousUse >= lowerBound)
            {
                if (trace.Active) trace.Log("  Low Optimal : " + previousUse.Next.ToString());
                return previousUse.Next;
            }

            if (trace.Active) trace.Log("  Low Optimal : " + lowerBound.ToString());
            return lowerBound;
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:33,代码来源:GreedyRegisterAllocator.cs

示例2: GetUpperOptimalSplitLocation

        private SlotIndex GetUpperOptimalSplitLocation(LiveInterval liveInterval, SlotIndex at)
        {
            if (Trace.Active) Trace.Log("--High Splitting: " + liveInterval.ToString() + " move: " + at.ToString());

            var a = liveInterval.End;

            var blockEnd = GetBlockEnd(at);
            var b = blockEnd > liveInterval.End ? blockEnd : null;
            if (Trace.Active) Trace.Log("     Block End : " + (b != null ? b.ToString() : "null"));

            var c = liveInterval.LiveRange.GetNextUsePosition(at);
            if (c != null && c.HalfStepBack > at)
                c = c.HalfStepBack;
            if (Trace.Active) Trace.Log("      Next Use : " + (c != null ? c.ToString() : "null"));

            var d = liveInterval.LiveRange.GetNextDefPosition(at);
            if (Trace.Active) Trace.Log("      Next Def : " + (d != null ? d.ToString() : "null"));

            var min = GetMinimum(a, b, c, d);

            if (Trace.Active) Trace.Log("  High Optimal : " + min.ToString());

            return min;
        }
开发者ID:tgiphil,项目名称:MOSA-Project,代码行数:24,代码来源:GreedyRegisterAllocator.cs

示例3: GetHighOptimalSplitLocation

        private SlotIndex GetHighOptimalSplitLocation(LiveInterval liveInterval, SlotIndex after, bool check)
        {
            Debug.Assert(liveInterval.End != after);

            if (trace.Active) trace.Log("--High Splitting: " + liveInterval.ToString() + " move: " + after.ToString());

            SlotIndex blockEnd = GetBlockEnd(after);
            if (trace.Active) trace.Log("  Block End   : " + blockEnd.ToString());

            SlotIndex higherBound = blockEnd < liveInterval.End ? blockEnd : liveInterval.End.Previous;
            if (trace.Active) trace.Log("  Higher Bound: " + higherBound.ToString());

            SlotIndex nextUse = liveInterval.GetNextDefOrUsePosition(after);
            if (trace.Active) trace.Log("  Next Use    : " + (nextUse != null ? nextUse.ToString() : "null"));

            if (nextUse != null && nextUse <= higherBound)
            {
                if (trace.Active) trace.Log("  High Optimal: " + nextUse.Previous.ToString());
                return nextUse;
            }

            if (trace.Active) trace.Log("  High Optimal: " + higherBound.ToString());
            return higherBound;
        }
开发者ID:tea,项目名称:MOSA-Project,代码行数:24,代码来源:GreedyRegisterAllocator.cs

示例4: GetLowerOptimalSplitLocation

        private SlotIndex GetLowerOptimalSplitLocation(LiveInterval liveInterval, SlotIndex at)
        {
            if (Trace.Active) Trace.Log("--Low Splitting: " + liveInterval.ToString() + " move: " + at.ToString());

            //a = liveInterval.Start.IsOnHalfStep ? liveInterval.Start : liveInterval.Start.HalfStepForward;
            var a = liveInterval.Start;

            var blockStart = GetBlockStart(at);
            var b = blockStart > liveInterval.Start ? blockStart : null;
            if (Trace.Active) Trace.Log("   Block Start : " + (b != null ? b.ToString() : "null"));

            var c = liveInterval.LiveRange.GetPreviousUsePosition(at);
            if (c != null && c.HalfStepForward <= at)
                c = c.HalfStepForward;
            if (Trace.Active) Trace.Log("  Previous Use : " + (c != null ? c.ToString() : "null"));

            var d = liveInterval.LiveRange.GetPreviousDefPosition(at);
            if (d != null && d.HalfStepForward <= at)
                d = d.HalfStepForward;
            if (Trace.Active) Trace.Log("  Previous Def : " + (d != null ? d.ToString() : "null"));

            var max = GetMaximum(a, b, c, d);

            if (Trace.Active) Trace.Log("   Low Optimal : " + max.ToString());

            return max;
        }
开发者ID:tgiphil,项目名称:MOSA-Project,代码行数:27,代码来源:GreedyRegisterAllocator.cs


注:本文中的Mosa.Compiler.Framework.RegisterAllocator.SlotIndex.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。