[LLVMdev] Fwd: Building VMKit

Joshua Warner joshuawarner32 at gmail.com
Tue Jul 20 08:35:42 PDT 2010


Hi Nicolas,

I plan on using the Avian GC (which is a precise, generational collector).
Eventually, I'd like to fully integrate all of the runtime services Avian
provides - even integrating the existing Avian JIT compiler, to allow for
partially-AOT builds.

Avian does indeed have it's own class library, but I would be very surprised
if VMKit could compile with them - they are sufficiently conformant for many
applications, but far from a complete implementation.  Avian also supports
using GNU Classpath, and I was planning on targeting this feature.

As I understand it, LLVM itself can compile code for most of the mentioned
platforms, and ARM support is coming along nicely.

If VMKit is to serve as the compiler, I have a number of requirements that
need to be at least fairly easy to add (or already present):

* Custom lowering (platform independent) of operations like virtual and
interface calls.  Currently, Avian uses the lower bits of the virtual method
table to store various data, so loading the virtual table requires masking
out those bits.  Avian also uses a fairly unique implementation of hashing
for interface method lookup (unique in the implementation, not the
algorithm).  In this case, it may be easier to modify Avian to fit with
VMKit, instead of visa-versa.

* Access to stack maps at GC safe points

* Access to unwind tables

* Configurable object layout - capability to configure the number of words
in the object header, etc.  Again, it may be easier to modify Avian.

* Able to output object files (preferably) or assembly for the target
platform, with appropriate global symbols for functions, etc. to be linked
as a boot image.

Do you know if VMKit already has these features?  If not, would it be fairly
straightforward to add them in such a way as to also benefit VMKit (I don't
want to maintain a custom branch)?

Joshua

On Tue, Jul 20, 2010 at 9:07 AM, nicolas geoffray <
nicolas.geoffray at gmail.com> wrote:

> Hi Joshua,
>
> What plans did you have for GC? No GC at all or Avian JVM has its own GC
> (and is it precise or not?)?
>
> If you're not planning on using VMKit's GCs, then 64-bit system should not
> be a big problem: the only problem that we have now is compiling GNU
> Classpath, and most probably Avian JVM has its own version of the class
> libraries?
>
> Also, note that platform support will be strongly dependent on LLVM
> support.
>
> Nicolas
>
>
> On Tue, Jul 20, 2010 at 4:41 PM, Joshua Warner <joshuawarner32 at gmail.com>wrote:
>
>> Hi Nicolas,
>>
>> Thanks for all your help, but if 64-bit systems are still a big problem,
>> perhaps the VMKit AOT compiler is not the best solution to my problem.  I'd
>> like to be able to support the major (if not all all) platforms that the
>> Avian JVM supports - x86 & x86_64 linux & windows, powerpc darwin and ARM.
>>
>> Regards,
>> Joshua
>>
>>
>> On Tue, Jul 20, 2010 at 8:00 AM, nicolas geoffray <
>> nicolas.geoffray at gmail.com> wrote:
>>
>>> Hi Joshua,
>>>
>>> If you can get a running 32bit system, I'd suggest you do so, as you'll
>>> get up to speed right away. I can't test VMKit on a 64bits machine, and I
>>> have been aware that there are some compilation/execution problems. Besides,
>>> the current GCs of VMKit do not work on 64bits (neither MMTk nor GCMmap2).
>>>
>>> Nicolas
>>>
>>>
>>> On Tue, Jul 20, 2010 at 3:56 PM, Joshua Warner <joshuawarner32 at gmail.com
>>> > wrote:
>>>
>>>> Hi Minas,
>>>>
>>>> I tried recompiling Classpath with -fno-omit-frame-pointer, and now,
>>>> instead of printing an error message, j3 just segfaults in
>>>> "j3::JnjvmClassLoader::loadClassFromAsciiz(char const*, bool, bool) ()"
>>>>
>>>> I ran llcj under strace and found that it is not even opening the input
>>>> or output files, but is otherwise running normally.
>>>>
>>>> Updating to the latest SVN version (revision 108831) didn't change
>>>> anything (I was only a few days out of date).
>>>>
>>>> I'm not sure where to go from here.  Does this fit with any of the known
>>>> problems under 64-bit linux?
>>>>
>>>> Thanks,
>>>> Joshua
>>>>
>>>>
>>>> On Mon, Jul 19, 2010 at 4:45 PM, Minas Abrahamyan <minas.subs at gmail.com
>>>> > wrote:
>>>>
>>>>> Hi Joshua,
>>>>> > $ j3 Hello
>>>>> > j3: JavaClass.cpp:480: j3::JavaObject* j3::Class::doNew(j3::Jnjvm*):
>>>>> > Assertion `(this->isInitializing() ||
>>>>> > classLoader->getCompiler()->isStaticCompiling()) && "Uninitialized
>>>>> class
>>>>> > when allocating."' failed.
>>>>> > Aborted
>>>>>
>>>>> Regarding to j3 in 64 bit version, it should work now after we've
>>>>> found crush reason,
>>>>> both in Debug and in Release versions. (and its 32 bit version was
>>>>> continuously working)
>>>>>
>>>>> But your case is something strange, crush didn't type such messages.
>>>>> Have you taken VMkit from svn and latest version?
>>>>> Also, to get j3 running recompile classpath with
>>>>> -fno-omit-frame-pointer (or take my patch from here:
>>>>>
>>>>> http://lists.cs.uiuc.edu/pipermail/vmkit-commits/attachments/20100719/35754a6f/attachment.bin
>>>>> and apply it:
>>>>> $ cd classpath-0.97.2
>>>>> $ patch ./configure ./classpath_configure64.patch
>>>>> )
>>>>>
>>>>> That's now on j3
>>>>>
>>>>> Regards,
>>>>> Minas
>>>>>
>>>>> On Mon, Jul 19, 2010 at 9:20 PM, Joshua Warner <
>>>>> joshuawarner32 at gmail.com> wrote:
>>>>> > Forgot to send to the mailing list...
>>>>> >
>>>>> > ---------- Forwarded message ----------
>>>>> > From: Joshua Warner <joshuawarner32 at gmail.com>
>>>>> > Date: Mon, Jul 19, 2010 at 10:19 AM
>>>>> > Subject: Re: [LLVMdev] Building VMKit
>>>>> > To: nicolas geoffray <nicolas.geoffray at gmail.com>
>>>>> >
>>>>> >
>>>>> > Thanks Nicolas, that worked great!
>>>>> >
>>>>> > Now, I'm having trouble invoking the compiler properly:
>>>>> > $ llcj Hello.class -o=Hello.ll
>>>>> > $ cat Hello.ll
>>>>> > cat: Hello.ll: No such file or directory
>>>>> > $ j3 Hello
>>>>> > j3: JavaClass.cpp:480: j3::JavaObject* j3::Class::doNew(j3::Jnjvm*):
>>>>> > Assertion `(this->isInitializing() ||
>>>>> > classLoader->getCompiler()->isStaticCompiling()) && "Uninitialized
>>>>> class
>>>>> > when allocating."' failed.
>>>>> > Aborted
>>>>> > $ java Hello
>>>>> > hello, world!
>>>>> >
>>>>> > "Hello" is a completely banal "hello world!" program.
>>>>> >
>>>>> > Joshua
>>>>> _______________________________________________
>>>>> LLVM Developers mailing list
>>>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> LLVM Developers mailing list
>>>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>>>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100720/5e17a03b/attachment.html>


More information about the llvm-dev mailing list