mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-10-07 08:03:29 +00:00
!8866 Remove jit lockholder in shared
Merge pull request !8866 from xiongluo/remove_jit_lock_shared
This commit is contained in:
commit
5322193b0b
@ -435,15 +435,11 @@ void SharedHeap::Prepare(bool inTriggerGCThread)
|
||||
|
||||
SharedHeap::SharedGCScope::SharedGCScope()
|
||||
{
|
||||
bool enableJit = Jit::GetInstance()->IsEnableFastJit() || Jit::GetInstance()->IsEnableBaselineJit();
|
||||
Runtime::GetInstance()->GCIterateThreadList([enableJit](JSThread *thread) {
|
||||
Runtime::GetInstance()->GCIterateThreadList([](JSThread *thread) {
|
||||
std::shared_ptr<pgo::PGOProfiler> pgoProfiler = thread->GetEcmaVM()->GetPGOProfiler();
|
||||
if (pgoProfiler != nullptr) {
|
||||
pgoProfiler->SuspendByGC();
|
||||
}
|
||||
if (enableJit) {
|
||||
Jit::JitGCLockHolder::LockJit(thread);
|
||||
}
|
||||
#if defined(ECMASCRIPT_SUPPORT_CPUPROFILER)
|
||||
thread->SetGcState(true);
|
||||
#endif
|
||||
@ -452,17 +448,13 @@ SharedHeap::SharedGCScope::SharedGCScope()
|
||||
|
||||
SharedHeap::SharedGCScope::~SharedGCScope()
|
||||
{
|
||||
bool enableJit = Jit::GetInstance()->IsEnableFastJit() || Jit::GetInstance()->IsEnableBaselineJit();
|
||||
Runtime::GetInstance()->GCIterateThreadList([enableJit](JSThread *thread) {
|
||||
Runtime::GetInstance()->GCIterateThreadList([](JSThread *thread) {
|
||||
ASSERT(!thread->IsInRunningState());
|
||||
const_cast<Heap *>(thread->GetEcmaVM()->GetHeap())->ProcessGCListeners();
|
||||
std::shared_ptr<pgo::PGOProfiler> pgoProfiler = thread->GetEcmaVM()->GetPGOProfiler();
|
||||
if (pgoProfiler != nullptr) {
|
||||
pgoProfiler->ResumeByGC();
|
||||
}
|
||||
if (enableJit) {
|
||||
Jit::JitGCLockHolder::UnlockJit(thread);
|
||||
}
|
||||
#if defined(ECMASCRIPT_SUPPORT_CPUPROFILER)
|
||||
thread->SetGcState(false);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user