This is the mail archive of the java-discuss@sourceware.cygnus.com 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]

Re: Compiler errors while parsing bytecode files.


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 ]




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