Re: Re: Re: Fwd: Re: More precise values in Analyzer

Rémi Forax <[email protected]>
Newsgroups gmane.comp.java.objectweb.asm
Message-ID <[email protected]>
Le 16/07/2010 00:25, Joshua Warner a écrit :
> Eugene,
>
> I looked at SourceValue and SourceInterpreter, and it appears that 
> when a SourceValue comes from a parameter (or this pointer or 
> exception variable), it just reports the source as an empty set.
>
> Maybe some more background will help:
>
> The goal of this project is to make an optimizing ahead-of-time 
> compiler for the Avian virtual machine (oss.readytalk.com 
> <http://oss.readytalk.com>).  I want to take in a list of class files, 
> and spit out lots of llvm assembly.  The input and output would look 
> roughly like this (as part of a larger program):
>
> [javap style assembly]
> public int returnFirstParameter(int i)
> Code:
> 0:  iload 1
> 1:  ireturn
>
> [llvm assembly]
> define i32 @TestClasS_returnFirstParameter(i32 %i) nounwind {
> entry:
>   ret i32 %i;
> }
>
> LLVM (low-level virtual machine, llvm.org <http://llvm.org> - 
> essentially a compiler / optimizer infrastructure) stores its IR 
> completely in SSA form.  This requires naming the parameters to a 
> method, and tracking their uses.
>
> Just using the variable slot number to detect a parameter may not be 
> sufficient, because a java program could (though they don't usually) 
> decide to overwrite its own arguments.  In this case, this 
> overwritting value would be detected as the original parameter, when 
> in fact it is a new value.  I need something that is correct 100% of 
> the time, not just in the (very) common cases.

Why not tracking store ? i.e each store create a new variable.
This is the usual algorithm to convert into SSA form.

>
> Even if this would work, I don't see a way to get the specific local 
> variables index that a certain value originated in (particularly in 
> the case of Values allocated with Interpreter.newValue(...).  Am I 
> missing something?
>
> I've read significant portions of "ASM 3.0 A Java bytecode engineering 
> library <http://download.forge.objectweb.org/asm/asm-guide.pdf>", and 
> I didn't see anything that could help me with this particular 
> problem.  Do you have a certain section that you are thinking of?
>
> Thanks,
>
> Joshua

There is also already a llvm project that implement a basic bytecode 
frontend:
https://llvm.org/svn/llvm-project/java/trunk/docs/java-frontend.txt

cheers,
Rémi
message-footer.txt (text/plain, 238 B)
-- 
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.