forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for reporting byrefs to RVA static fields of collectible …
…assemblies (dotnet#40346) - Keep track of all RVA static field locations - For assemblies loaded from PE files, use a range that is the entire PE range - For assemblies dynamically created, use piecemeal ranges for each individual RVA static field - Report byref references via the GcReportLoaderAllocator mechanism in PromoteCarefully - Add a test to cover this scenario, and thread statics - disable test on Mono, as it doesn't pass there yet
- Loading branch information
1 parent
9b5cbe1
commit 1e17414
Showing
14 changed files
with
362 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
#ifndef __LockedRangeList_h__ | ||
#define __LockedRangeList_h__ | ||
|
||
// ------------------------------------------------------- | ||
// This just wraps the RangeList methods in a read or | ||
// write lock depending on the operation. | ||
// ------------------------------------------------------- | ||
|
||
class LockedRangeList : public RangeList | ||
{ | ||
public: | ||
VPTR_VTABLE_CLASS(LockedRangeList, RangeList) | ||
|
||
LockedRangeList() : RangeList(), m_RangeListRWLock(COOPERATIVE_OR_PREEMPTIVE, LOCK_TYPE_DEFAULT) | ||
{ | ||
LIMITED_METHOD_CONTRACT; | ||
} | ||
|
||
~LockedRangeList() | ||
{ | ||
LIMITED_METHOD_CONTRACT; | ||
} | ||
|
||
BOOL IsInRangeWorker_Unlocked(TADDR address, TADDR *pID = NULL) | ||
{ | ||
WRAPPER_NO_CONTRACT; | ||
SUPPORTS_DAC; | ||
return RangeList::IsInRangeWorker(address, pID); | ||
} | ||
|
||
protected: | ||
|
||
virtual BOOL AddRangeWorker(const BYTE *start, const BYTE *end, void *id) | ||
{ | ||
WRAPPER_NO_CONTRACT; | ||
SimpleWriteLockHolder lh(&m_RangeListRWLock); | ||
return RangeList::AddRangeWorker(start,end,id); | ||
} | ||
|
||
virtual void RemoveRangesWorker(void *id, const BYTE *start = NULL, const BYTE *end = NULL) | ||
{ | ||
WRAPPER_NO_CONTRACT; | ||
SimpleWriteLockHolder lh(&m_RangeListRWLock); | ||
RangeList::RemoveRangesWorker(id,start,end); | ||
} | ||
|
||
virtual BOOL IsInRangeWorker(TADDR address, TADDR *pID = NULL) | ||
{ | ||
WRAPPER_NO_CONTRACT; | ||
SUPPORTS_DAC; | ||
SimpleReadLockHolder lh(&m_RangeListRWLock); | ||
return RangeList::IsInRangeWorker(address, pID); | ||
} | ||
|
||
SimpleRWLock m_RangeListRWLock; | ||
}; | ||
|
||
#endif // __LockedRangeList_h__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.