This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: Array classes and Constant-time dispatch
- To: java-patches at sourceware dot cygnus dot com
- Subject: Patch: Array classes and Constant-time dispatch
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Thu, 09 Mar 2000 22:31:15 +1300
I have committed this patch, which fixes a bug in the new interface
dispatch code. Array classes implement Serializable and Cloneable, so
they need to have an interface dispatch table (idt). This was causing a
NullPointerException in testsuite/java.lang/Array_1.java
Three other issues have come up:
1. Doesn't _Jv_FindArrayClass() need to be synchronized? At least the
parts below the cache lookups. Or am I missing some implicit
synchronization somewhere?
2. Array_1.java still crashes, because for some reason
System.out.println(class) doesnt work! This seems to be related to
PR libgcj/100. Weird.
3. gnats is acting up again, whats with those "Pending" PRs?
regards
[ bryce ]
2000-03-09 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/natClassLoader.cc (_Jv_FindArrayClass): Call
_Jv_PrepareConstantTimeTables.
* java/lang/natClass.cc (_Jv_PrepareConstantTimeTables): Array
classes should have an IDT, so don't return if klass is an array
class.
Index: java/lang/natClass.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natClass.cc,v
retrieving revision 1.19
diff -u -r1.19 natClass.cc
--- natClass.cc 2000/03/07 19:55:26 1.19
+++ natClass.cc 2000/03/09 09:13:35
@@ -1005,8 +1005,7 @@
klass0 = klass0->superclass;
}
- if (klass->isArray ()
- || java::lang::reflect::Modifier::isAbstract (klass->accflags))
+ if (java::lang::reflect::Modifier::isAbstract (klass->accflags))
return;
klass->idt =
Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.20
diff -u -r1.20 natClassLoader.cc
--- natClassLoader.cc 2000/03/07 19:55:26 1.20
+++ natClassLoader.cc 2000/03/09 09:13:54
@@ -584,6 +584,9 @@
array_class->interfaces = interfaces;
array_class->interface_count = 1;
+ // Generate the interface dispatch table.
+ _Jv_PrepareConstantTimeTables (array_class);
+
// as per vmspec 5.3.3.2
array_class->accflags = element->accflags;