aboutsummaryrefslogtreecommitdiff
path: root/vm/compiler/codegen/CompilerCodegen.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2010-07-07 14:47:25 -0700
committerElliott Hughes <enh@google.com>2010-07-15 16:03:09 -0700
commit8afa9dfe04354e5b3917e31e3e2772885f507580 (patch)
treed96eab4a9f89da1615c07ee54e255d4dcff77c23 /vm/compiler/codegen/CompilerCodegen.h
parent8e7704d14f6f756f7b1ff8a0eeaff52717ad8009 (diff)
Tracing for developers of native methods.
The existing -verbose:jni is mainly useful for VM developers hacking on the JNI implementation; this is intended to replace the ad hoc logging developers of native methods need to write. Use "-Xint:portable -Xjnitrace:ClassNameSubstring" on the command line. To trace all native methods (mainly useful for testing the tracing), use "-Xjnitrace:"; to trace just methods in java.util.regex.Matcher, use "-Xjnitrace:Matcher" or "-Xjnitrace:Ljava/util/regex/Matcher;" or whatever. To trace all the methods in Matcher and Pattern, you have to use something like "-Xjnitrace:java/util/regex/". There's no facility for tracing an individual method or group of methods because I haven't needed such a thing. Here's a basic example: -> Ljava/nio/charset/Charsets;.toUtf8Bytes([CII)[B (0x400474b8, 0, 5) <- Ljava/nio/charset/Charsets;.toUtf8Bytes([CII)[B returned 0x40047548 Here's an example of a non-static native method: -> Lorg/apache/harmony/luni/platform/OSFileSystem;.writeImpl(I[BII)J this=0x40012e78 (1, 0x400476d0, 0, 5) <- Lorg/apache/harmony/luni/platform/OSFileSystem;.writeImpl(I[BII)J returned 5 Here's an interesting example showing another native method being called, and an exception being thrown by a native method: -> Ljava/lang/VMClassLoader;.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; (0x400466b8, false) -> Ljava/lang/Throwable;.nativeFillInStackTrace()Ljava/lang/Object; () <- Ljava/lang/Throwable;.nativeFillInStackTrace()Ljava/lang/Object; returned 0x400467c8 <- Ljava/lang/VMClassLoader;.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; threw Ljava/lang/ClassNotFoundException; (This functionality needs to be enabled at compile time. A later patch will address that.) Change-Id: I6da8930bd4b4f228e07b05cc59a3aea331c5cee1
Diffstat (limited to 'vm/compiler/codegen/CompilerCodegen.h')
0 files changed, 0 insertions, 0 deletions