This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: Layout interfaces during preparation


Interfaces only need to be initialized if they contain static initializers, so its wrong to layout the _Jv_Method entries from there. Mark noticed that Method.invoke() on an interface would fail in some circumstances because initialization had not been run. No testsuite regressions. I'm checking this in.

Regards

Bryce

2004-05-21  Bryce McKinlay  <mckinlay@redhat.com>

	Layout interfaces during preparation, not initialization. 
	* java/lang/natClass.cc (initializeClass): Move 
	_Jv_LayoutInterfaceMethods call...
	* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): to here.

Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClass.cc,v
retrieving revision 1.77
diff -u -r1.77 natClass.cc
--- java/lang/natClass.cc	21 Apr 2004 19:26:22 -0000	1.77
+++ java/lang/natClass.cc	21 May 2004 16:06:07 -0000
@@ -790,9 +790,6 @@
 	}
     }
 
-  if (isInterface ())
-    _Jv_LayoutInterfaceMethods (this);
-
   _Jv_PrepareConstantTimeTables (this);
 
   if (vtable == NULL)
Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.65
diff -u -r1.65 natClassLoader.cc
--- java/lang/natClassLoader.cc	20 Apr 2004 01:38:46 -0000	1.65
+++ java/lang/natClassLoader.cc	21 May 2004 16:06:07 -0000
@@ -170,6 +170,9 @@
     }
 #endif /* INTERPRETER */
 
+  if (klass->isInterface ())
+    _Jv_LayoutInterfaceMethods (klass);
+
   klass->notifyAll ();
 
   _Jv_PushClass (klass);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]