[LLVMdev] vmkit on x86_64

Nicolas Geoffray nicolas.geoffray at lip6.fr
Tue Nov 18 06:26:59 PST 2008


It's been a while, but since r59525 of VMKit, the JVM implementation 
runs on linux/x86_64. The GC is not supported though, so each object is 
allocated with malloc (but you're on a 64bit, anyway :)).

Nicolas

Nicolas Geoffray wrote:
> Hi Zsombor,
>
> Thanks for the patch! Unfortunately I can't apply it because the llvm 
> API has moved from BinaryOperator::create to BinaryOperator::Create. Are 
> you using svn head?
>
> Now on the x86_64 part. There has been very little work on porting vmkit 
> on x86_64. If you're having compilation problems, I suppose it's in the 
> garbage collector directory (GCMmap2). If you could make the GC code 
> x86_64 clean, I think that would be a major step to execute vmkit on 
> your box. There should be little code in the virtual machines that need 
> to be rewritten.
>
> For the JavaObject class, indeed, it's assuming the lock field is 
> 32-bit. I plan to change that in order to store monitors in a hashtable. 
> If you're willing to implement it, I'll be happy to help you out.
>
> Also, I don't know what is the current status of linux/x86_64 exception 
> handling support in llvm, but that may be also a stopper. The 
> jit-generated dwarf tables were only tested on linux/x86 (I suppose 
> vmkit is the only project using it).
>
> Nicolas
>
> Zsombor wrote:
>   
>> Hello,
>>
>>  I'm trying to compile vmkit on a x86_64 linux box with gcc-4.1.2, but
>> I'm running into troubles because of various problems with casts
>> between pointers and integers. Is there anybody who succeeded in this
>> task? Az I see, some of the problems can be fixed with an appropriate
>> typedef/macro declaration, but in VMCore/JavaObject.cpp some lowlevel
>> bitmanipulation is used, to mark object references as locked - as I
>> believe.
>>
>> BR,
>>  Zsombor
>>
>>
>> p.s
>>  this fixes a typo in the current svn trunk
>>
>> $ svn diff VMCore/JavaJITOpcodes.cpp
>> Index: VMCore/JavaJITOpcodes.cpp
>> ===================================================================
>> --- VMCore/JavaJITOpcodes.cpp    (revision 52951)
>> +++ VMCore/JavaJITOpcodes.cpp    (working copy)
>> @@ -1008,7 +1008,7 @@
>>          Value* val2 = popAsInt();
>>          Value* val1 = popAsInt();
>>          Value* mask = ConstantInt::get(Type::Int32Ty, 0x1F);
>> -        val2 = BinaryOperator::CreateAnd(val2, mask, "", currentBlock);
>> +        val2 = BinaryOperator::createAnd(val2, mask, "", currentBlock);
>>          push(BinaryOperator::createLShr(val1, val2, "", currentBlock),
>>               AssessorDesc::dInt);
>>          break;
>> @@ -1017,7 +1017,7 @@
>>        case LUSHR : {
>>          Value* val2 = new ZExtInst(pop(), Type::Int64Ty, "", currentBlock);
>>          Value* mask = ConstantInt::get(Type::Int64Ty, 0x3F);
>> -        val2 = BinaryOperator::CreateAnd(val2, mask, "", currentBlock);
>> +        val2 = BinaryOperator::createAnd(val2, mask, "", currentBlock);
>>          pop(); // remove the 0 on the stack
>>          Value* val1 = pop();
>>          push(BinaryOperator::createLShr(val1, val2, "", currentBlock),
>> _______________________________________________
>> 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
>   




More information about the llvm-dev mailing list