Hi,
I am trying to understand how the dalvik interpreters interact with the Jit world. With a bit of work, I found that "common_updateProfile" is a main portal to the Jit world. It updates the profile of a potential trace head and if the count reaches zero, it resets the count and then checks if this has already been translated. If so, the interpreter jumps to JITed code. Otherwise, it switches to the debug interpreter to build the trace.
In the fast interpreter code, I didn't find any other place where the interpreter can jump to JITed code (though some "dvmJitToInterp****" functions do jump to JITed code).
This confused me because according to "common_updateProfile", the fast interpreter can only jump to the translation of a trace after:
1) the trace has been translated, and
2) the profile count of the trace head is decreased to zero again after the interpreter decided to compile this trace.
So my understanding is that if the the threshold of a trace head is 100, then the fast interpreter has to come to it 100 times before it decides to compile this trace. The interpreter has to come to this trace head another 100 times before it can jump to the corresponding translation.
This doesn't seem to be right.
Thanks a lot for any advice.
yang