comparison 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
comparison
equal deleted inserted replaced
6387:d44835610b52 6388:6b74f44c5059
748 tty->print_cr("exited locking slow case with obj=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, obj->mark(), lock); 748 tty->print_cr("exited locking slow case with obj=" INTPTR_FORMAT ", mark=" INTPTR_FORMAT " and lock= " INTPTR_FORMAT, obj, obj->mark(), lock);
749 } 749 }
750 #endif 750 #endif
751 JRT_END 751 JRT_END
752 752
753 JRT_ENTRY(void, Runtime1::graal_log_object(JavaThread* thread, oop obj, jboolean newline, jboolean string)) 753 JRT_ENTRY(void, Runtime1::graal_log_object(JavaThread* thread, oop obj, jint flags))
754 bool string = flags & LOG_OBJECT_STRING;
755 bool address = flags & LOG_OBJECT_ADDRESS;
756 bool newline = flags & LOG_OBJECT_NEWLINE;
754 if (!string) { 757 if (!string) {
755 tty->print("%p", obj); 758 if (!address && obj->is_oop_or_null(true)) {
759 char buf[400];
760 tty->print("%s@%p", obj->klass()->klass_part()->name()->as_C_string(buf, 400), obj);
761 } else {
762 tty->print("%p", obj);
763 }
756 } else { 764 } else {
757 assert(obj != NULL && java_lang_String::is_instance(obj), "must be"); 765 assert(obj != NULL && java_lang_String::is_instance(obj), "must be");
758 766
759 typeArrayOop value = java_lang_String::value(obj); 767 typeArrayOop value = java_lang_String::value(obj);
760 int offset = java_lang_String::offset(obj); 768 int offset = java_lang_String::offset(obj);