[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] RFC : Instrumentation in the vm integration guide
From: |
Nicolas Geoffray |
Subject: |
[cp-patches] RFC : Instrumentation in the vm integration guide |
Date: |
Sun, 04 Dec 2005 16:20:29 +0100 |
User-agent: |
Mozilla Thunderbird 1.0.7 (X11/20051019) |
Hi,
Here's a small documentation on how to use the instrumentation
functionnality in gnu classpath generics for vm implementers.
I added at the end that default implementation might break the
ClassLoader/VMClassLoader interface.
2005-12-04 Nicolas Geoffray <address@hidden>
* doc/vmintegration.texinfo: Added subsection in the
classpath
hooks for the VMInstrumentationImpl class.
Index: doc/vmintegration.texinfo
===================================================================
RCS file: /cvsroot/classpath/classpath/doc/vmintegration.texinfo,v
retrieving revision 1.19
diff -u -r1.19 vmintegration.texinfo
--- doc/vmintegration.texinfo 15 Jul 2005 09:04:46 -0000 1.19
+++ doc/vmintegration.texinfo 4 Dec 2005 15:15:52 -0000
@@ -226,6 +226,7 @@
* java.lang.VMRuntime::
* java.lang.VMString::
* java.lang.VMThread::
+* java.lang.VMInstrumentationImpl::
@end menu
@node java.lang.VMClass, java.lang.VMObject ,java.lang,java.lang
@@ -607,7 +608,7 @@
A VM may implement this differently by implementing this method,
which is @code{static} and the only one in @code{VMString}.
address@hidden java.lang.VMThread,, java.lang.VMString, java.lang
address@hidden java.lang.VMThread,java.lang.VMInstrumentationImpl,
java.lang.VMString, java.lang
@subsection @code{java.lang.VMThread}
@code{VMThread} provides the link between Java's threads and the platform
@@ -681,7 +682,43 @@
frames in the thread. This depends on the deprecated method @code{suspend()}
having returned true, and is thus deprecated as a result.
@end itemize
address@hidden itemize
+
address@hidden java.lang.VMInstrumentationImpl,, java.lang.VMThread, java.lang
address@hidden @code{java.lang.VMInstrumentationImpl}
+
+The @code{java.lang.VMInstrumentationImpl} and
address@hidden provides an implementation of the
address@hidden interface. This interface is for java
+1.5 and is only in the generics branch.
+A @code{InstrumentationImpl} object should be given to any agent
+given in the command line (see the @code{java.lang.instrument} package
+documentation). A VM has to implement the static native methods of the
address@hidden class.
+
address@hidden @bullet
address@hidden @code{isRedefineClassesSupported()} -- Returns if the JVM
supports
+class redefinition.
address@hidden @code{redefineClasses()} -- Gives a set of classes with new
bytecodes.
+The VM must redefine the classes by reading the new bytecodes.
address@hidden @code{getAllLoadedClass()} -- Returns an array of all loaded
classes.
address@hidden @code{getInitiatedClass()} -- Returns an array of all classes
loaded
+by a specific class loader.
address@hidden @code{getObjectSize()} -- Gives the size of an object.
address@hidden itemize
+
+When agents are defined, the VM has to call transformers of the
address@hidden object each time a class is loaded, eg a call to
address@hidden The @code{InstrumentationImpl} class defines
+a method that has to be called before reading a class file in the VM.
+
address@hidden @bullet
address@hidden @code{callTransformers} -- Calls each transformer registered to
+the @code{InstrumentationImpl} object and returns a new bytecode file.
address@hidden itemize
+
+No default implementation is provided in gnu classpath for the
address@hidden method. A default implementation will perhaps
+be written, but it might break the @code{ClassLoader/VMClassLoader} interface.
@node gnu.classpath, java.util, java.lang, Classpath Hooks
@section @code{gnu.classpath}
- [cp-patches] RFC : Instrumentation in the vm integration guide,
Nicolas Geoffray <=