Accessing module internals from bytecode rewriting agent
Alan Bateman
Alan.Bateman at oracle.com
Tue Apr 25 06:35:50 UTC 2017
On 25/04/2017 07:22, Jeremy Manson wrote:
> :
>
> The instrument API specifically supports a Boot-Class-Path attribute in the
> MANIFEST, as well as Instrumentation.appendToBootStrapClassLoaderSearch. I
> had been using that as a way to make it possible to rewrite JDK internals
> (add allocation instrumentation to them).
I wouldn't expect any issues with that scenario as the VM adds the
readability needed for this to work. From the javadoc:
"As an aid to agents that deploy supporting classes on the search path
of the bootstrap class loader, or the search path of the class loader
that loads the main agent class, the Java virtual machine arranges for
the module of transformed classes to read the unnamed module of both
class loaders."
Instead, I think the issue in Martin's mail is more to do with Byteman
moving to java.lang.invoke and running into an issue getting full power
lookups to fully privileged classes.
-Alan.
More information about the core-libs-dev
mailing list