@@ -467,23 +467,9 @@ class SyncBlock
467467 DWORD GetSyncBlockIndex ()
468468 {
469469 LIMITED_METHOD_CONTRACT;
470- return m_dwSyncIndex & ~SyncBlockPrecious ;
470+ return m_dwSyncIndex;
471471 }
472472
473- // As soon as a syncblock acquires some state that cannot be recreated, we latch
474- // a bit.
475- void SetPrecious ()
476- {
477- WRAPPER_NO_CONTRACT;
478- m_dwSyncIndex |= SyncBlockPrecious;
479- }
480-
481- BOOL IsPrecious ()
482- {
483- LIMITED_METHOD_CONTRACT;
484- return (m_dwSyncIndex & SyncBlockPrecious) != 0 ;
485- }
486-
487473 // Get the lock information for this sync block.
488474 // Returns false when the lock is not locked or has not been created yet.
489475 BOOL TryGetLockInfo (DWORD *pThreadId, DWORD *pRecursionLevel);
@@ -496,15 +482,6 @@ class SyncBlock
496482
497483 OBJECTHANDLE GetOrCreateLock (OBJECTREF lockObj);
498484
499- // True is the syncblock and its index are disposable.
500- // If new members are added to the syncblock, this
501- // method needs to be modified accordingly
502- BOOL IsIDisposable ()
503- {
504- WRAPPER_NO_CONTRACT;
505- return !IsPrecious () && m_thinLock == 0u ;
506- }
507-
508485 // Gets the InteropInfo block, creates a new one if none is present.
509486 InteropSyncBlockInfo* GetInteropInfo ()
510487 {
@@ -571,8 +548,6 @@ class SyncBlock
571548 DWORD result = InterlockedCompareExchange ((LONG*)&m_dwHashCode, hashCode, 0 );
572549 if (result == 0 )
573550 {
574- // the sync block now holds a hash code, which we can't afford to lose.
575- SetPrecious ();
576551 return hashCode;
577552 }
578553 else
@@ -590,13 +565,6 @@ class SyncBlock
590565 // We've already destructed. But retain the memory.
591566 }
592567
593- enum
594- {
595- // This bit indicates that the syncblock is valuable and can neither be discarded
596- // nor re-created.
597- SyncBlockPrecious = 0x80000000 ,
598- };
599-
600568 BOOL HasCOMBstrTrailByte ()
601569 {
602570 LIMITED_METHOD_CONTRACT;
@@ -610,7 +578,6 @@ class SyncBlock
610578 {
611579 WRAPPER_NO_CONTRACT;
612580 m_BSTRTrailByte = trailByte;
613- SetPrecious ();
614581 }
615582
616583 private:
@@ -727,9 +694,6 @@ class SyncBlockCache
727694 // returns the sync block memory to the free pool but does not destruct sync block (must own cache lock already)
728695 void DeleteSyncBlockMemory (SyncBlock *sb);
729696
730- // return sync block to cache or delete, called from GC
731- void GCDeleteSyncBlock (SyncBlock *sb);
732-
733697 void GCWeakPtrScan (HANDLESCANPROC scanProc, uintptr_t lp1, uintptr_t lp2);
734698
735699 void GCDone (BOOL demoting, int max_gen);
@@ -864,14 +828,6 @@ class ObjHeader
864828 InterlockedAnd ((LONG*)&m_SyncBlockValue, ~(BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX | BIT_SBLK_IS_HASHCODE | MASK_SYNCBLOCKINDEX));
865829 }
866830
867- // Used only GC
868- void GCResetIndex ()
869- {
870- LIMITED_METHOD_CONTRACT;
871-
872- m_SyncBlockValue.RawValue () &=~(BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX | BIT_SBLK_IS_HASHCODE | MASK_SYNCBLOCKINDEX);
873- }
874-
875831 // For now, use interlocked operations to twiddle bits in the bitfield portion.
876832 // If we ever have high-performance requirements where we can guarantee that no
877833 // other threads are accessing the ObjHeader, this can be reconsidered for those
0 commit comments