Mercurial > hg > graal-compiler
diff src/share/vm/c1/c1_Runtime1.cpp @ 6388:6b74f44c5059
added Log.printObject() and Log.printlnObject() for more detailed logging of objects
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 14 Sep 2012 10:49:34 +0200 |
parents | 077fd901d7c7 |
children | 13a08f5bb120 |
line wrap: on
line diff
--- a/src/share/vm/c1/c1_Runtime1.cpp Thu Sep 13 17:45:04 2012 +0200 +++ b/src/share/vm/c1/c1_Runtime1.cpp Fri Sep 14 10:49:34 2012 +0200 @@ -750,9 +750,17 @@ #endif JRT_END -JRT_ENTRY(void, Runtime1::graal_log_object(JavaThread* thread, oop obj, jboolean newline, jboolean string)) +JRT_ENTRY(void, Runtime1::graal_log_object(JavaThread* thread, oop obj, jint flags)) + bool string = flags & LOG_OBJECT_STRING; + bool address = flags & LOG_OBJECT_ADDRESS; + bool newline = flags & LOG_OBJECT_NEWLINE; if (!string) { - tty->print("%p", obj); + if (!address && obj->is_oop_or_null(true)) { + char buf[400]; + tty->print("%s@%p", obj->klass()->klass_part()->name()->as_C_string(buf, 400), obj); + } else { + tty->print("%p", obj); + } } else { assert(obj != NULL && java_lang_String::is_instance(obj), "must be");