On Mon, 25 Jan 2021 14:36:35 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> Anton Kozlov has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - Address feedback for signature generators
>>  - Enable -Wformat-nonliteral back
>
> src/hotspot/share/jfr/instrumentation/jfrJvmtiAgent.cpp line 87:
> 
>> 85:   JavaThread* jt = JavaThread::thread_from_jni_environment(jni_env);
>> 86:   DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_native(jt));;
>> 87:   Thread::WXWriteFromExecSetter wx_write;
> 
> Is this on every transition to VM from Native?  Would it be better to add to 
> ThreadInVMfromNative like the ResetNoHandleMark is?

I've tried to do something like this initially. The idea was to use Write in VM 
state and Exec in Java and Native states. However, for example, JIT runs in the 
Native state and needs Write access. So instead, W^X is managed on entry and 
exit from VM code, in macros like JRT_ENTRY. Unfortunately, not every JVM entry 
function is defined with an appropriate macro (at least for now), so I had to 
add explicit W^X state management along with the explicit java thread state, 
like here.

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

PR: https://git.openjdk.java.net/jdk/pull/2200

Reply via email to