comparison src/share/vm/graal/graalRuntime.cpp @ 9573:a79e8020ad4b

added Stub.decipher() to print information about values in stubs
author Doug Simon <doug.simon@oracle.com>
date Mon, 06 May 2013 13:49:20 +0200
parents 3d3da5a588bb
children df3aa336a313
comparison
equal deleted inserted replaced
9568:f64a3fec4e42 9573:a79e8020ad4b
566 assert(format != NULL && java_lang_String::is_instance(format), "must be"); 566 assert(format != NULL && java_lang_String::is_instance(format), "must be");
567 char *buf = java_lang_String::as_utf8_string(format); 567 char *buf = java_lang_String::as_utf8_string(format);
568 tty->print(buf, v1, v2, v3); 568 tty->print(buf, v1, v2, v3);
569 JRT_END 569 JRT_END
570 570
571 static void decipher(jlong v, bool ignoreZero) {
572 if (v != 0 || !ignoreZero) {
573 void* p = (void *)(address) v;
574 CodeBlob* cb = CodeCache::find_blob(p);
575 if (cb) {
576 if (cb->is_nmethod()) {
577 char buf[O_BUFLEN];
578 tty->print("%s [%p+%d]", cb->as_nmethod_or_null()->method()->name_and_sig_as_C_string(buf, O_BUFLEN), cb->code_begin(), (address)v - cb->code_begin());
579 return;
580 }
581 cb->print_value_on(tty);
582 return;
583 }
584 if (Universe::heap()->is_in(p)) {
585 oop obj = oop(p);
586 obj->print_value_on(tty);
587 return;
588 }
589 tty->print("%p [long: %d, double %f, char %c]", v, v, v, v);
590 }
591 }
592
571 JRT_LEAF(void, GraalRuntime::vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3)) 593 JRT_LEAF(void, GraalRuntime::vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3))
572 ResourceMark rm; 594 ResourceMark rm;
573 char *buf = (char*) (address) format; 595 char *buf = (char*) (address) format;
574 if (vmError) { 596 if (vmError) {
575 fatal(err_msg(buf, v1, v2, v3)); 597 if (buf != NULL) {
598 fatal(err_msg(buf, v1, v2, v3));
599 } else {
600 fatal("<anonymous error>");
601 }
602 } else if (buf != NULL) {
603 tty->print(buf, v1, v2, v3);
576 } else { 604 } else {
577 tty->print(buf, v1, v2, v3); 605 assert(v2 == 0, "v2 != 0");
606 assert(v3 == 0, "v3 != 0");
607 decipher(v1, false);
578 } 608 }
579 JRT_END 609 JRT_END
580 610
581 JRT_ENTRY(void, GraalRuntime::log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) 611 JRT_ENTRY(void, GraalRuntime::log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline))
582 union { 612 union {