This is the mail archive of the java-discuss@sourceware.cygnus.com mailing list for the GCJ project. See the GCJ home page for more information.
One seriously weakness in Java is its ability to initialize static data tables. This is primarily because the VM does not have the ability to directly reference memory created by the compiler. Static data inevitably gets instantiated using hideously long sequences such as the following extracted from java/lang/Character.class: 11: newarray byte 13: dup 14: iconst_1 15: iconst_1 16: bastore 17: dup 18: iconst_2 19: iconst_2 20: bastore ... and so on ... 7031: sipush 1023 7034: bipush 121 7036: bastore 7037: putstatic #150=<Field java.lang.Character.X byte[]> Once compiled to native code this generates about 4-6 native code instructions for each byte stored and creates a totally bloated and inefficient initialization for a static table that could be initialized by the compiler. I would guess that once gcj can actually compile source code that these Java pregnancies would go away, but it would be nice if gcj could collect up all the constants between the `newarray byte' and the `putstatic' and do them within the compiler, effectively emiting the same byte table that a C++ compiler would create??? -- Jon Olson, Modular Mining Systems 3289 E. Hemisphere Loop Tucson, AZ 85706 INTERNET: olson@mmsi.com PHONE: (520)746-9127 FAX: (520)889-5790