But retransform in this phase would still be subject to the same limitations about no structural changes I assume? Meaning no adding of members etc.
My preferred solution would still be if adding (and changing) Xpatch would be possible during OnLoad, as that should solve all my problems. /Michael On Apr 4, 2016 14:30, "Alan Bateman" <alan.bate...@oracle.com> wrote: > On 04/04/2016 12:09, Michael Rasmussen wrote: > >> So in order to patch any of the well-known preloaded classes, I will need >> to prepatch them, put them in a folder/jar, and then need to ask the user >> to specify the -Xpatch jvm option, seeing as I don't have the option to >> neither patch them via CFLH, nor add -Xpatch myself from jvmti? >> >> As things stand then -Xpatch is the only way to have patched versions of > the preloaded classes loaded in the primordial phase. > > That said, we have enough in place where we could look at allowing > GetLoadedClasses and RetransformClasses in the start phase. When combined > with can_generate_early_vmstart then it would allow agents to patch classes > before any bytecode executes. As per the warnings in the spec then any > instrumentation at this point requires great care as it's still too early > in the VM startup for code outside of java.base to execute. > > -Alan >