This is the mail archive of the
java-discuss@sourceware.cygnus.com
mailing list for the Java project.
Re: Compiler errors while parsing bytecode files.
- To: Godmar Back <gback at cs dot utah dot edu>
- Subject: Re: Compiler errors while parsing bytecode files.
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Wed, 20 Oct 1999 10:59:53 +1300
- CC: aph at pasanda dot cygnus dot co dot uk, GChambers at provsol dot com, java-discuss at sourceware dot cygnus dot com
- References: <199910190131.TAA20307@faith.cs.utah.edu>
Godmar Back wrote:
> We just encountered and fixed that problem in Kaffe.
>
> Basically, all other javac compilers except jikes generate bad bytecode
> here. Gilad Bracha from Sun told me that they'll fix javac soon.
So, it looks like there are actually two bugs in gcj:
1. gcj fails to compile correct .java source when an interface method [a()] is
invoked on a reference to a sub-interface [B]. The correct behavior for "-C",
according to Godmar, would be to generate an "invokeinterface InterfaceMethodref
class: B name_and_type: <a ()void>", as jikes does, and not an "invokeinterface
InterfaceMethodref class: A name_and_type: <a ()void>" like current versions of
javac do. Currently, gcj does not seem to implement either of these ;-)
$ gcj *.java
Test.java: In class `Test':
Test.java: In method `main(java.lang.String[])':
Test.java:7: Can't find method `a()' in class `B'.
a.a();
2. gcj fails to compile the "correct" bytecode, ie: "invokeinterface
InterfaceMethodref class: B name_and_type: <a ()void>"
$ gcj *.class
Test.java: In class `Test':
Test.java: In method `main(java.lang.String[])':
Test.java:7: Class 'B' has no method named 'a' matching signature '()V'
I'm going to file a PR for each of these.
regards
[ bryce ]