The current implementation of FastJNIAccessors ignores the flag -XX:+UseFastJNIAccessors when the JVMTI capability "can_post_field_access" is enabled.
This is an unnecessary restriction which makes field accesses (Get<Type>Field) from native code slower when a JVMTI agent is attached which enables this capability.
A better implementation would check at runtime if an agent actually wants to receive field access events.
Note that the bytecode interpreter already uses this better implementation by checking if field access watch events were requested (JvmtiExport::_field_access_count != 0).
This is an unnecessary restriction which makes field accesses (Get<Type>Field) from native code slower when a JVMTI agent is attached which enables this capability.
A better implementation would check at runtime if an agent actually wants to receive field access events.
Note that the bytecode interpreter already uses this better implementation by checking if field access watch events were requested (JvmtiExport::_field_access_count != 0).
- relates to
-
JDK-8208065 jniFastGetField can crash on Windows-x64-debug
-
- Closed
-