diff options
-rw-r--r-- | src/gc/gchandletable.cpp | 10 | ||||
-rw-r--r-- | src/gc/gchandletableimpl.h | 4 | ||||
-rw-r--r-- | src/gc/gcinterface.h | 4 | ||||
-rw-r--r-- | src/vm/comdependenthandle.cpp | 11 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/gc/gchandletable.cpp b/src/gc/gchandletable.cpp index 52fede6299..ea02308e0b 100644 --- a/src/gc/gchandletable.cpp +++ b/src/gc/gchandletable.cpp @@ -147,6 +147,16 @@ bool GCHandleManager::StoreObjectInHandleIfNull(OBJECTHANDLE handle, Object* obj return !!::HndFirstAssignHandle(handle, ObjectToOBJECTREF(object)); } +void GCHandleManager::SetDependentHandleSecondary(OBJECTHANDLE handle, Object* object) +{ + ::SetDependentHandleSecondary(handle, ObjectToOBJECTREF(object)); +} + +Object* GCHandleManager::GetDependentHandleSecondary(OBJECTHANDLE handle) +{ + return OBJECTREFToObject(::GetDependentHandleSecondary(handle)); +} + Object* GCHandleManager::InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, Object* object, Object* comparandObject) { return (Object*)::HndInterlockedCompareExchangeHandle(handle, ObjectToOBJECTREF(object), ObjectToOBJECTREF(comparandObject)); diff --git a/src/gc/gchandletableimpl.h b/src/gc/gchandletableimpl.h index 01c1c130ed..a0a03ae3cb 100644 --- a/src/gc/gchandletableimpl.h +++ b/src/gc/gchandletableimpl.h @@ -59,6 +59,10 @@ public: virtual bool StoreObjectInHandleIfNull(OBJECTHANDLE handle, Object* object); + virtual void SetDependentHandleSecondary(OBJECTHANDLE handle, Object* object); + + virtual Object* GetDependentHandleSecondary(OBJECTHANDLE handle); + virtual Object* InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, Object* object, Object* comparandObject); }; diff --git a/src/gc/gcinterface.h b/src/gc/gcinterface.h index 425745b0cb..3cea6a184c 100644 --- a/src/gc/gcinterface.h +++ b/src/gc/gcinterface.h @@ -458,6 +458,10 @@ public: virtual bool StoreObjectInHandleIfNull(OBJECTHANDLE handle, Object* object) = 0; + virtual void SetDependentHandleSecondary(OBJECTHANDLE handle, Object* object) = 0; + + virtual Object* GetDependentHandleSecondary(OBJECTHANDLE handle) = 0; + virtual Object* InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, Object* object, Object* comparandObject) = 0; }; diff --git a/src/vm/comdependenthandle.cpp b/src/vm/comdependenthandle.cpp index 4763e4833a..b021865d53 100644 --- a/src/vm/comdependenthandle.cpp +++ b/src/vm/comdependenthandle.cpp @@ -73,8 +73,9 @@ FCIMPL2(Object*, DependentHandle::nGetPrimaryAndSecondary, OBJECTHANDLE handle, OBJECTREF primary = ObjectFromHandle(handle); + IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); // Secondary is tracked only if primary is non-null - *outSecondary = (primary != NULL) ? OBJECTREFToObject(GetDependentHandleSecondary(handle)) : NULL; + *outSecondary = (primary != NULL) ? mgr->GetDependentHandleSecondary(handle) : NULL; return OBJECTREFToObject(primary); } @@ -86,8 +87,8 @@ FCIMPL2(VOID, DependentHandle::nSetPrimary, OBJECTHANDLE handle, Object *_primar _ASSERTE(handle != NULL); - OBJECTREF primary(_primary); - StoreObjectInHandle(handle, primary); + IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); + mgr->StoreObjectInHandle(handle, _primary); } FCIMPLEND @@ -97,7 +98,7 @@ FCIMPL2(VOID, DependentHandle::nSetSecondary, OBJECTHANDLE handle, Object *_seco _ASSERTE(handle != NULL); - OBJECTREF secondary(_secondary); - SetDependentHandleSecondary(handle, secondary); + IGCHandleManager *mgr = GCHandleUtilities::GetGCHandleManager(); + mgr->SetDependentHandleSecondary(handle, _secondary); } FCIMPLEND |