diff options
Diffstat (limited to 'src/utils.h')
| -rw-r--r-- | src/utils.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h index 842db63a26..ea51d1e2ec 100644 --- a/src/utils.h +++ b/src/utils.h @@ -5,10 +5,13 @@ #include "globals.h" #include "logging.h" +#include "stringpiece.h" #include "stringprintf.h" namespace art { +class Object; + template<typename T> static inline bool IsPowerOfTwo(T x) { return (x & (x - 1)) == 0; @@ -132,6 +135,17 @@ static inline std::string PrintableString(const StringT& s) { return result; } +// 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. +std::string PrettyDescriptor(const StringPiece& descriptor); + +// Returns a human-readable string form of the name of the class of +// the given object. So given a java.lang.String, the output would +// be "java.lang.String". Given an array of int, the output would be "int[]". +// Given String.class, the output would be "java.lang.Class<java.lang.String>". +std::string PrettyType(const Object* obj); + } // namespace art #endif // ART_SRC_UTILS_H_ |