Hi,
I have instrumented Dalvik VM to print out every API call being made by the
VM. I am printing call invocation as well as return from the calls. I did
my changes in this file: dalvik/vm/mterp/c/gotoTargets.c. For very few
calls, I see this strange behavior: the "return" statement for these calls
is missing in the log. Here is an example: ( I am filtering out calls, so
this is filtered version of the log) :
[invokeVirtualQuick] clipRect android/graphics/Canvas;
[return] clipRect android/graphics/Canvas;
[invokeVirtualQuick] setColor android/graphics/Paint;
[invokeVirtualQuick] setStyle android/graphics/Paint;
[return] setStyle android/graphics/Paint;
Format is: <method name of Dalvik VM> <API method name> <class name>
As you can see, for "setColor" call, there is no 'return' statement. I
verified that I have my instrumentation in all possible cases of 'return'
in dalvik VM. Could this be because of tail call optimization, where by the
'return' instruction of setColor was removed? ('setColor' is indeed a tail
call in another method, but this is not visible in the filtered version of
the log.)
If so, is it possible to disable such tail call optimization while running
dalvik VM?
Thanks!
Amruta
PS: I wanted to print the API calls made only by the application, so I
couldn't use the default 'traceview' tool which prints all calls, including
library calls. I inserted some additional checks in my instrumentation to
print only the API calls made by application code, and filter out all other
calls.
--
You received this message because you are subscribed to the Google Groups
"Android Discuss" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/android-discuss/-/Dp6nRyoAX1oJ.
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.