[ nice-Bugs-1286427 ] bytecode uses interfaces too much
"SourceForge.net" <[email protected]> Tue, 20 Sep 2005 06:59:36 -0700
| Newsgroups | gmane.comp.lang.nice.devel |
|---|---|
| Message-ID | <[email protected]> |
Bugs item #1286427, was opened at 2005-09-10 07:49
Message generated for change (Comment added) made by bonniot
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1286427&group_id=12788
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Artem Gr Kozarezov (artemgr)
Assigned to: Nobody/Anonymous (nobody)
Summary: bytecode uses interfaces too much
Initial Comment:
Consider an example, hastily taken from a real-life:
public interface SmartResponseData {}
class DeflateOStream extends java.io.OutputStream
implements SmartResponseData {}
public class SmartResponse {
?SmartResponseData os = null;
}
public void finish(SmartResponse sr){
let os = sr.os;
if (os instanceof DeflateOStream) os.close();
}
The "os.close()" here will emit the
aload_N
instanceof DeflateOStream
ifeq NN
aload_N
checkcast java/io/Closable
invokeinterface java/io/Closable.close
under Nice 0.9.12, Java 1.5.0_04.
java/io/Closable is absent from Java 1.4, therefore the
code which is perfectly compatible with Java 1.4
becames incompatible becouse Nice used a Closable
interface to invoke close.
Nice should have preferred direct invocation of
checkcast DeflateOStream
invoke DeflateOStream.close
or nearest invocation of
checkcast java/io/OutputStream
invoke java/io/OutputStream.close
whereas Nice seems to choose which class to use for
invocation just at random.
----------------------------------------------------------------------
>Comment By: Daniel Bonniot (bonniot)
Date: 2005-09-20 15:59
Message:
Logged In: YES
user_id=88952
I was first tempted to answer "why not compile with 1.4 if
you want to be compatible with it?". But I looked into it,
and it might be easy enough to get the desired behaviour. It
might even bring some runtime speedup (in case the JIT does
not optimize it already). I'm checking the change at the moment.
Note that to be sure to be compatible with a certain JRE
version, you better compile with the corresponding JDK, but
I guess you know that ;-)
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=1286427&group_id=12788
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php