Welcome, Guest. Please login or register.

Author Topic: Java VM Update  (Read 3497 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline tonywTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 553
    • Show all replies
Java VM Update
« on: March 23, 2003, 06:47:44 AM »
Some time ago I took on the task of getting kaffe, the open source Java compiler/interpreter/JIT to work on the A1 with AOS4. Here is a little update on what has happened so far.

Kaffe is a multi-platform distribution, supporting many machines. One of those machines is the 68k Amiga, although the distribution has not been touched since 1998. The kaffe "system" is configured for your hardware/OS, then compiled to produce a running installation. The Amiga configuration had not been touched since 1998, so by the time I got to it early this year, the main source had changed quite a bit and the Amiga build didn't work at all.

Since then I have managed to make the Amiga 68k build work again, even better than before, although part of that is the general improvement in the sophistication of the source. I have submitted my patches to the general source tree (mainly for the 68k Amiga version only).

Currently the Amiga 68k version runs on my 4000/060@50 MHz. Well, when I say 'runs', I don't mean 'run', or even 'walk'. To be truthful, it oozes like the green slime in Marble Madness. The main reason for the slowness is that whether compiling or running a compiled class, the 'system' loads all the gzipped run-time classes, then unzips them, dynamically allocates storage for each class, then copies the class into its new place in memory. As an example, that process takes 26,000 memory allocations just to store the classes into memory. And that's before the source file has even been opened. On my 600 MHz Duron-powered PC, it's a blink of an eye - about a tenth of a second.

On the Amiga, it's a minute or so for the same process - that's not just because the processor runs at a twelfth of the speed, but also because kaffe is running under ixemul, in a Linux emulation mode. So it's bloody slow. However, I have also installed a native 68k version of Linux on the Amiga, and kaffe runs about four times' faster on that OS using the same hardware.

To be fair to the designers of kaffe, that overhead is constant. Once the library has been loaded, it runs pretty fast from then on. Of course, under Linux, the file system is cached, so it doesn't thrash the disc drive the way it does under Amiga OS.

The kaffe development group have recently brought out a new version that loads pre-compiled classes more efficiently, but I haven't tried it yet. Neither have I tried out the JIT VM. I've only used the interpreter so far.

I expect the speed to improve greatly on the A1 under native PPC Linux, and under AOS4.

I have been concentrating recently on getting the "Regression" tests to run. There is a suite of 115 tests, and a test script that runs them all in turn. When first I got the Amiga version to run, only about 87/115 would run without error. After some work over the last month or so, I now have about 105/115 running without fault. Those that still fail, fail for these reasons:
2 fail because the test is for Linux pathnames like "." and "..". The Amiga OS fails these tests.
1 fails because the 68060 FPU has some issues with division of the maximum negative number (0x80000000).
3 fail because of arithmetic errors (in the last place of long numbers).
2 fail tests designed for the Solaris OS (but they pass on 68k Linux).
 - and some others.

I'd publish a running version for people to try on their 68k Amigas, but you need the whole GNU GeekGadgets thing, which is a pain in the neck. If anyone has this setup and would like a copy, PM me.

When the A1 arrives, I'll move the distro over to the new hardware and bring it up under PPC Linux. That will probably bring up a whole lot more problems.

Then, when AOS4 is available, it'll be a whole new ball game. I don't want to run ixemul on the new system, but we'll see what support there is going to be for Linux-like programs. There might be some built-in support that improves on the ixemul approach.

Work continues.

tony
 

Offline tonywTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 553
    • Show all replies
Re: Java VM Update
« Reply #1 on: March 23, 2003, 09:38:33 AM »
No, this is not what people are screaming for. Those version numbers are for Sun's Java. Kaffe is supposed to be written to be compatible with the Sun specification, but contains no Sun code and has some compatibilty issues. It also has poor support for debugging, profiling and security features. However, it is free, there is an existing Amiga version, and it will be better than nothing. Also it gives me something constructive to do.

tony
 

Offline tonywTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 553
    • Show all replies
Re: Java VM Update
« Reply #2 on: March 23, 2003, 01:34:45 PM »
Hey, nyteschade:

You can download any of this kaffe stuff as sources from the kaffe site. If I were you, though, I'd get the Geekgadgets thing first. It took me two months to get that going properly. I tried downloading stuff from the web, but it's all varying update levels and lots of the stuff is incompatible with other versions. There isn't any one site that has a consistent set of GG code.

I eventually bought the CD set from Schatztruhe. Some of the stuff is a little out of date, but it's a consistent build and it'll get you started.

You won't be able to run kaffe unless you've got that going first. I can't give you a binary that will run under AmigaOS, and it's more than just loading ixemul.library into LIBS:.

You'll be talking like a Linux geek by the time you get it all to run.

tony