Exemplo n.º 1
0
        internal void mergeJECGTT(JI j, JECAKey key, JECGTT jecFrom, JECGTT jecTo,
                                  Action <GTTI> enqueuePropagateGTTI,
                                  Action <GTTI, GTTI> enqueueMergeGTTI)
        {
            Debug.Assert(jecFrom != jecTo);
            Debug.Assert(jecFrom.jecgtT.SequenceEqual(jecTo.jecgtT));
            Debug.Assert(makeJECGTTKey(j, jecTo.jecgtT) == key);
            if (jecFrom.CompareTo(jecTo) < 0)
            {
                FU.swap(ref jecFrom, ref jecTo);
            }
            gtts.mergeJECInt(j, jecFrom, jecTo, enqueuePropagateGTTI, enqueueMergeGTTI);
#if DEBUG
            if (jecgtTBreakCondition(j, jecTo.jecgtT))
            {
                Debugger.Break();
            }
            if (jecgtTBreakCondition(j, jecFrom.jecgtT))
            {
                Debugger.Break();
            }
#endif
            Debug.Assert(jecTKeyToJECGTT[j][key] == jecFrom || jecTKeyToJECGTT[j][key] == jecTo);
            if (jecTKeyToJECGTT[j][key] == jecFrom)
            {
                removeJECTKeyInt(j, key);
                setJECTKeyInt(j, key, jecTo);
            }
        }
Exemplo n.º 2
0
        protected void enqueueMergeGTI(GTI gti1R, GTI gti2R)
        {
            #region consistency
            var gtd1R = getGTD(gti1R);
            var gtd2R = getGTD(gti2R);
            Debug.Assert(gtd1R.type == null || gtd2R.type == null || gtd1R.type.isEquivalent(gtd2R.type));
            #endregion consistency

            var gti1 = gti1R;
            while (gtiMergeToMap.ContainsKey(gti1))
            {
                gti1 = gtiMergeToMap[gti1];
            }
            var gti2 = gti2R;
            while (gtiMergeToMap.ContainsKey(gti2))
            {
                gti2 = gtiMergeToMap[gti2];
            }
            if (gti1 == gti2)
            {
                return;
            }
            if (gti1 > gti2)
            {
                FU.swap(ref gti1, ref gti2);
            }
            if (gti1 == currentlyMergingFromGTI)
            {
                gti1 = currentlyMergingToGTI;
            }
            if (gti2 == currentlyMergingFromGTI && gti1 == currentlyMergingToGTI)
            {
                return;
            }
            Debug.Assert(!gtiMergeMap.ContainsKey(gti1));
            Debug.Assert(!gtiMergeMap.ContainsKey(gti2));
            Debug.Assert(!gtiMergeToMap.ContainsKey(gti1));
            Debug.Assert(!gtiMergeToMap.ContainsKey(gti2));
#if DEBUG
//            if (getGTD(gti1).lgts.Any(isIt) || getGTD(gti2).lgts.Any(isIt))
//                Debugger.Break();
//            if (isItGTI(gti1) || isItGTI(gti2))
//                Debugger.Break();
#endif
            gtiMergeToMap[gti2] = gti1;
        }