classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cp-patches] [generics] RFC : implementation of java.lang.instrument


From: Nicolas Geoffray
Subject: Re: [cp-patches] [generics] RFC : implementation of java.lang.instrument package
Date: Sat, 26 Nov 2005 19:11:54 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051019)


Nicolas> Where this class should be : Nicolas> gnu/java/lang/instrument/InstrumentationImpl.java?

Yes, that is the correct package to use.  The name of the class is
less strictly defined by Classpath, but that name sounds fine to me.

Yes, that name is OK. I don't know how much we can actually share
between runtimes though. The interface is pretty minimal already, so a
split between VMInstrumentationImpl and InstrumentationImpl that calls
the VM class seems overkill.

The InstrumentationImpl.getObjectSize is clearly a native for vm.
And we also need a native redefineClass(Class, byte[]).

If we don't provide a VMInstrumentationImpl class, would
these method be native in InstrumentationImpl? (I thought
vm implementors only had to care about vm/reference/* files?)

Do you think you can come up with something
that can easily be shared by runtimes? Maybe you could hook into the
default ClassLoader.defineClass() implementation to implement this?

Because it's the vm that parses arguments, it knowns if the
application does instrumentation. Therefore, if it supports
redefining classes, it can set a flag or change definition of
VMClassLoader.defineClass. The vm then creates an
InstrumentationImpl object and calls premain.

The VMClassLoader.defineClass will be changed to call a
private InstrumentationImpl.defineClass method. This method will then call
each transformer.

Does that sound correct to you? This way I don't modify ClassLoader.defineClass.


Cheers,

Nicolas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]