Delete DISABLE_EH_VECTORS
authorJan Kotas <jkotas@microsoft.com>
Mon, 24 Oct 2016 04:11:49 +0000 (21:11 -0700)
committerJan Kotas <jkotas@microsoft.com>
Mon, 24 Oct 2016 04:11:49 +0000 (21:11 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/3e71169287f5f4deae73151aea0567148a15062a

src/coreclr/src/gcinfo/gcinfoencoder.cpp
src/coreclr/src/inc/gcinfoencoder.h
src/coreclr/src/inc/gcinfotypes.h
src/coreclr/src/vm/gcinfodecoder.cpp

index 6785222..716b3ae 100644 (file)
@@ -343,7 +343,6 @@ GcInfoSize& GcInfoSize::operator+=(const GcInfoSize& other)
     NumRanges += other.NumRanges;
     NumRegs += other.NumRegs;
     NumStack += other.NumStack;
-    NumEh += other.NumEh;
     NumTransitions += other.NumTransitions;
     SizeOfCode += other.SizeOfCode;
     
@@ -366,7 +365,6 @@ GcInfoSize& GcInfoSize::operator+=(const GcInfoSize& other)
     RegSlotSize += other.RegSlotSize;
     StackSlotSize += other.StackSlotSize;
     CallSiteStateSize += other.CallSiteStateSize;
-    NumEhSize += other.NumEhSize;
     EhPosSize += other.EhPosSize;
     EhStateSize += other.EhStateSize;
     ChunkPtrSize += other.ChunkPtrSize;
@@ -389,7 +387,6 @@ void GcInfoSize::Log(DWORD level, const char * header)
         LogSpew(LF_GCINFO, level, "NumRanges: %Iu\n", NumRanges);
         LogSpew(LF_GCINFO, level, "NumRegs: %Iu\n", NumRegs);
         LogSpew(LF_GCINFO, level, "NumStack: %Iu\n", NumStack);
-        LogSpew(LF_GCINFO, level, "NumEh: %Iu\n", NumEh);
         LogSpew(LF_GCINFO, level, "NumTransitions: %Iu\n", NumTransitions);
         LogSpew(LF_GCINFO, level, "SizeOfCode: %Iu\n", SizeOfCode);
 
@@ -414,7 +411,6 @@ void GcInfoSize::Log(DWORD level, const char * header)
         LogSpew(LF_GCINFO, level, "RegSlots: %Iu\n", RegSlotSize);
         LogSpew(LF_GCINFO, level, "StackSlots: %Iu\n", StackSlotSize);
         LogSpew(LF_GCINFO, level, "CallSiteStates: %Iu\n", CallSiteStateSize);
-        LogSpew(LF_GCINFO, level, "NumEh: %Iu\n", NumEhSize);
         LogSpew(LF_GCINFO, level, "EhOffsets: %Iu\n", EhPosSize);
         LogSpew(LF_GCINFO, level, "EhStates: %Iu\n", EhStateSize);
         LogSpew(LF_GCINFO, level, "ChunkPointers: %Iu\n", ChunkPtrSize);
@@ -426,17 +422,6 @@ void GcInfoSize::Log(DWORD level, const char * header)
 
 #endif
 
-#ifndef DISABLE_EH_VECTORS
-inline BOOL IsEssential(EE_ILEXCEPTION_CLAUSE *pClause)
-{
-    _ASSERTE(pClause->TryEndPC >= pClause->TryStartPC);
-     if(pClause->TryEndPC == pClause->TryStartPC)
-        return FALSE;
-
-     return TRUE;
-}
-#endif
-
 GcInfoEncoder::GcInfoEncoder(
             ICorJitInfo*                pCorJitInfo,
             CORINFO_METHOD_INFO*        pMethodInfo,
@@ -1354,83 +1339,6 @@ void GcInfoEncoder::Build()
 #endif
     }
 
-
-#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
-    ///////////////////////////////////////////////////////////////////////
-    // Gather EH information
-    ///////////////////////////////////////////////////////////////////////
-   
-    couldBeLive.ClearAll();
-
-#ifndef DISABLE_EH_VECTORS
-    UINT32 numEHClauses;
-    EE_ILEXCEPTION *pEHInfo = (EE_ILEXCEPTION*) m_pCorJitInfo->getEHInfo();
-    if (!pEHInfo)
-        numEHClauses = 0;
-    else
-        numEHClauses = pEHInfo->EHCount();
-
-    UINT32 numUsedEHClauses = numEHClauses;
-    for (UINT32 clauseIndex = 0; clauseIndex < numEHClauses; clauseIndex++)
-    {
-        EE_ILEXCEPTION_CLAUSE * pClause;
-        pClause = pEHInfo->EHClause(clauseIndex);
-
-        if(!IsEssential(pClause))
-            numUsedEHClauses--;
-    }
-    
-    UINT32 ehTableBitCount = m_NumSlots * numUsedEHClauses;
-    BitArray ehLiveSlots(m_pAllocator, (ehTableBitCount + BITS_PER_SIZE_T - 1) / BITS_PER_SIZE_T);
-    ehLiveSlots.ClearAll();
-
-    UINT32 basePos = 0;
-    for (UINT32 clauseIndex = 0; clauseIndex < numEHClauses; clauseIndex++)
-    {
-        EE_ILEXCEPTION_CLAUSE * pClause;
-        pClause = pEHInfo->EHClause(clauseIndex);
-
-        _ASSERTE(pClause->TryEndPC <= m_CodeLength);
-        if(!IsEssential(pClause))
-            continue;
-        
-        liveState.ClearAll();
-        
-        for(pCurrent = pTransitions; pCurrent < pEndTransitions; pCurrent++)
-        {
-            if(pCurrent->CodeOffset > pClause->TryStartPC)
-                break;
-            
-            UINT32 slotIndex = pCurrent->SlotId;
-            BYTE becomesLive = pCurrent->BecomesLive;
-            _ASSERTE(liveState.ReadBit(slotIndex) && !becomesLive
-                    || !liveState.ReadBit(slotIndex) && becomesLive);
-            liveState.WriteBit(slotIndex, becomesLive);
-        }
-
-        for( ; pCurrent < pEndTransitions; pCurrent++)
-        {
-            if(pCurrent->CodeOffset >= pClause->TryEndPC)
-                break;
-            
-            UINT32 slotIndex = pCurrent->SlotId;
-            liveState.ClearBit(slotIndex);
-        }
-
-        // Copy to the EH live state table
-        for(UINT32 i = 0; i < m_NumSlots; i++)
-        {
-            if(liveState.ReadBit(i))
-                ehLiveSlots.SetBit(basePos + i);
-        }
-        basePos += m_NumSlots;
-
-        // Keep track of which slots are used
-        couldBeLive |= liveState;
-    }
-#endif  // DISABLE_EH_VECTORS
-#endif  // PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
-    
 #if CODE_OFFSETS_NEED_NORMALIZATION
     // Do a pass to normalize transition offsets
     for(pCurrent = pTransitions; pCurrent < pEndTransitions; pCurrent++)
@@ -1994,40 +1902,6 @@ void GcInfoEncoder::Build()
 #endif // MUST_CALL_JITALLOCATOR_FREE
 
     }
