[LEGACY MM] Escape making extra increments and decrements during coping to the same array (#4731)

(cherry picked from commit 8b601d8e2c6bc772386ebd88d303a032a6f54237)
This commit is contained in:
LepilkinaElena
2021-03-04 13:54:49 +03:00
committed by Space
parent f9f948fea6
commit fcbb921194
7 changed files with 70 additions and 8 deletions
@@ -189,6 +189,11 @@ extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateHeapRefIfNull(ObjHeader** lo
mm::CompareAndSwapHeapRef(location, nullptr, const_cast<ObjHeader*>(object), &result);
}
extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateHeapRefsInsideOneArray(const ArrayHeader* array, int fromIndex,
int toIndex, int count) {
RuntimeFail("Only for legacy MM");
}
extern "C" ALWAYS_INLINE RUNTIME_NOTHROW void UpdateReturnRef(ObjHeader** returnSlot, const ObjHeader* object) {
mm::SetStackRef(returnSlot, const_cast<ObjHeader*>(object));
}