mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
!9996 fix local gc wait shared gc processRset
Merge pull request !9996 from jinjiawei/waitsharedgc
This commit is contained in:
commit
999f1a121e
@ -800,6 +800,11 @@ bool JSThread::CheckSafepoint()
|
||||
}
|
||||
#endif
|
||||
auto heap = const_cast<Heap *>(GetEcmaVM()->GetHeap());
|
||||
// Do not trigger local gc during the shared gc processRset process.
|
||||
if (heap->IsProcessingRset()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle exit app senstive scene
|
||||
heap->HandleExitHighSensitiveEvent();
|
||||
|
||||
|
@ -1516,6 +1516,16 @@ public:
|
||||
return gcType_ == TriggerGCType::YOUNG_GC || gcType_ == TriggerGCType::EDEN_GC;
|
||||
}
|
||||
|
||||
bool IsProcessingRset() const
|
||||
{
|
||||
return isProcessingRset_;
|
||||
}
|
||||
|
||||
void SetProcessingRset(bool processing)
|
||||
{
|
||||
isProcessingRset_ = processing;
|
||||
}
|
||||
|
||||
void EnableEdenGC();
|
||||
|
||||
void TryEnableEdenGC();
|
||||
@ -1739,6 +1749,7 @@ private:
|
||||
bool fullMarkRequested_ {false};
|
||||
bool oldSpaceLimitAdjusted_ {false};
|
||||
bool enableIdleGC_ {false};
|
||||
bool isProcessingRset_ {false};
|
||||
std::atomic_bool isCSetClearing_ {false};
|
||||
HeapMode mode_ { HeapMode::NORMAL };
|
||||
|
||||
|
@ -173,6 +173,7 @@ inline void SharedGCMarkerBase::ProcessVisitorOfDoMark(uint32_t threadId)
|
||||
for (RSetWorkListHandler *handler : rSetHandlers_) {
|
||||
ECMA_BYTRACE_NAME(HITRACE_TAG_ARK, "SharedGCMarker::ProcessRSet");
|
||||
handler->ProcessAll(visitor);
|
||||
handler->GetHeap()->SetProcessingRset(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@ void SharedGCMarkerBase::CollectLocalVMRSet(EcmaVM *localVm)
|
||||
Heap *heap = const_cast<Heap*>(localVm->GetHeap());
|
||||
RSetWorkListHandler *handler = new RSetWorkListHandler(heap);
|
||||
heap->SetRSetWorkListHandler(handler);
|
||||
heap->SetProcessingRset(true);
|
||||
rSetHandlers_.emplace_back(handler);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user