classpath-patches
[Top][All Lists]
Advanced

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

[cp-patches] [generics] FYI: New Instrumentation parameter to VMInstrume


From: Nicolas Geoffray
Subject: [cp-patches] [generics] FYI: New Instrumentation parameter to VMInstrumentationImpl.redefineClasses
Date: Sun, 04 Dec 2005 14:11:19 +0100
User-agent: Mozilla Thunderbird 1.0.7 (X11/20051019)

Here's a fix that eases implementation of the VMInstrumentationImpl.redefineClasses method. The VM might not want to keep the Instrument object, therefore it must
be given explicitely to the VMInstrumentationImpl.redefineClasses method

2005-12-04  Nicolas Geoffray  <address@hidden>
        
        * vm/reference/java/lang/VMInstrumentationImpl.java
        (redefineClasses): Added an extra parameter of type
        java.lang.instrument.Instrument.
        *java/lang/InstrumentationImpl.java
        (redefineClasses): Added the Instrumentation object
        to the arguments of VMInstrumentationImpl.redefineClasses
        call.


Index: java/lang/InstrumentationImpl.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/java/lang/Attic/InstrumentationImpl.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 InstrumentationImpl.java
--- java/lang/InstrumentationImpl.java  3 Dec 2005 15:26:35 -0000       1.1.2.1
+++ java/lang/InstrumentationImpl.java  4 Dec 2005 13:01:02 -0000
@@ -154,7 +154,7 @@
     if (!isRedefineClassesSupported())
       throw new UnsupportedOperationException();
     
-    VMInstrumentationImpl.redefineClasses(definitions);
+    VMInstrumentationImpl.redefineClasses(this, definitions);
   }
 
 
Index: vm/reference/java/lang/VMInstrumentationImpl.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/vm/reference/java/lang/Attic/VMInstrumentationImpl.java,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 VMInstrumentationImpl.java
--- vm/reference/java/lang/VMInstrumentationImpl.java   3 Dec 2005 15:26:35 
-0000       1.1.2.1
+++ vm/reference/java/lang/VMInstrumentationImpl.java   4 Dec 2005 13:01:20 
-0000
@@ -40,6 +40,7 @@
 package java.lang;
 
 import java.lang.instrument.ClassDefinition;
+import java.lang.instrument.Instrumentation;
 
 /**
  * @author Nicolas Geoffray (address@hidden)
@@ -59,6 +60,7 @@
    * Redefines classes given as parameters. The method has to call
    * the callTransformers from InstrumentationImpl
    *
+   * @param inst an instrumentation object
    * @param definitions an array of bytecode<->class correspondance
    *
    * @throws ClassNotFoundException if a class cannot be found 
@@ -74,7 +76,8 @@
    * classes
    * @throws LinkageError if a linkage error occurs 
    */
-  static native void redefineClasses(ClassDefinition[] definitions);
+  static native void redefineClasses(Instrumentation inst,
+      ClassDefinition[] definitions);
  
   /**
    * Get all the classes loaded by the JVM.

reply via email to

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