Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Runtime1.cpp @ 6446:c8759f9f9e3c
added Log.printf() for more flexibility in debugging snippets
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 26 Sep 2012 18:15:11 +0200 |
parents | 7d6f44854ee3 |
children | 3bba61323b38 |
comparison
equal
deleted
inserted
replaced
6445:a2299c2fc0c6 | 6446:c8759f9f9e3c |
---|---|
801 } | 801 } |
802 } | 802 } |
803 if (newline) { | 803 if (newline) { |
804 tty->cr(); | 804 tty->cr(); |
805 } | 805 } |
806 JRT_END | |
807 | |
808 JRT_ENTRY(void, Runtime1::graal_log_printf(JavaThread* thread, oop format, jlong val)) | |
809 char buf[1025]; | |
810 assert(format != NULL && java_lang_String::is_instance(format), "must be"); | |
811 | |
812 typeArrayOop value = java_lang_String::value(format); | |
813 int offset = java_lang_String::offset(format); | |
814 int length = java_lang_String::length(format); | |
815 | |
816 assert(value != NULL, "fmtString must be a literal"); | |
817 assert(length >= 0 && length <= 1024, "format must be between 0 and 1024 characters"); | |
818 length = MIN2(length, 1024); | |
819 | |
820 int index = 0; | |
821 while (index < length) { | |
822 buf[index] = value->char_at(index + offset); | |
823 index++; | |
824 } | |
825 buf[index++] = 0; | |
826 tty->print(buf, val); | |
806 JRT_END | 827 JRT_END |
807 | 828 |
808 JRT_ENTRY(void, Runtime1::graal_log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) | 829 JRT_ENTRY(void, Runtime1::graal_log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline)) |
809 union { | 830 union { |
810 jlong l; | 831 jlong l; |