summaryrefslogtreecommitdiffstats
path: root/vm/Native.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-06-30 13:40:52 -0700
committerElliott Hughes <enh@google.com>2011-06-30 14:11:39 -0700
commita6e94ff55517438569d207e3ed552c8c127bcac9 (patch)
tree7fb02a28e93083744f0101ac6489cc61f91a9831 /vm/Native.h
parent9a4c89ff46c9006d24594bc774a24db84f9c595c (diff)
downloadandroid_dalvik-a6e94ff55517438569d207e3ed552c8c127bcac9.tar.gz
android_dalvik-a6e94ff55517438569d207e3ed552c8c127bcac9.tar.bz2
android_dalvik-a6e94ff55517438569d207e3ed552c8c127bcac9.zip
Fix native method logging to show local references rather than direct pointers.
This is necessary (but not sufficient) for debugging third-party JNI bugs. It's the second half of the logging story, but still doesn't address the question of "how does the developer turn on the logging?". This removes the variant JNI bridges at the cost of adding a couple of booleans to struct Method. Performance is about the same, except synchronized native methods are quite a bit faster after the change. Before: benchmark ns linear runtime _emptyJniMethod0 333 ========== _emptyJniMethod6 367 =========== _emptyJniMethod6L 921 ============================== _emptyJniStaticMethod0 259 ======== _emptyJniStaticMethod6 287 ========= _emptyJniStaticMethod6L 873 ============================ _emptyJniStaticSynchronizedMethod0 404 ============= _emptyJniSynchronizedMethod0 452 ============== After: benchmark ns linear runtime _emptyJniMethod0 344 ========== _emptyJniMethod6 348 ========== _emptyJniMethod6L 969 ============================== _emptyJniStaticMethod0 265 ======== _emptyJniStaticMethod6 293 ========= _emptyJniStaticMethod6L 968 ============================= _emptyJniStaticSynchronizedMethod0 265 ======== _emptyJniSynchronizedMethod0 323 ========== A better optimization for the case where there are reference arguments would be to keep a list of argument indexes in the struct Method, so we could iterate directly over those arguments that need converting to local references. That would also let us do something about the overhead of repeatedly looking up which local reference table and cookie to use. But now is not the time. Change-Id: Ie32daca1b31be057a44f1ed4b5d28d1634380e1d
Diffstat (limited to 'vm/Native.h')
-rw-r--r--vm/Native.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/vm/Native.h b/vm/Native.h
index c7903804c..65ff8dc48 100644
--- a/vm/Native.h
+++ b/vm/Native.h
@@ -101,12 +101,4 @@ INLINE s8 dvmGetArgLong(const u4* args, int elem)
return val;
}
-/*
- * Used to implement -Xjnitrace.
- */
-struct Thread;
-void dvmLogNativeMethodEntry(const Method* method, const u4* newFp);
-void dvmLogNativeMethodExit(const Method* method, struct Thread* self,
- const JValue retval);
-
#endif // DALVIK_NATIVE_H_