On Tue, 12 Mar 2024 15:05:00 GMT, Richard Reingruber <rr...@openjdk.org> wrote:

> This pr changes  `JfrJvmtiAgent::retransform_classes()` and `jfr_set_enabled` 
> to switch to `WXWrite` before transitioning to the vm.
> 
> Testing:
> make test TEST=jdk/jfr/event/runtime/TestClassLoadEvent.java 
> TEST_VM_OPTS=-XX:+AssertWXAtThreadSync
> make test TEST=compiler/intrinsics/klass/CastNullCheckDroppingsTest.java 
> TEST_VM_OPTS=-XX:+AssertWXAtThreadSync
> 
> More tests are pending.

src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp line 160:

> 158:   ResourceMark rm(THREAD);
> 159:   // WXWrite is needed before entering the vm below and in callee 
> methods.
> 160:   MACOS_AARCH64_ONLY(ThreadWXEnable __wx(WXWrite, THREAD));

I understand you placed this here to cover the transition inside 
`create_classes_array` and the immediate one at line 170, but doesn't this risk 
having the wrong WX state for code in between?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18238#discussion_r1523127288

Reply via email to