Regarding current JVMTI improvements
Alan Bateman
Alan.Bateman at oracle.com
Thu Jan 21 12:04:55 UTC 2016
On 21/01/2016 10:27, Michael Rasmussen wrote:
> Hi
>
> Now that some changes are going into the JVMTI implementation in order to
> support modules, I just wanted to bring up the question I asked back in
> early December regarding support for setting the -Xpatch from JVMTI in
> the OnLoad phase, as well as the inability for JVMTI agents to instrument
> classes loaded before Start phase, due to CFLH events not being fired.
>
There is an issue with changing jdk.boot.class.path.append in the
Agent_OnLoad as we discussed a few weeks back. Lois is looking this as
JDK-8144730 [1]. A separate question is whether the JDK-specific
property jdk.boot.class.path.append will be documented property. We do
mention it in JEP 261 but it is not currently documented in the
System.getProperties() implementation note - this is something
potentially to discuss in the context of JDK-8136930 [2].
As regards the JVM TI spec and the CFLH event then it is a deliberate
change to only post this event in the Start and Live phases and to have
the Start phase be after the module system is initialized. To do it
otherwise would break existing agents that instrument code that executes
before the Live phase. We know this disadvantages agents that want to
instrument classes that are loaded and used early in the VM startup and
we will have a solution for this case once we have the "module-aware"
agent support, tracked as JDK-8146454 [3], in jake. I think we will have
to tie this to either a new JVM TI capability or a new "early start"
phase. I don't expect any issues for agents that are interested in
compilation events but there will be restrictions on agents that do
instrumentation before the current Start phase. From your other mails
then I understand it that you are patching classes in java.base so
assuming you aren't patching those classes to invoke code outside of
java.base then it should work with only minor updates to your agent.
-Alan
[1] https://bugs.openjdk.java.net/browse/JDK-8144730
[2] https://bugs.openjdk.java.net/browse/JDK-8136930
[3] https://bugs.openjdk.java.net/browse/JDK-8146454
More information about the jigsaw-dev
mailing list