[ecj] Register compiled classes with their initiating loader

Andrew Haley aph@redhat.com
Tue Nov 7 20:04:00 GMT 2006


We weren't registering classes returned from VMCompiler.compileClass()
with their initiating loader.

Also, in a fit of insanity, I inadvertently checked in a bogus change
to VMCompiler.compileClass().  Reverted here.

Andrew.


2006-11-07  Andrew Haley  <aph@redhat.com>

	* java/lang/VMCompiler.java (compileClass): Revert mistaken
	change.

	* java/lang/natVMClassLoader.cc (defineClass): Register the new
	class with the initiating loader.

Index: java/lang/natVMClassLoader.cc
===================================================================
--- java/lang/natVMClassLoader.cc	(revision 118520)
+++ java/lang/natVMClassLoader.cc	(working copy)
@@ -47,6 +47,9 @@
   jclass klass = VMCompiler::compileClass(loader, name, data,
 					  offset, length, pd);
 
+  if (klass)
+    _Jv_RegisterInitiatingLoader (klass, klass->loader);
+
 #ifdef INTERPRETER
   if (klass == NULL)
     {
Index: java/lang/VMCompiler.java
===================================================================
--- java/lang/VMCompiler.java	(revision 118521)
+++ java/lang/VMCompiler.java	(working copy)
@@ -187,8 +187,7 @@
 				   ProtectionDomain domain)
   {
     if (precompiledMapFiles == null
-	&& (! useCompiler || ! canUseCompiler)
-	|| name.startsWith("$Proxy"))
+	&& (! useCompiler || ! canUseCompiler))
       return null;
 
     byte digest[];



More information about the Java-patches mailing list