dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Java compiler , more news


From: Gopal V
Subject: [DotGNU]Java compiler , more news
Date: Fri, 25 Apr 2003 23:21:43 +0530
User-agent: Mutt/1.2.5i

Hi,
        I'm uploading my patches for the java compiler to:

http://symonds.net/~gopalv82/code/java_patches.tgz

The latest release handles a lot of simple things a lot better...
for example :-

int x[][][]; int []x[][]; int [][]x[]; and int [][][]x;

will work the same ...

Also the array initializations work out right ... Since IL does not
have the equivalent of the JVM's "multinewarray" this takes a turn
for the worse with a helper function for arrays.

so int [][]x=new int[10][10]; does the equivalent of

int [][]x=new int[10][]; // ldc.i4.s 10, newarr int[] 
for(int i=0;i<10;i++)x[i]=new int[10]; // ldc.i4.s 10, newarr int

And overriding of functions work ... which is again good news.
That had run into problems because the compiler has to do code analysis
to determine overriding issues.

class A { public void X() {} }
class B extends A { public void X() {} }

is an override , IIRC . C# made things a lot easier by the use of
"virtual" and "override" keywords.

The class library is practically NIL with Integer and Long classes 
adapted from GNU Classpath. That is the really patchy build part .

To get a single java.lang.dll from source code partly in C# and partly
in Java ... I use something like this ..

make bootstrap.dll and bootstrap.o from C# parts using cscc
make java.lang.o using -lbootstrap.dll
make java.lang.dll from java.lang.o and bootstrap.o

Also in case I forget , I am using __in__ and __out__ for the System.in
field for the java.lang class. Replace in assembly code with SED :-(.
Terribly uportable, I need Rhys's advice here.

Last but not least, an unsolvable issue. All exceptions are inherited from
System.Exception , All java classes from java.lang.Object .. and no 
multiple inheritance (which is a good thing ;-) . So currently 

Exception e=new Exception();
bool b =e instanceof Object; // false But
Object c=(Object)e; // works 
e=(Exception)c; // works 

I think it's ripe for inclusion into cvs ... I'll try to show up for
tomorrow's first meet and talk it out with Rhys and others concerned.

To avoid the usual build problems the java_patches.tgz has a script
called makejava.sh ... Just edit it, fix the PNET_PATH directory and
run it.

Last but not least a peice of regularly controversial trivial benchmark.
(java_examples.tgz in the tarball)

                      lines   javac  cscc (msecs)
AllOps.java          | 419  |  1059 | 23 |
Arith.java           | 16   |  1035 | 21 |
Array.java           | 25   |  1038 | 21 |
BitWiseSwap.java     | 14   |  1039 | 22 |
ConstantFolded.java  | 13   |  1036 | 21 |
CRC32.java           | 205  |  1059 | 24 |
For.java             | 13   |  1036 | 20 |
HelloWorld.java      | 7    |  1032 | 21 |
IFaceImplementor.java| 17   |  1038 | 20 |
SieveBenchmark.java  | 60   |  1045 | 22 |
Switch.java          | 18   |  1036 | 22 |
TestException.java   | 32   |  1040 | 22 |
Virtual.java         | 24   |  1037 | 21 |
While.java           | 13   |  1037 | 21 |
WierdDecl.java       | 15   |  1036 | 20 |

All these timings were measured against the total execution time 
which is not at all fair as javac probably checks all the .jars
in the classpath (all of which were distributed with the jdk1.2.2).

The javac used is the Blackdown port of jdk1.2.2 .. 

I really don't think this reflects against a real application being
compiled , so making no claims about speed ... Also I'm pleased to
note that ilrun is offering similar performance to kaffe in Total
Execution Time for the SieveBenchmark I ported off pnetmark.

And that's the game !
Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]