[K/N] Split Weak and MemorySharedRefs between mm implementations ^KT-56233
* A separate RegularWeakReferenceImpl for the new mm. Name is chosen for better consistency with other WeakReferenceImpl implementations. * KRefSharedHolder and BackRefFromAssociatedObject implementations are independent between the legacy and the new mm. * Better support for WeakReference in runtime unit tests.
This commit is contained in:
committed by
Space Team
parent
87da670319
commit
1f1b26f2a5
@@ -149,10 +149,17 @@ ALWAYS_INLINE inline bool isNullOrMarker(const ObjHeader* obj) noexcept {
|
||||
return reinterpret_cast<uintptr_t>(obj) <= 1;
|
||||
}
|
||||
|
||||
class ForeignRefManager;
|
||||
struct FrameOverlay;
|
||||
|
||||
// Legacy MM only:
|
||||
class ForeignRefManager;
|
||||
typedef ForeignRefManager* ForeignRefContext;
|
||||
|
||||
namespace kotlin::mm {
|
||||
// New MM only:
|
||||
struct RawSpecialRef;
|
||||
} // namespace kotlin::mm
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -337,24 +344,6 @@ bool Kotlin_Any_isShareable(ObjHeader* thiz);
|
||||
void Kotlin_Any_share(ObjHeader* thiz);
|
||||
void PerformFullGC(MemoryState* memory) RUNTIME_NOTHROW;
|
||||
|
||||
// Only for legacy
|
||||
bool TryAddHeapRef(const ObjHeader* object);
|
||||
void ReleaseHeapRefNoCollect(const ObjHeader* object) RUNTIME_NOTHROW;
|
||||
|
||||
// Only for experimental
|
||||
OBJ_GETTER(TryRef, ObjHeader* object) RUNTIME_NOTHROW;
|
||||
|
||||
ForeignRefContext InitLocalForeignRef(ObjHeader* object);
|
||||
|
||||
ForeignRefContext InitForeignRef(ObjHeader* object);
|
||||
void DeinitForeignRef(ObjHeader* object, ForeignRefContext context);
|
||||
|
||||
bool IsForeignRefAccessible(ObjHeader* object, ForeignRefContext context);
|
||||
|
||||
// Should be used when reference is read from a possibly shared variable,
|
||||
// and there's nothing else keeping the object alive.
|
||||
void AdoptReferenceFromSharedVariable(ObjHeader* object);
|
||||
|
||||
void CheckGlobalsAccessible();
|
||||
|
||||
// Sets state of the current thread to NATIVE (used by the new MM).
|
||||
|
||||
Reference in New Issue
Block a user