-
-    //-----------------------------------------------------------------
-    // Encode EH clauses and bit vectors
-    //-----------------------------------------------------------------
-
-#ifndef DISABLE_EH_VECTORS
-    GCINFO_WRITE_VARL_U(m_Info1, numUsedEHClauses, NUM_EH_CLAUSES_ENCBASE, NumEhSize);
-
-    basePos = 0;
-    for(UINT32 clauseIndex = 0; clauseIndex < numEHClauses; clauseIndex++)
-    {
-        EE_ILEXCEPTION_CLAUSE * pClause;
-        pClause = pEHInfo->EHClause(clauseIndex);
-
-        if(!IsEssential(pClause))
-            continue;
-
-        UINT32 normStartOffset = NORMALIZE_CODE_OFFSET(pClause->TryStartPC);
-        UINT32 normStopOffset = NORMALIZE_CODE_OFFSET(pClause->TryEndPC);
-        _ASSERTE(normStopOffset > normStartOffset);        
-
-        GCINFO_WRITE(m_Info1, normStartOffset, numBitsPerOffset, EhPosSize);
-        GCINFO_WRITE(m_Info1, normStopOffset - 1, numBitsPerOffset, EhPosSize);
-                
-        for(UINT slotIndex = 0; slotIndex < m_NumSlots; slotIndex++)
-        {
-            if(!m_SlotTable[slotIndex].IsDeleted())
-            {
-                GCINFO_WRITE(m_Info1, ehLiveSlots.ReadBit(basePos + slotIndex) ? 1 : 0, 1, EhStateSize);
-            }
-        }
-        basePos += m_NumSlots;
-    }
-#endif  // DISABLE_EH_VECTORS    
 #endif  // PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
 
     
