[LLVMdev] vmkit variables internal representation

Alexandru Ionut Diaconescu cyrusthevirus001x at yahoo.com
Wed Jun 26 09:04:12 PDT 2013


Hi Gaël,

Thank you for clearing the problem ! If I will have time in future, I will contact you to try to implement that. However, how can I identify the local variables in the internal representation? I identified the global variables (and Tim showed me how to get their names), but how can I just identify the local variables (not by name, but by structure - internal vmkit representation)? In the example that I gave, I assume that javac is optimizing the code, so "Q" is lost, not even replaced by a constant. However, that constant is used in other computations, but not kept somewhere?

Thanks!
Alexandru






________________________________
 From: Gaël Thomas <gael.thomas00 at gmail.com>
To: Alexandru Ionut Diaconescu <cyrusthevirus001x at yahoo.com> 
Cc: llvmdev at cs.uiuc.edu 
Sent: Wednesday, June 26, 2013 4:30 PM
Subject: Re: [LLVMdev] vmkit variables internal representation
 


Hi Alexandru,
The Java bytecode does not give and use the name of the local variables. We can find them in an attribute used for debugging, but currently, vmkit do not use this attribute. It means that the llvm bitcode that vmjc emit does not contain these names. Finding local variables names could be useful, but we don't plane to implement this feature for the moment... If you are interested, we can help you to implement this feature, it should not take too many time,
Gaël 
PS: also, even if you can use the java names for locals, you will have to disable some of the compilation passes because they could promote these variables into machine registers.
Le 26 juin 2013 15:59, "Alexandru Ionut Diaconescu" <cyrusthevirus001x at yahoo.com> a écrit :

Yes ! Thank you a lot :) 
>
>It seems vmkit bytecode is quite close to the classic LLVM, but still adaptations to the passes have to be done
>
>
>
>
>
>
>________________________________
> From: Tim Northover <t.p.northover at gmail.com>
>To: Alexandru Ionut Diaconescu <cyrusthevirus001x at yahoo.com> 
>Cc: "llvmdev at cs.uiuc.edu" <llvmdev at cs.uiuc.edu> 
>Sent: Wednesday, June 26, 2013 3:32 PM
>Subject: Re: [LLVMdev] vmkit variables internal representation
> 
>
>> I attached the assembly file, the java file and the running script file. I
>> hope the variable names can be identified.
>
>Well, I'm afraid I know no more about the Java ABI than you, but Java
>strings can be identified by the type {i32, [N x i16]} where the first
>entry is the length and the array is UTF-16. Running the attached
>hacked-together script on your bitcode file gives the following:
>
>@41 contains string "MYGL"
>@42 contains string "P"
>@43 contains string "balance"
>
>How these fit into the structures defined used is left as an exercise
>to the interested reader. ;-)
>
>Tim.
>
>
>
>_______________________________________________
>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/20130626/d9444842/attachment.html>


More information about the llvm-dev mailing list