Exemplo n.º 1
0
 public HighEHCluster(HighProtectedRegion protRegion, HighEscapePathTerminator[] escapePathTerminators)
 {
     m_protRegion = protRegion;
     m_escapePathTerminators = escapePathTerminators;
 }
Exemplo n.º 2
0
        private HighProtectedRegion ConvertProtectedRegion(HighProtectedRegion oldProtRegion)
        {
            HighRegion oldTryRegion = oldProtRegion.TryRegion;
            HighCfgNodeHandle tryEntryNode = GetNode(oldTryRegion.EntryNode.Value);
            HighRegion newTryRegion = new HighRegion(tryEntryNode);

            HighTryCatchRegion tryCatchRegion = oldProtRegion as HighTryCatchRegion;
            if (tryCatchRegion != null)
            {
                List<HighCatchHandler> catchHandlers = new List<HighCatchHandler>();
                foreach (HighCatchHandler catchHandler in tryCatchRegion.CatchHandlers)
                {
                    TypeSpecTag catchType = m_methodConverter.InstantiateType(catchHandler.CatchType);
                    HighRegion region = new HighRegion(GetNode(catchHandler.Region.EntryNode.Value));

                    catchHandlers.Add(new HighCatchHandler(catchType, region));
                }
                return new HighTryCatchRegion(newTryRegion, catchHandlers.ToArray());
            }

            HighTryFaultRegion tryFaultRegion = oldProtRegion as HighTryFaultRegion;
            if (tryFaultRegion != null)
            {
                HighRegion region = new HighRegion(GetNode(tryFaultRegion.FaultRegion.EntryNode.Value));

                return new HighTryFaultRegion(newTryRegion, region);
            }

            HighTryFinallyRegion tryFinallyRegion = oldProtRegion as HighTryFinallyRegion;
            if (tryFinallyRegion != null)
            {
                HighRegion region = new HighRegion(GetNode(tryFinallyRegion.FinallyRegion.EntryNode.Value));

                return new HighTryFinallyRegion(newTryRegion, region);
            }

            throw new Exception();
        }