@@ -2358,11 +2232,6 @@ lExitSuccess:;
     m_CurrentMethodSize.NumMethods = 1;
 #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
     m_CurrentMethodSize.NumCallSites = m_NumCallSites;
-#ifdef DISABLE_EH_VECTORS
-    m_CurrentMethodSize.NumEh = 0;
-#else
-    m_CurrentMethodSize.NumEh = numUsedEHClauses;
-#endif
 #endif
     m_CurrentMethodSize.NumRanges = numInterruptibleRanges;
     m_CurrentMethodSize.NumRegs = numRegisters;
index 838f1ba..0cd770c 100644 (file)
@@ -110,7 +110,6 @@ struct GcInfoSize
     size_t NumRanges;
     size_t NumRegs;
     size_t NumStack;
-    size_t NumEh;
     size_t NumTransitions;
     size_t SizeOfCode;
 
@@ -134,7 +133,6 @@ struct GcInfoSize
     size_t RegSlotSize;
     size_t StackSlotSize;
     size_t CallSiteStateSize;
-    size_t NumEhSize;
     size_t EhPosSize;
     size_t EhStateSize;
     size_t ChunkPtrSize;
index 1ce2639..05f35c4 100644 (file)
@@ -8,21 +8,10 @@
 
 #include "gcinfo.h"
 
-#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
 #define PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
-#endif
 
-#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
-//
-// The EH vector mechanism is not completely worked out, 
-//   so it's temporarily disabled. We rely on fully-interruptible instead.
-//
-#define DISABLE_EH_VECTORS
-#endif
-
-#if defined(_TARGET_AMD64_) || defined(_TARGET_ARM_) || defined(_TARGET_ARM64_)
 #define FIXED_STACK_PARAMETER_SCRATCH_AREA
-#endif
+
 
 #define BITS_PER_SIZE_T ((int)sizeof(size_t)*8)
 
