On 7/2/07, clara <[EMAIL PROTECTED]> wrote:
Each operand has type info in JIT IR, and I think the type is decided according to the declarations. However, the runtime type of some operands can be decided in compilation. Are there any optpasses which do some type inference or analyzing?For example, the below are 3 classes, according to analyzing the code, we know the runtime type of e is Body$Enumerate. public class BH { Tree root = new Tree(); ... public static final void main(String args[]) { for (Enumeration e = root.bodies(); e.hasMoreElements(); ) ... } } class Tree { ... private Body bodyTab; final Enumeration bodies() { return bodyTab.elements(); } ... } final class Body extends Node { final Enumeration elements() { // a local class that implements the enumerator class Enumerate implements Enumeration { private Body current; public Enumerate() { this.current = Body.this; } public boolean hasMoreElements() { return (current != null); } public Object nextElement() { Object retval = current; current = current.next; return retval; } } return new Enumerate(); } }
Clara, now I understand what you meant. It is about cross-procedure type propagation. I guess this should be done with IPA. I do not know about how Jitrino deals with it. In Open64 (ORC) for speculative analysis, we used inlining to propagate the information automatically. Thanks, xiaofeng
----- Original Message ----- From: "Xiao-Feng Li" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Monday, July 02, 2007 9:27 AM Subject: Re: [drlvm][jitrino]Are there any static type checking and type propagation? > On 7/1/07, clara <[EMAIL PROTECTED]> wrote: >> Hi, all, >> >> Are there any static type checking and type propagation in jitrino? > > Clara, what do you mean by static type checking? I think JVM checks > types during class file verification. It is not necessarily part of > the JIT. On the other hand, any JIT IR should have typing info > associated with the operands (or operations). I guess you are not > talking about this? Maybe you are talking about type preserving > compilation? > >> If so, how can I use them? >> Thanks. >> >> Yu >> > > > -- > http://xiao-feng.blogspot.com
-- http://xiao-feng.blogspot.com
