On 7/31/06, Gregory Shimansky <[EMAIL PROTECTED]> wrote:

2006/7/31, Jimmy, Jing Lv <[EMAIL PROTECTED]>:
>
> >       Besides, Harmony VM now has actually support the feature of
JVMTI
> > on which we can implement instrument.
> >
>
> Ah, can it work now? It'll be great convenient if so.


Hello. The drlvm does support a subset of JVMTI. Class loading events are
supported, ClassFileLoadHook which may be used for load time class
instrumentation is supported too. But there is no support for
RedefineClasses yet if you need to change classes bytecode after the class
was loaded already.

>
> >    After some study on this, I find Java interface classes/interfaces
> >> are quite easy, but there should be real implement, both in java and
> >> native. And the native code requires JVMTI[2], which is a part of VM
5.
> >> Though, luckily we can still study and code according to JVMTI and
test
> >> on RI. So my goal is : 1.define those simple Java classes/interfaces
in
> >> Harmony; 2. work out implementation of java/native code according to
> >> JVMTI and make it run on RI; 3. wait for Harmony VM5 and then make
some
> >> integration modification/test.
> >
> >
> >      As the main function of instruments is to add and remove
> transformers
> > to some classes, I suggest implement it as an agent of JVMTI. That is
to
> > register callback functions, which actually transform the byte stream
of
> > some specified classes,  to the events that is relevent to instrument
in
> > JVMTI including
> > the class loading.
> >
>
> Yes, that's the way.


I agree with this approach. Do you know which API functions and events you
will need for such agent?


Hi, we will need VM Initialization Event to run premain functions and Class
File Load Hook Event for agents to instruct the existing class file. As to
the jvmti API, we need RedefineClasses,GetObjectSize and Allocate. Besides,
AddCapabilities is also required to turn on the capability of the VM, such
as can_generate_all_class_hook_events and can_redefine_classes.

Since we have just planned to implement this module, please excuse me if I
leave some requirements about it. :)



--
Gregory Shimansky, Intel Middleware Products Division




--
Leo Li
China Software Development Lab, IBM

Reply via email to