diff options
author | Elliott Hughes <enh@google.com> | 2010-11-22 13:14:23 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-11-22 13:50:09 -0800 |
commit | 5016966b91f1bc36b2bd52ec13ecfd8de1c68209 (patch) | |
tree | 2ce61b59ffd09e0916297060671b4e73c3a6bbec /vm/Misc.h | |
parent | eb6e6fa4642fc89e31adf28be103f9032eb379e5 (diff) | |
download | android_dalvik-5016966b91f1bc36b2bd52ec13ecfd8de1c68209.tar.gz android_dalvik-5016966b91f1bc36b2bd52ec13ecfd8de1c68209.tar.bz2 android_dalvik-5016966b91f1bc36b2bd52ec13ecfd8de1c68209.zip |
Add dvmHumanReadableDescriptor function, and use it.
We were abusing the fact that dvmDescriptorToDot, which is actually meant
for the class loading machinery, produces more readable output than a
regular descriptor. This patch adds a dvmHumanReadableDescriptor function,
switches all the relevant callers over to it, and and reuses the code that
was already in HprodClass.c.
This means we now say "java.lang.String[]" instead of "[Ljava.lang.String;".
Note that the old hprof code would have left "I" unchanged; I modified it
to translate "I" to "int" (et cetera). This was probably an oversight because
primitive scalars can't appear on the heap, so hprof had no need to format
those types (just arrays of primitives, which it got right).
Bug: 3216276
Change-Id: I63f32a2b020674dfa62ce198ff2699ec01857540
Diffstat (limited to 'vm/Misc.h')
-rw-r--r-- | vm/Misc.h | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -185,18 +185,30 @@ bool dvmIntersectBitVectors(BitVector *dest, const BitVector *src1, char* dvmDotToSlash(const char* str); /* + * Return a newly-allocated string containing a human-readable equivalent + * of 'descriptor'. So "I" would be "int", "[[I" would be "int[][]", + * "[Ljava/lang/String;" would be "java.lang.String[]", and so forth. + */ +char* dvmHumanReadableDescriptor(const char* descriptor); + +/* * Return a newly-allocated string for the "dot version" of the class * name for the given type descriptor. That is, The initial "L" and * final ";" (if any) have been removed and all occurrences of '/' * have been changed to '.'. + * + * "Dot version" names are used in the class loading machinery. + * See also dvmHumanReadableDescriptor. */ char* dvmDescriptorToDot(const char* str); /* * Return a newly-allocated string for the type descriptor * corresponding to the "dot version" of the given class name. That - * is, non-array names are surrounde by "L" and ";", and all + * is, non-array names are surrounded by "L" and ";", and all * occurrences of '.' have been changed to '/'. + * + * "Dot version" names are used in the class loading machinery. */ char* dvmDotToDescriptor(const char* str); |