On Fri, Dec 12, 2008 at 12:48 PM, blindfold <[email protected]> wrote:
> Of course I know that a modern JIT compiler does not and should not
> require programmer intervention, but several reply postings from
> Android Team members have indicated that they feel that it would be
> "very non-trivial" (hackbod) to implement this for Android with its
> "dozen or more
> VM-containing processes sharing a single CPU and a single pool of
> RAM" (JBQ).
>
> Therefore I would think it makes your life easier to first design and
> implement a JIT compiler that gets explicitly invoked by the
> application developer using compileClass() [...]
Actually, this wouldn't make anyone's life particularly easier. For a
JIT to do its job properly, it has to know something of the context in
which a method is being used, and it may alter its behavior depending
on circumstance.
For example, it's entirely likely that the first incarnation of a JIT
for Android won't even operate on whole methods, rather only compiling
the most used loop-free "traces" through methods, thereby taking less
memory and less time (and hence use less battery) compared to doing
whole-method compilation. Use your favorite search engine to look up
"trace-based jit" for further details.
If we go for this sort of JIT, the effort of hooking up compileClass()
would actually end up adding work, not reducing it.
> You mean that compileClass() gets ignored/stripped by Sun's javac and
> is not mapped to JVM bytecodes that form the input for generating
> Dalvik bytecodes? [...]
What I mean is that I would be surprised to find many implementations
of java.lang.Compiler.compileClass() that didn't look like this:
public boolean compileClass(Class c) { return false; }
including in systems that actually do perform JIT compilation. So I
wouldn't rely on the return value of compileClass() to tell you
anything meaningful.
-dan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Android Discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---