diff options
author | 2023-01-13 13:32:21 +0000 | |
---|---|---|
committer | 2023-01-16 13:32:54 +0000 | |
commit | 733b0202736dde8508f7764bbf98e92684002acc (patch) | |
tree | 4d6b6f6ff503b6639c36a281246780ee4637340d /openjdkjvmti/deopt_manager.cc | |
parent | ae12f96965dd1fb1cf5fefb0188b749e921ba88b (diff) |
Reland "Limited deopt request from jvmti should enable entry / exit hooks""
This reverts commit b69a3ebf5a4a4ef8ae25db170fce9e25844a2f1b.
Reason for revert: Re-landing with a fix.
It is OK to use resolution stubs when entry / exit stubs are required.
Resolution stubs fetch code that supports entry / exit hooks when required.
Change-Id: I0e7d807df2c92249cd17e2a5df324ac47e248874
Diffstat (limited to 'openjdkjvmti/deopt_manager.cc')
-rw-r--r-- | openjdkjvmti/deopt_manager.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/openjdkjvmti/deopt_manager.cc b/openjdkjvmti/deopt_manager.cc index 129aa0ff4a..99acb87257 100644 --- a/openjdkjvmti/deopt_manager.cc +++ b/openjdkjvmti/deopt_manager.cc @@ -496,6 +496,15 @@ void DeoptManager::AddDeoptimizationRequester() { art::ScopedThreadStateChange stsc(self, art::ThreadState::kSuspended); deoptimization_status_lock_.ExclusiveLock(self); deopter_count_++; + if (deopter_count_ == 1) { + // When we add a deoptimization requester, we should enable entry / exit hooks. We only call + // this in debuggable runtimes and hence it won't be necessary to update entrypoints but we + // still need to inform instrumentation that we need to actually run entry / exit hooks. Though + // entrypoints are capable of running entry / exit hooks they won't run them unless enabled. + ScopedDeoptimizationContext sdc(self, this); + art::Runtime::Current()->GetInstrumentation()->EnableEntryExitHooks(kInstrumentationKey); + return; + } deoptimization_status_lock_.ExclusiveUnlock(self); } |