[K/N] Fix SafePointSlowPath in STMS
^KT-48537 Merge-request: KT-MR-5257
This commit is contained in:
committed by
Space
parent
e36cc87b19
commit
7eb0798d64
@@ -103,12 +103,17 @@ ALWAYS_INLINE void gc::SameThreadMarkAndSweep::ThreadData::SafePointRegular(size
|
||||
}
|
||||
|
||||
NO_INLINE void gc::SameThreadMarkAndSweep::ThreadData::SafePointSlowPath(SafepointFlag flag) noexcept {
|
||||
RuntimeAssert(flag != SafepointFlag::kNone, "Must've been handled by the caller");
|
||||
// No need to check for kNeedsSuspend, because `suspendIfRequested` checks for its own atomic.
|
||||
threadData_.suspensionData().suspendIfRequested();
|
||||
if (flag == SafepointFlag::kNeedsGC) {
|
||||
RuntimeLogDebug({kTagGC}, "Attempt to GC at SafePoint");
|
||||
ScheduleAndWaitFullGC();
|
||||
switch (flag) {
|
||||
case SafepointFlag::kNone:
|
||||
RuntimeAssert(false, "Must've been handled by the caller");
|
||||
return;
|
||||
case SafepointFlag::kNeedsSuspend:
|
||||
threadData_.suspensionData().suspendIfRequested();
|
||||
return;
|
||||
case SafepointFlag::kNeedsGC:
|
||||
RuntimeLogDebug({kTagGC}, "Attempt to GC at SafePoint");
|
||||
ScheduleAndWaitFullGC();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user