L1A compiler testing

I think the L1A compiler is ready for large scale testing. On my system, the compilers generates working code and I would really like to know if that is true for all of you also, before I switch to it as default compiler.

So please test it and report the results... how...

- Update from CVS
- Build with "build.bat/sh -Djnode.compiler=l1a"
- Boot JNode
- Report results

Thanks and in the mean time, have a look at the new performance numbers!

Also a big thanks to Patrik Reali who started this compiler, since it is smart and generates much faster code!

Ewout

build error with L1A compiler and eclipse

Hi,
I have tried to compile JNode with the L1A Compiler.
I got this error:

[bootjar] Building boot-jar took 6700ms
[bootimage] Building for CPU: name:GenuineIntel family:0 model:0 step:0 features:FPU,PSE raw:00000001 756E6547 6C65746E 49656E69 00000000 00000000 00000000 00000009
[bootimage] Compiling using X86-Stub and X86-L1A compilers
[bootimage] Pool state after push of 2:
[bootimage] eax used by 5,2 (9204300)
[bootimage] edx used by 5,2 (10739177)
[bootimage] ecx used by 5,2 (9204300)
[bootimage] ebx free
[bootimage] esi used by null
[bootimage] Warning: cannot load system default encoding 'Cp1252': Cp1252
[bootimage] Use of in-exact matching class (java.util.Hashtable) in bootimage at gnu.java.io.EncodingManager
[bootimage] Use of in-exact matching class (java.util.HashMap) in bootimage at gnu.java.lang.ClassHelper
[bootimage] Use of in-exact matching class (java.security.AllPermission) in bootimage at gnu.java.security.provider.DefaultPolicy
[bootimage] Use of in-exact matching class (java.lang.ThreadLocal) in bootimage at org.jnode.vm.x86.compiler.l1a.ItemFactory
[bootimage] Use of in-exact matching class (java.io.OutputStreamWriter) in bootimage at java.io.Writer
[bootimage] Use of in-exact matching class (java.lang.StringBuffer) in bootimage at org.apache.log4j.PatternLayout
[bootimage] java.lang.NullPointerException
[bootimage] at java.text.DateFormat.hashCode(DateFormat.java:620)
[bootimage] at org.jnode.assembler.x86.X86Stream$Key.hashCode(X86Stream.java:65)
[bootimage] at java.util.HashMap.hash(HashMap.java:261)
[bootimage] at java.util.HashMap.get(HashMap.java:317)
[bootimage] at org.jnode.assembler.x86.X86Stream.getObjectRef(X86Stream.java:344)
[bootimage] at org.jnode.assembler.x86.X86Stream.writeObjectRef(X86Stream.java:2003)
[bootimage] at org.jnode.assembler.x86.X86Stream.writeObjectRef(X86Stream.java:1982)
[bootimage] at org.jnode.build.ObjectEmitter.emitObject(ObjectEmitter.java:338)
[bootimage] at org.jnode.build.ObjectEmitter.emitObject(ObjectEmitter.java:116)
[bootimage] at org.jnode.build.AbstractBootImageBuilder.emitObjects(AbstractBootImageBuilder.java:572)
[bootimage] at org.jnode.build.AbstractBootImageBuilder.doExecute(AbstractBootImageBuilder.java:399)
[bootimage] at org.jnode.build.AbstractBootImageBuilder.execute(AbstractBootImageBuilder.java:635)
[bootimage] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[bootimage] at org.apache.tools.ant.Task.perform(Task.java:364)
[bootimage] at org.apache.tools.ant.Target.execute(Target.java:301)
[bootimage] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[bootimage] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[bootimage] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:383)
[bootimage] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
[bootimage] at org.apache.tools.ant.Task.perform(Task.java:364)
[bootimage] at org.apache.tools.ant.Target.execute(Target.java:301)
[bootimage] at org.apache.tools.ant.Target.performTasks(Target.java:328)
[bootimage] at org.apache.tools.ant.Project.executeTarget(Project.java:1215)
[bootimage] at org.apache.tools.ant.Project.executeTargets(Project.java:1063)
[bootimage] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:377)
[bootimage] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:135)

I have completly checked out JNode but it did not help.
I tried to build JNode with the build.bat and it works.

Has anyone an idea how to make eclipse build JNode?

Andreas

External Ant

Always use an external Ant, or better Ant in it's own process.

Ewout

it runs in seperate JRE

Hi,

as said it builds from the batch file.
Within Eclipse I checked the options an ant runs in a seperate JRE.

At least I can compile JNode and I had no errors dealing with the new compiler (that was my first impression).

Andreas

not tested yet

Hi,

I didn't tested it,
but as it's name is l1a it is a not optimizing compiler?

Andreas

About the L1A compiler

The L1A compiler is based on the following research paper:

Adl-Tabatabai, Cierniak, Lueh, Parikh, Stichnoth
Fast, effective code generation in a just-in-time Java compiler
PLDI 1998

the implementation is a simplified version without CSE (common subexpression elimination) which generates code in one pass over the bytecode.

-Patrik

where to find it?

Hi,
here is the link to the page of this paper :
Fast, effective code generation in a just-in-time Java compiler

Andreas

Optimizing?

L1A is a non-optimizing comiler in the sense of intelligent optimizations, but it does register allocation.

Ewout

thx4info

Hi,
thanks for that info.

Andreas

ArrayIndexOutOfBounds

Hi Ewout,
It is great to see this nice progress with the L1A compiler!

I could boot the system compiled with L1a fine in VMWare and directly on the hardware (Athlon XP 1800+) but in both cases I get an exception most of the time while making file operations on an ext2 partition.

The ArrayIndexAoutOfBoundException comes from Ext2FileSystem.java line 502

int group = (int) ((iNodeNr - 1) / superblock.getINodesPerGroup());
int index = (int) ((iNodeNr - 1) % superblock.getINodesPerGroup());

//get the part of the inode table that contains the inode
INodeTable iNodeTable = iNodeTables[group]; -------------------- HERE
INode result = new INode(this, new INodeDescriptor(iNodeTable, iNodeNr,
group, index));

It seems that it is related to an operation on a long value somehow.

Regards,
Levente

Exception message

Hi Levente,
What is the exception message (especially the reported index).

Ewout

The exception message is:

Out of bounds at index 208127224 .

Levente

Debugging

Hi,

Can you debug what the actual index is. (A println(group) before the array load)).

Ewout

Result

Hi,
It doesn't always fail! However when it does the vlaue of group is 7.

Levente

Cannot reproduce

Humm... I cannot reproduce it here.

Can you derive a test-class that triggers the same error?

Ewout

Not yet.

Hi,

This is a peculiar bug. I checked the partition with fsck -f and it seemd to be OK but I still got the error. Then I reformatted the partition and copied the saved files back to it and now I don't get that error. I'm even able to manually load plugins of nearly 1MB size.
However the ext2 filesystem still seems more instable. I failed to save a file with the editor (the exception disapeared somewhere).

An old bug in the IDE driver was mentioned several times, that might be there too.
So I think the ext2 fs would deserve some more testing under these new conditions!

Levente

Testing

I'll work on the testing. By the way I think the best way to test any filesystems is on a ramdisk, because then you are free from the errors in the IDE driver. You can create an ext2 fs on a ramdisk just as you would on a HD partition.

Andras