index ef237a2..052cb4c 100644 (file)
@@ -645,48 +645,6 @@ bool GcInfoDecoder::EnumerateLiveSlots(
 
 
 #ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
-#ifndef DISABLE_EH_VECTORS
-    if(m_SafePointIndex < m_NumSafePoints || executionAborted)
-    {
-        // Skip interruptibility information
-        for(UINT32 i=0; i<m_NumInterruptibleRanges; i++)
-        {
-            m_Reader.DecodeVarLengthUnsigned( INTERRUPTIBLE_RANGE_DELTA1_ENCBASE );
-            m_Reader.DecodeVarLengthUnsigned( INTERRUPTIBLE_RANGE_DELTA2_ENCBASE );
-        }
-    }
-    else
-    {
-        //
-        // We didn't find the break offset in the list of call sites
-        //    and are not in an executionAborted frame
-        // So we must have fully-interruptible information
-        //
-        _ASSERTE(m_NumInterruptibleRanges);
-
-#ifdef _DEBUG
-        int dbgCountIntersections = 0;
-#endif
-        UINT32 lastNormStop = 0;
-        for(UINT32 i=0; i<m_NumInterruptibleRanges; i++)
-        {
-            UINT32 normStartDelta = (UINT32) m_Reader.DecodeVarLengthUnsigned( INTERRUPTIBLE_RANGE_DELTA1_ENCBASE );
-            UINT32 normStopDelta = (UINT32) m_Reader.DecodeVarLengthUnsigned( INTERRUPTIBLE_RANGE_DELTA2_ENCBASE ) + 1;
-
-            UINT32 normStart = lastNormStop + normStartDelta;
-            UINT32 normStop = normStart + normStopDelta;
-            if(normBreakOffset >= normStart && normBreakOffset < normStop)
-            {
-                _ASSERTE(pseudoBreakOffset == 0);
-                _ASSERTE(dbgCountIntersections++ == 0);
-                pseudoBreakOffset = numInterruptibleLength + normBreakOffset - normStart;
-            }
-            numInterruptibleLength += normStopDelta;
-            lastNormStop = normStop;
-        }        
-        _ASSERTE(dbgCountIntersections == 1);
-    }        
-#else // DISABLE_EH_VECTORS
     if(m_SafePointIndex < m_NumSafePoints && !executionAborted)
     {
         // Skip interruptibility information
@@ -736,7 +694,6 @@ bool GcInfoDecoder::EnumerateLiveSlots(
             goto ExitSuccess;
         }
     }        
-#endif // DISABLE_EH_VECTORS
 #else   // !PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
 
     // Skip interruptibility information
@@ -778,52 +735,8 @@ bool GcInfoDecoder::EnumerateLiveSlots(
 
         if(executionAborted)
         {
-#ifndef DISABLE_EH_VECTORS
-            m_Reader.Skip(m_NumSafePoints * numSlots);
-
-            UINT32 numClauses = (UINT32) m_Reader.DecodeVarLengthUnsigned(NUM_EH_CLAUSES_ENCBASE);
-
-            if(numClauses)
-            {
-                UINT32 numBitsPerOffset = CeilOfLog2(NORMALIZE_CODE_OFFSET(m_CodeLength));
-                
-                for(UINT32 i = 0; i < numClauses; i++)
-                {
-                    UINT32 startOffset = (UINT32) DENORMALIZE_CODE_OFFSET(m_Reader.Read(numBitsPerOffset));
-                    UINT32 stopOffset = (UINT32) DENORMALIZE_CODE_OFFSET(m_Reader.Read(numBitsPerOffset) + 1);
-                    
-                    if(m_InstructionOffset >= startOffset 
-                        && m_InstructionOffset < stopOffset)
-                    {
-                        for(UINT32 slotIndex = 0; slotIndex < numSlots; slotIndex++)
-                        {
-                            if(m_Reader.ReadOneFast())
-                            {
-                                ReportSlotToGC(
-                                        slotDecoder,
-                                        slotIndex,
-                                        pRD,
-                                        reportScratchSlots,
-                                        inputFlags,
-                                        pCallBack,
-                                        hCallBack
-                                        );
-                            }
-                        }
-                    }
-                    else
-                    {
-                        m_Reader.Skip(numSlots);
-                    }
-                }
-            }
-            goto ReportUntracked;
-#else //DISABLE_EH_VECTORS
-
             _ASSERTE(m_NumSafePoints == 0);
             m_Reader.Skip(m_NumSafePoints * numSlots);
-
-#endif //DISABLE_EH_VECTORS
         }
         else if( m_SafePointIndex != m_NumSafePoints )
         {
@@ -891,15 +804,7 @@ bool GcInfoDecoder::EnumerateLiveSlots(
         else
         {
             m_Reader.Skip(m_NumSafePoints * numSlots);
-
-#ifndef DISABLE_EH_VECTORS
-            UINT32 numClauses = (UINT32) m_Reader.DecodeVarLengthUnsigned(NUM_EH_CLAUSES_ENCBASE);
-            UINT32 numBitsPerOffset = CeilOfLog2(NORMALIZE_CODE_OFFSET(m_CodeLength));
-
-            m_Reader.Skip((numBitsPerOffset * 2 + numSlots) * numClauses);
-#endif //DISABLE_EH_VECTORS
-        } 
-    
+        }
 #endif // PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED
         
         _ASSERTE(m_NumInterruptibleRanges);
@@ -1069,9 +974,7 @@ ReportUntracked:
         ReportUntrackedSlots(slotDecoder, pRD, inputFlags, pCallBack, hCallBack);
     }
 
-#ifdef DISABLE_EH_VECTORS
 ExitSuccess:
-#endif
 
     return true;
 }