--- a/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon May 09 17:36:13 2016 +0000
+++ b/hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp Mon May 09 22:22:15 2016 +0200
@@ -32,6 +32,7 @@
#include "gc/shared/gcLocker.hpp"
#include "interpreter/oopMapCache.hpp"
#include "interpreter/rewriter.hpp"
+#include "logging/logStream.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/resourceArea.hpp"
@@ -94,7 +95,9 @@
// Start timer after all the sanity checks; not quite accurate, but
// better than adding a bunch of stop() calls.
- RC_TIMER_START(_timer_vm_op_prologue);
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_vm_op_prologue.start();
+ }
// We first load new class versions in the prologue, because somewhere down the
// call chain it is required that the current thread is a Java thread.
@@ -111,11 +114,11 @@
}
// Free os::malloc allocated memory in load_new_class_version.
os::free(_scratch_classes);
- RC_TIMER_STOP(_timer_vm_op_prologue);
+ _timer_vm_op_prologue.stop();
return false;
}
- RC_TIMER_STOP(_timer_vm_op_prologue);
+ _timer_vm_op_prologue.stop();
return true;
}
@@ -128,8 +131,7 @@
// a shared class. We do the remap during the doit() phase of
// the safepoint to be safer.
if (!MetaspaceShared::remap_shared_readonly_as_readwrite()) {
- RC_TRACE_WITH_THREAD(0x00000001, thread,
- ("failed to remap shared readonly space to readwrite, private"));
+ log_info(redefine, class, load)("failed to remap shared readonly space to readwrite, private");
_res = JVMTI_ERROR_INTERNAL;
return;
}
@@ -161,9 +163,9 @@
// check_class() is optionally called for product bits, but is
// always called for non-product bits.
#ifdef PRODUCT
- if (RC_TRACE_ENABLED(0x00004000)) {
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
#endif
- RC_TRACE_WITH_THREAD(0x00004000, thread, ("calling check_class"));
+ log_trace(redefine, class, obsolete, metadata)("calling check_class");
CheckClass check_class(thread);
ClassLoaderDataGraph::classes_do(&check_class);
#ifdef PRODUCT
@@ -178,19 +180,19 @@
// Reset the_class_oop to null for error printing.
_the_class_oop = NULL;
- if (RC_TRACE_ENABLED(0x00000004)) {
+ if (log_is_enabled(Info, redefine, class, timer)) {
// Used to have separate timers for "doit" and "all", but the timer
// overhead skewed the measurements.
jlong doit_time = _timer_rsc_phase1.milliseconds() +
_timer_rsc_phase2.milliseconds();
jlong all_time = _timer_vm_op_prologue.milliseconds() + doit_time;
- RC_TRACE(0x00000004, ("vm_op: all=" UINT64_FORMAT
- " prologue=" UINT64_FORMAT " doit=" UINT64_FORMAT, all_time,
- _timer_vm_op_prologue.milliseconds(), doit_time));
- RC_TRACE(0x00000004,
+ log_info(redefine, class, timer)
+ ("vm_op: all=" UINT64_FORMAT " prologue=" UINT64_FORMAT " doit=" UINT64_FORMAT,
+ all_time, _timer_vm_op_prologue.milliseconds(), doit_time);
+ log_info(redefine, class, timer)
("redefine_single_class: phase1=" UINT64_FORMAT " phase2=" UINT64_FORMAT,
- _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds()));
+ _timer_rsc_phase1.milliseconds(), _timer_rsc_phase2.milliseconds());
}
}
@@ -305,14 +307,14 @@
// both new_name_ref_i and new_signature_ref_i will both be 0.
// In that case, all we are appending is the current entry.
if (new_name_ref_i != name_ref_i) {
- RC_TRACE(0x00080000,
+ log_trace(redefine, class, constantpool)
("NameAndType entry@%d name_ref_index change: %d to %d",
- *merge_cp_length_p, name_ref_i, new_name_ref_i));
+ *merge_cp_length_p, name_ref_i, new_name_ref_i);
}
if (new_signature_ref_i != signature_ref_i) {
- RC_TRACE(0x00080000,
+ log_trace(redefine, class, constantpool)
("NameAndType entry@%d signature_ref_index change: %d to %d",
- *merge_cp_length_p, signature_ref_i, new_signature_ref_i));
+ *merge_cp_length_p, signature_ref_i, new_signature_ref_i);
}
(*merge_cp_p)->name_and_type_at_put(*merge_cp_length_p,
@@ -361,14 +363,13 @@
}
if (klass_ref_i != new_klass_ref_i) {
- RC_TRACE(0x00080000, ("%s entry@%d class_index changed: %d to %d",
- entry_name, *merge_cp_length_p, klass_ref_i, new_klass_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("%s entry@%d class_index changed: %d to %d", entry_name, *merge_cp_length_p, klass_ref_i, new_klass_ref_i);
}
if (name_and_type_ref_i != new_name_and_type_ref_i) {
- RC_TRACE(0x00080000,
+ log_trace(redefine, class, constantpool)
("%s entry@%d name_and_type_index changed: %d to %d",
- entry_name, *merge_cp_length_p, name_and_type_ref_i,
- new_name_and_type_ref_i));
+ entry_name, *merge_cp_length_p, name_and_type_ref_i, new_name_and_type_ref_i);
}
if (scratch_i != *merge_cp_length_p) {
@@ -386,9 +387,8 @@
int new_ref_i = find_or_append_indirect_entry(scratch_cp, ref_i, merge_cp_p,
merge_cp_length_p, THREAD);
if (new_ref_i != ref_i) {
- RC_TRACE(0x00080000,
- ("MethodType entry@%d ref_index change: %d to %d",
- *merge_cp_length_p, ref_i, new_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("MethodType entry@%d ref_index change: %d to %d", *merge_cp_length_p, ref_i, new_ref_i);
}
(*merge_cp_p)->method_type_index_at_put(*merge_cp_length_p, new_ref_i);
if (scratch_i != *merge_cp_length_p) {
@@ -407,9 +407,8 @@
int new_ref_i = find_or_append_indirect_entry(scratch_cp, ref_i, merge_cp_p,
merge_cp_length_p, THREAD);
if (new_ref_i != ref_i) {
- RC_TRACE(0x00080000,
- ("MethodHandle entry@%d ref_index change: %d to %d",
- *merge_cp_length_p, ref_i, new_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("MethodHandle entry@%d ref_index change: %d to %d", *merge_cp_length_p, ref_i, new_ref_i);
}
(*merge_cp_p)->method_handle_index_at_put(*merge_cp_length_p, ref_kind, new_ref_i);
if (scratch_i != *merge_cp_length_p) {
@@ -432,14 +431,13 @@
int new_ref_i = find_or_append_indirect_entry(scratch_cp, old_ref_i, merge_cp_p,
merge_cp_length_p, THREAD);
if (new_bs_i != old_bs_i) {
- RC_TRACE(0x00080000,
- ("InvokeDynamic entry@%d bootstrap_method_attr_index change: %d to %d",
- *merge_cp_length_p, old_bs_i, new_bs_i));
+ log_trace(redefine, class, constantpool)
+ ("InvokeDynamic entry@%d bootstrap_method_attr_index change: %d to %d",
+ *merge_cp_length_p, old_bs_i, new_bs_i);
}
if (new_ref_i != old_ref_i) {
- RC_TRACE(0x00080000,
- ("InvokeDynamic entry@%d name_and_type_index change: %d to %d",
- *merge_cp_length_p, old_ref_i, new_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("InvokeDynamic entry@%d name_and_type_index change: %d to %d", *merge_cp_length_p, old_ref_i, new_ref_i);
}
(*merge_cp_p)->invoke_dynamic_at_put(*merge_cp_length_p, new_bs_i, new_ref_i);
@@ -516,9 +514,8 @@
int new_ref_i = find_or_append_indirect_entry(scratch_cp, old_ref_i, merge_cp_p,
merge_cp_length_p, THREAD);
if (new_ref_i != old_ref_i) {
- RC_TRACE(0x00080000,
- ("operands entry@%d bootstrap method ref_index change: %d to %d",
- _operands_cur_length, old_ref_i, new_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("operands entry@%d bootstrap method ref_index change: %d to %d", _operands_cur_length, old_ref_i, new_ref_i);
}
Array<u2>* merge_ops = (*merge_cp_p)->operands();
@@ -539,9 +536,9 @@
merge_cp_length_p, THREAD);
merge_ops->at_put(new_base++, new_arg_ref_i);
if (new_arg_ref_i != old_arg_ref_i) {
- RC_TRACE(0x00080000,
- ("operands entry@%d bootstrap method argument ref_index change: %d to %d",
- _operands_cur_length, old_arg_ref_i, new_arg_ref_i));
+ log_trace(redefine, class, constantpool)
+ ("operands entry@%d bootstrap method argument ref_index change: %d to %d",
+ _operands_cur_length, old_arg_ref_i, new_arg_ref_i);
}
}
if (old_bs_i != _operands_cur_length) {
@@ -586,14 +583,13 @@
// Shrink the merge_cp operands
merge_cp->shrink_operands(_operands_cur_length, CHECK);
- if (RC_TRACE_ENABLED(0x00040000)) {
+ if (log_is_enabled(Trace, redefine, class, constantpool)) {
// don't want to loop unless we are tracing
int count = 0;
for (int i = 1; i < _operands_index_map_p->length(); i++) {
int value = _operands_index_map_p->at(i);
if (value != -1) {
- RC_TRACE_WITH_THREAD(0x00040000, THREAD,
- ("operands_index_map[%d]: old=%d new=%d", count, i, value));
+ log_trace(redefine, class, constantpool)("operands_index_map[%d]: old=%d new=%d", count, i, value);
count++;
}
}
@@ -795,9 +791,9 @@
}
}
}
- RC_TRACE(0x00008000, ("Method matched: new: %s [%d] == old: %s [%d]",
- k_new_method->name_and_sig_as_C_string(), ni,
- k_old_method->name_and_sig_as_C_string(), oi));
+ log_trace(redefine, class, normalize)
+ ("Method matched: new: %s [%d] == old: %s [%d]",
+ k_new_method->name_and_sig_as_C_string(), ni, k_old_method->name_and_sig_as_C_string(), oi);
// advance to next pair of methods
++oi;
++ni;
@@ -832,8 +828,8 @@
return JVMTI_ERROR_OUT_OF_MEMORY;
}
}
- RC_TRACE(0x00008000, ("Method added: new: %s [%d]",
- k_new_method->name_and_sig_as_C_string(), ni));
+ log_trace(redefine, class, normalize)
+ ("Method added: new: %s [%d]", k_new_method->name_and_sig_as_C_string(), ni);
++ni; // advance to next new method
break;
case deleted:
@@ -846,8 +842,8 @@
// deleted methods must be private
return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_DELETED;
}
- RC_TRACE(0x00008000, ("Method deleted: old: %s [%d]",
- k_old_method->name_and_sig_as_C_string(), oi));
+ log_trace(redefine, class, normalize)
+ ("Method deleted: old: %s [%d]", k_old_method->name_and_sig_as_C_string(), oi);
++oi; // advance to next old method
break;
default:
@@ -973,11 +969,9 @@
instanceKlassHandle the_class = instanceKlassHandle(THREAD, the_class_oop);
Symbol* the_class_sym = the_class->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000001, THREAD,
+ log_debug(redefine, class, load)
("loading name=%s kind=%d (avail_mem=" UINT64_FORMAT "K)",
- the_class->external_name(), _class_load_kind,
- os::available_memory() >> 10));
+ the_class->external_name(), _class_load_kind, os::available_memory() >> 10);
ClassFileStream st((u1*)_class_defs[i].class_bytes,
_class_defs[i].class_byte_count,
@@ -1011,9 +1005,7 @@
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("parse_stream exception: '%s'",
- ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)("parse_stream exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_UnsupportedClassVersionError()) {
@@ -1037,9 +1029,7 @@
the_class->link_class(THREAD);
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD, ("link_class exception: '%s'",
- ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)("link_class exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1075,9 +1065,7 @@
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD,
- ("verify_byte_codes exception: '%s'", ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)("verify_byte_codes exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1090,9 +1078,7 @@
res = merge_cp_and_rewrite(the_class, scratch_class, THREAD);
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD,
- ("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)("merge_cp_and_rewrite exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1110,10 +1096,8 @@
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD,
- ("verify_byte_codes post merge-CP exception: '%s'",
- ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)
+ ("verify_byte_codes post merge-CP exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1130,9 +1114,8 @@
}
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD,
- ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)
+ ("Rewriter::rewrite or link_methods exception: '%s'", ex_name->as_C_string());
CLEAR_PENDING_EXCEPTION;
if (ex_name == vmSymbols::java_lang_OutOfMemoryError()) {
return JVMTI_ERROR_OUT_OF_MEMORY;
@@ -1141,10 +1124,8 @@
}
}
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000001, THREAD,
- ("loaded name=%s (avail_mem=" UINT64_FORMAT "K)",
- the_class->external_name(), os::available_memory() >> 10));
+ log_debug(redefine, class, load)
+ ("loaded name=%s (avail_mem=" UINT64_FORMAT "K)", the_class->external_name(), os::available_memory() >> 10);
}
return JVMTI_ERROR_NONE;
@@ -1152,7 +1133,7 @@
// Map old_index to new_index as needed. scratch_cp is only needed
-// for RC_TRACE() calls.
+// for log calls.
void VM_RedefineClasses::map_index(const constantPoolHandle& scratch_cp,
int old_index, int new_index) {
if (find_new_index(old_index) != 0) {
@@ -1168,8 +1149,8 @@
_index_map_p->at_put(old_index, new_index);
_index_map_count++;
- RC_TRACE(0x00040000, ("mapped tag %d at index %d to %d",
- scratch_cp->tag_at(old_index).value(), old_index, new_index));
+ log_trace(redefine, class, constantpool)
+ ("mapped tag %d at index %d to %d", scratch_cp->tag_at(old_index).value(), old_index, new_index);
} // end map_index()
@@ -1188,7 +1169,7 @@
_operands_index_map_p->at_put(old_index, new_index);
_operands_index_map_count++;
- RC_TRACE(0x00040000, ("mapped bootstrap specifier at index %d to %d", old_index, new_index));
+ log_trace(redefine, class, constantpool)("mapped bootstrap specifier at index %d to %d", old_index, new_index);
} // end map_index()
@@ -1219,9 +1200,7 @@
return false; // robustness
}
- RC_TRACE_WITH_THREAD(0x00010000, THREAD,
- ("old_cp_len=%d, scratch_cp_len=%d", old_cp->length(),
- scratch_cp->length()));
+ log_info(redefine, class, constantpool)("old_cp_len=%d, scratch_cp_len=%d", old_cp->length(), scratch_cp->length());
{
// Pass 0:
@@ -1273,8 +1252,7 @@
// merge_cp_len should be the same as old_cp->length() at this point
// so this trace message is really a "warm-and-breathing" message.
- RC_TRACE_WITH_THREAD(0x00020000, THREAD,
- ("after pass 0: merge_cp_len=%d", *merge_cp_length_p));
+ log_debug(redefine, class, constantpool)("after pass 0: merge_cp_len=%d", *merge_cp_length_p);
int scratch_i; // index into scratch_cp
{
@@ -1339,9 +1317,9 @@
}
}
- RC_TRACE_WITH_THREAD(0x00020000, THREAD,
+ log_debug(redefine, class, constantpool)
("after pass 1a: merge_cp_len=%d, scratch_i=%d, index_map_len=%d",
- *merge_cp_length_p, scratch_i, _index_map_count));
+ *merge_cp_length_p, scratch_i, _index_map_count);
if (scratch_i < scratch_cp->length()) {
// Pass 1b:
@@ -1377,9 +1355,9 @@
CHECK_0);
}
- RC_TRACE_WITH_THREAD(0x00020000, THREAD,
+ log_debug(redefine, class, constantpool)
("after pass 1b: merge_cp_len=%d, scratch_i=%d, index_map_len=%d",
- *merge_cp_length_p, scratch_i, _index_map_count));
+ *merge_cp_length_p, scratch_i, _index_map_count);
}
finalize_operands_merge(*merge_cp_p, THREAD);
@@ -1468,8 +1446,7 @@
return JVMTI_ERROR_INTERNAL;
}
- RC_TRACE_WITH_THREAD(0x00010000, THREAD,
- ("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count));
+ log_info(redefine, class, constantpool)("merge_cp_len=%d, index_map_len=%d", merge_cp_length, _index_map_count);
if (_index_map_count == 0) {
// there is nothing to map between the new and merged constant pools
@@ -1508,15 +1485,14 @@
cp_cleaner.add_scratch_cp(scratch_cp());
}
} else {
- if (RC_TRACE_ENABLED(0x00040000)) {
+ if (log_is_enabled(Trace, redefine, class, constantpool)) {
// don't want to loop unless we are tracing
int count = 0;
for (int i = 1; i < _index_map_p->length(); i++) {
int value = _index_map_p->at(i);
if (value != -1) {
- RC_TRACE_WITH_THREAD(0x00040000, THREAD,
- ("index_map[%d]: old=%d new=%d", count, i, value));
+ log_trace(redefine, class, constantpool)("index_map[%d]: old=%d new=%d", count, i, value);
count++;
}
}
@@ -1653,9 +1629,7 @@
}
if (HAS_PENDING_EXCEPTION) {
Symbol* ex_name = PENDING_EXCEPTION->klass()->name();
- // RC_TRACE_WITH_THREAD macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000002, THREAD,
- ("rewrite_cp_refs_in_method exception: '%s'", ex_name->as_C_string()));
+ log_info(redefine, class, load, exceptions)("rewrite_cp_refs_in_method exception: '%s'", ex_name->as_C_string());
// Need to clear pending exception here as the super caller sets
// the JVMTI_ERROR_INTERNAL if the returned value is false.
CLEAR_PENDING_EXCEPTION;
@@ -1715,14 +1689,12 @@
if (!StressLdcRewrite && new_index <= max_jubyte) {
// The new value can still use ldc instead of ldc_w
// unless we are trying to stress ldc -> ldc_w rewriting
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
- p2i(bcp), cp_index, new_index));
+ log_trace(redefine, class, constantpool)
+ ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c), p2i(bcp), cp_index, new_index);
*(bcp + 1) = new_index;
} else {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d",
- Bytecodes::name(c), p2i(bcp), cp_index, new_index));
+ log_trace(redefine, class, constantpool)
+ ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c), p2i(bcp), cp_index, new_index);
// the new value needs ldc_w instead of ldc
u_char inst_buffer[4]; // max instruction size is 4 bytes
bcp = (address)inst_buffer;
@@ -1781,9 +1753,8 @@
int new_index = find_new_index(cp_index);
if (new_index != 0) {
// the original index is mapped so update w/ new value
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
- p2i(bcp), cp_index, new_index));
+ log_trace(redefine, class, constantpool)
+ ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),p2i(bcp), cp_index, new_index);
// Rewriter::rewrite_method() uses put_native_u2() in this
// situation because it is reusing the constant pool index
// location for a native index into the ConstantPoolCache.
@@ -1823,8 +1794,7 @@
return true;
}
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("class_annotations length=%d", class_annotations->length()));
+ log_debug(redefine, class, annotation)("class_annotations length=%d", class_annotations->length());
int byte_i = 0; // byte index into class_annotations
return rewrite_cp_refs_in_annotations_typeArray(class_annotations, byte_i,
@@ -1846,8 +1816,7 @@
if ((byte_i_ref + 2) > annotations_typeArray->length()) {
// not enough room for num_annotations field
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for num_annotations field"));
+ log_debug(redefine, class, annotation)("length() is too small for num_annotations field");
return false;
}
@@ -1855,15 +1824,13 @@
annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("num_annotations=%d", num_annotations));
+ log_debug(redefine, class, annotation)("num_annotations=%d", num_annotations);
int calc_num_annotations = 0;
for (; calc_num_annotations < num_annotations; calc_num_annotations++) {
if (!rewrite_cp_refs_in_annotation_struct(annotations_typeArray,
byte_i_ref, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad annotation_struct at %d", calc_num_annotations));
+ log_debug(redefine, class, annotation)("bad annotation_struct at %d", calc_num_annotations);
// propagate failure back to caller
return false;
}
@@ -1891,8 +1858,7 @@
AnnotationArray* annotations_typeArray, int &byte_i_ref, TRAPS) {
if ((byte_i_ref + 2 + 2) > annotations_typeArray->length()) {
// not enough room for smallest annotation_struct
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for annotation_struct"));
+ log_debug(redefine, class, annotation)("length() is too small for annotation_struct");
return false;
}
@@ -1903,9 +1869,8 @@
annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_index=%d num_element_value_pairs=%d", type_index,
- num_element_value_pairs));
+ log_debug(redefine, class, annotation)
+ ("type_index=%d num_element_value_pairs=%d", type_index, num_element_value_pairs);
int calc_num_element_value_pairs = 0;
for (; calc_num_element_value_pairs < num_element_value_pairs;
@@ -1913,8 +1878,7 @@
if ((byte_i_ref + 2) > annotations_typeArray->length()) {
// not enough room for another element_name_index, let alone
// the rest of another component
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for element_name_index"));
+ log_debug(redefine, class, annotation)("length() is too small for element_name_index");
return false;
}
@@ -1922,13 +1886,11 @@
annotations_typeArray, byte_i_ref,
"element_name_index", THREAD);
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("element_name_index=%d", element_name_index));
+ log_debug(redefine, class, annotation)("element_name_index=%d", element_name_index);
if (!rewrite_cp_refs_in_element_value(annotations_typeArray,
byte_i_ref, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad element_value at %d", calc_num_element_value_pairs));
+ log_debug(redefine, class, annotation)("bad element_value at %d", calc_num_element_value_pairs);
// propagate failure back to caller
return false;
}
@@ -1953,7 +1915,7 @@
u2 old_cp_index = Bytes::get_Java_u2(cp_index_addr);
u2 new_cp_index = find_new_index(old_cp_index);
if (new_cp_index != 0) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("mapped old %s=%d", trace_mesg, old_cp_index));
+ log_debug(redefine, class, annotation)("mapped old %s=%d", trace_mesg, old_cp_index);
Bytes::put_Java_u2(cp_index_addr, new_cp_index);
old_cp_index = new_cp_index;
}
@@ -1988,14 +1950,13 @@
if ((byte_i_ref + 1) > annotations_typeArray->length()) {
// not enough room for a tag let alone the rest of an element_value
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a tag"));
+ log_debug(redefine, class, annotation)("length() is too small for a tag");
return false;
}
u1 tag = annotations_typeArray->at(byte_i_ref);
byte_i_ref++;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("tag='%c'", tag));
+ log_debug(redefine, class, annotation)("tag='%c'", tag);
switch (tag) {
// These BaseType tag values are from Table 4.2 in VM spec:
@@ -2017,8 +1978,7 @@
if ((byte_i_ref + 2) > annotations_typeArray->length()) {
// not enough room for a const_value_index
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a const_value_index"));
+ log_debug(redefine, class, annotation)("length() is too small for a const_value_index");
return false;
}
@@ -2026,8 +1986,7 @@
annotations_typeArray, byte_i_ref,
"const_value_index", THREAD);
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("const_value_index=%d", const_value_index));
+ log_debug(redefine, class, annotation)("const_value_index=%d", const_value_index);
} break;
case 'e':
@@ -2036,8 +1995,7 @@
if ((byte_i_ref + 4) > annotations_typeArray->length()) {
// not enough room for a enum_const_value
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a enum_const_value"));
+ log_debug(redefine, class, annotation)("length() is too small for a enum_const_value");
return false;
}
@@ -2049,9 +2007,8 @@
annotations_typeArray, byte_i_ref,
"const_name_index", THREAD);
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_name_index=%d const_name_index=%d", type_name_index,
- const_name_index));
+ log_debug(redefine, class, annotation)
+ ("type_name_index=%d const_name_index=%d", type_name_index, const_name_index);
} break;
case 'c':
@@ -2060,8 +2017,7 @@
if ((byte_i_ref + 2) > annotations_typeArray->length()) {
// not enough room for a class_info_index
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a class_info_index"));
+ log_debug(redefine, class, annotation)("length() is too small for a class_info_index");
return false;
}
@@ -2069,8 +2025,7 @@
annotations_typeArray, byte_i_ref,
"class_info_index", THREAD);
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("class_info_index=%d", class_info_index));
+ log_debug(redefine, class, annotation)("class_info_index=%d", class_info_index);
} break;
case '@':
@@ -2087,8 +2042,7 @@
{
if ((byte_i_ref + 2) > annotations_typeArray->length()) {
// not enough room for a num_values field
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a num_values field"));
+ log_debug(redefine, class, annotation)("length() is too small for a num_values field");
return false;
}
@@ -2097,14 +2051,13 @@
u2 num_values = Bytes::get_Java_u2((address)
annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("num_values=%d", num_values));
+ log_debug(redefine, class, annotation)("num_values=%d", num_values);
int calc_num_values = 0;
for (; calc_num_values < num_values; calc_num_values++) {
if (!rewrite_cp_refs_in_element_value(
annotations_typeArray, byte_i_ref, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad nested element_value at %d", calc_num_values));
+ log_debug(redefine, class, annotation)("bad nested element_value at %d", calc_num_values);
// propagate failure back to caller
return false;
}
@@ -2113,7 +2066,7 @@
} break;
default:
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("bad tag=0x%x", tag));
+ log_debug(redefine, class, annotation)("bad tag=0x%x", tag);
return false;
} // end decode tag field
@@ -2132,8 +2085,7 @@
return true;
}
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("fields_annotations length=%d", fields_annotations->length()));
+ log_debug(redefine, class, annotation)("fields_annotations length=%d", fields_annotations->length());
for (int i = 0; i < fields_annotations->length(); i++) {
AnnotationArray* field_annotations = fields_annotations->at(i);
@@ -2145,8 +2097,7 @@
int byte_i = 0; // byte index into field_annotations
if (!rewrite_cp_refs_in_annotations_typeArray(field_annotations, byte_i,
THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad field_annotations at %d", i));
+ log_debug(redefine, class, annotation)("bad field_annotations at %d", i);
// propagate failure back to caller
return false;
}
@@ -2172,8 +2123,7 @@
int byte_i = 0; // byte index into method_annotations
if (!rewrite_cp_refs_in_annotations_typeArray(method_annotations, byte_i,
THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad method_annotations at %d", i));
+ log_debug(redefine, class, annotation)("bad method_annotations at %d", i);
// propagate failure back to caller
return false;
}
@@ -2210,8 +2160,7 @@
if (method_parameter_annotations->length() < 1) {
// not enough room for a num_parameters field
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a num_parameters field at %d", i));
+ log_debug(redefine, class, annotation)("length() is too small for a num_parameters field at %d", i);
return false;
}
@@ -2220,15 +2169,13 @@
u1 num_parameters = method_parameter_annotations->at(byte_i);
byte_i++;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("num_parameters=%d", num_parameters));
+ log_debug(redefine, class, annotation)("num_parameters=%d", num_parameters);
int calc_num_parameters = 0;
for (; calc_num_parameters < num_parameters; calc_num_parameters++) {
if (!rewrite_cp_refs_in_annotations_typeArray(
method_parameter_annotations, byte_i, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad method_parameter_annotations at %d", calc_num_parameters));
+ log_debug(redefine, class, annotation)("bad method_parameter_annotations at %d", calc_num_parameters);
// propagate failure back to caller
return false;
}
@@ -2264,8 +2211,7 @@
if (!rewrite_cp_refs_in_element_value(
method_default_annotations, byte_i, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad default element_value at %d", i));
+ log_debug(redefine, class, annotation)("bad default element_value at %d", i);
// propagate failure back to caller
return false;
}
@@ -2285,8 +2231,7 @@
return true;
}
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("class_type_annotations length=%d", class_type_annotations->length()));
+ log_debug(redefine, class, annotation)("class_type_annotations length=%d", class_type_annotations->length());
int byte_i = 0; // byte index into class_type_annotations
return rewrite_cp_refs_in_type_annotations_typeArray(class_type_annotations,
@@ -2304,8 +2249,7 @@
return true;
}
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("fields_type_annotations length=%d", fields_type_annotations->length()));
+ log_debug(redefine, class, annotation)("fields_type_annotations length=%d", fields_type_annotations->length());
for (int i = 0; i < fields_type_annotations->length(); i++) {
AnnotationArray* field_type_annotations = fields_type_annotations->at(i);
@@ -2317,8 +2261,7 @@
int byte_i = 0; // byte index into field_type_annotations
if (!rewrite_cp_refs_in_type_annotations_typeArray(field_type_annotations,
byte_i, "field_info", THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad field_type_annotations at %d", i));
+ log_debug(redefine, class, annotation)("bad field_type_annotations at %d", i);
// propagate failure back to caller
return false;
}
@@ -2341,14 +2284,12 @@
continue;
}
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("methods type_annotations length=%d", method_type_annotations->length()));
+ log_debug(redefine, class, annotation)("methods type_annotations length=%d", method_type_annotations->length());
int byte_i = 0; // byte index into method_type_annotations
if (!rewrite_cp_refs_in_type_annotations_typeArray(method_type_annotations,
byte_i, "method_info", THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad method_type_annotations at %d", i));
+ log_debug(redefine, class, annotation)("bad method_type_annotations at %d", i);
// propagate failure back to caller
return false;
}
@@ -2374,8 +2315,7 @@
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
// not enough room for num_annotations field
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for num_annotations field"));
+ log_debug(redefine, class, annotation)("length() is too small for num_annotations field");
return false;
}
@@ -2383,15 +2323,13 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("num_type_annotations=%d", num_annotations));
+ log_debug(redefine, class, annotation)("num_type_annotations=%d", num_annotations);
int calc_num_annotations = 0;
for (; calc_num_annotations < num_annotations; calc_num_annotations++) {
if (!rewrite_cp_refs_in_type_annotation_struct(type_annotations_typeArray,
byte_i_ref, location_mesg, THREAD)) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("bad type_annotation_struct at %d", calc_num_annotations));
+ log_debug(redefine, class, annotation)("bad type_annotation_struct at %d", calc_num_annotations);
// propagate failure back to caller
return false;
}
@@ -2399,10 +2337,9 @@
assert(num_annotations == calc_num_annotations, "sanity check");
if (byte_i_ref != type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("read wrong amount of bytes at end of processing "
- "type_annotations_typeArray (%d of %d bytes were read)",
- byte_i_ref, type_annotations_typeArray->length()));
+ log_debug(redefine, class, annotation)
+ ("read wrong amount of bytes at end of processing type_annotations_typeArray (%d of %d bytes were read)",
+ byte_i_ref, type_annotations_typeArray->length());
return false;
}
@@ -2479,15 +2416,14 @@
if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
// not enough room for a target_type let alone the rest of a type_annotation
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a target_type"));
+ log_debug(redefine, class, annotation)("length() is too small for a target_type");
return false;
}
u1 target_type = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("target_type=0x%.2x", target_type));
- RC_TRACE_WITH_THREAD(0x02000000, THREAD, ("location=%s", location_mesg));
+ log_debug(redefine, class, annotation)("target_type=0x%.2x", target_type);
+ log_debug(redefine, class, annotation)("location=%s", location_mesg);
// Skip over target_info
switch (target_type) {
@@ -2505,17 +2441,14 @@
// }
//
if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a type_parameter_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a type_parameter_target");
return false;
}
u1 type_parameter_index = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_parameter_target: type_parameter_index=%d",
- type_parameter_index));
+ log_debug(redefine, class, annotation)("type_parameter_target: type_parameter_index=%d", type_parameter_index);
} break;
case 0x10:
@@ -2531,8 +2464,7 @@
// }
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a supertype_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a supertype_target");
return false;
}
@@ -2540,8 +2472,7 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("supertype_target: supertype_index=%d", supertype_index));
+ log_debug(redefine, class, annotation)("supertype_target: supertype_index=%d", supertype_index);
} break;
case 0x11:
@@ -2559,8 +2490,7 @@
// }
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a type_parameter_bound_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a type_parameter_bound_target");
return false;
}
@@ -2569,9 +2499,8 @@
u1 bound_index = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_parameter_bound_target: type_parameter_index=%d, bound_index=%d",
- type_parameter_index, bound_index));
+ log_debug(redefine, class, annotation)
+ ("type_parameter_bound_target: type_parameter_index=%d, bound_index=%d", type_parameter_index, bound_index);
} break;
case 0x13:
@@ -2589,8 +2518,7 @@
// empty_target {
// }
//
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("empty_target"));
+ log_debug(redefine, class, annotation)("empty_target");
} break;
case 0x16:
@@ -2604,17 +2532,15 @@
// }
//
if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a formal_parameter_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a formal_parameter_target");
return false;
}
u1 formal_parameter_index = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("formal_parameter_target: formal_parameter_index=%d",
- formal_parameter_index));
+ log_debug(redefine, class, annotation)
+ ("formal_parameter_target: formal_parameter_index=%d", formal_parameter_index);
} break;
case 0x17:
@@ -2628,8 +2554,7 @@
// }
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a throws_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a throws_target");
return false;
}
@@ -2637,8 +2562,7 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("throws_target: throws_type_index=%d", throws_type_index));
+ log_debug(redefine, class, annotation)("throws_target: throws_type_index=%d", throws_type_index);
} break;
case 0x40:
@@ -2661,8 +2585,7 @@
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
// not enough room for a table_length let alone the rest of a localvar_target
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a localvar_target table_length"));
+ log_debug(redefine, class, annotation)("length() is too small for a localvar_target table_length");
return false;
}
@@ -2670,16 +2593,14 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("localvar_target: table_length=%d", table_length));
+ log_debug(redefine, class, annotation)("localvar_target: table_length=%d", table_length);
int table_struct_size = 2 + 2 + 2; // 3 u2 variables per table entry
int table_size = table_length * table_struct_size;
if ((byte_i_ref + table_size) > type_annotations_typeArray->length()) {
// not enough room for a table
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a table array of length %d", table_length));
+ log_debug(redefine, class, annotation)("length() is too small for a table array of length %d", table_length);
return false;
}
@@ -2698,8 +2619,7 @@
// }
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a catch_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a catch_target");
return false;
}
@@ -2707,8 +2627,7 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("catch_target: exception_table_index=%d", exception_table_index));
+ log_debug(redefine, class, annotation)("catch_target: exception_table_index=%d", exception_table_index);
} break;
case 0x43:
@@ -2731,8 +2650,7 @@
// }
//
if ((byte_i_ref + 2) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a offset_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a offset_target");
return false;
}
@@ -2740,8 +2658,7 @@
type_annotations_typeArray->adr_at(byte_i_ref));
byte_i_ref += 2;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("offset_target: offset=%d", offset));
+ log_debug(redefine, class, annotation)("offset_target: offset=%d", offset);
} break;
case 0x47:
@@ -2769,8 +2686,7 @@
// }
//
if ((byte_i_ref + 3) > type_annotations_typeArray->length()) {
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a type_argument_target"));
+ log_debug(redefine, class, annotation)("length() is too small for a type_argument_target");
return false;
}
@@ -2780,14 +2696,12 @@
u1 type_argument_index = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_argument_target: offset=%d, type_argument_index=%d",
- offset, type_argument_index));
+ log_debug(redefine, class, annotation)
+ ("type_argument_target: offset=%d, type_argument_index=%d", offset, type_argument_index);
} break;
default:
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("unknown target_type"));
+ log_debug(redefine, class, annotation)("unknown target_type");
#ifdef ASSERT
ShouldNotReachHere();
#endif
@@ -2814,24 +2728,21 @@
if ((byte_i_ref + 1) > type_annotations_typeArray->length()) {
// not enough room for a path_length let alone the rest of the type_path
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for a type_path"));
+ log_debug(redefine, class, annotation)("length() is too small for a type_path");
return false;
}
u1 path_length = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("type_path: path_length=%d", path_length));
+ log_debug(redefine, class, annotation)("type_path: path_length=%d", path_length);
int calc_path_length = 0;
for (; calc_path_length < path_length; calc_path_length++) {
if ((byte_i_ref + 1 + 1) > type_annotations_typeArray->length()) {
// not enough room for a path
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("length() is too small for path entry %d of %d",
- calc_path_length, path_length));
+ log_debug(redefine, class, annotation)
+ ("length() is too small for path entry %d of %d", calc_path_length, path_length);
return false;
}
@@ -2840,14 +2751,13 @@
u1 type_argument_index = type_annotations_typeArray->at(byte_i_ref);
byte_i_ref += 1;
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
+ log_debug(redefine, class, annotation)
("type_path: path[%d]: type_path_kind=%d, type_argument_index=%d",
- calc_path_length, type_path_kind, type_argument_index));
+ calc_path_length, type_path_kind, type_argument_index);
if (type_path_kind > 3 || (type_path_kind != 3 && type_argument_index != 0)) {
// not enough room for a path
- RC_TRACE_WITH_THREAD(0x02000000, THREAD,
- ("inconsistent type_path values"));
+ log_debug(redefine, class, annotation)("inconsistent type_path values");
return false;
}
}
@@ -2883,8 +2793,7 @@
u2 number_of_entries = Bytes::get_Java_u2(stackmap_p);
stackmap_p += 2;
- RC_TRACE_WITH_THREAD(0x04000000, THREAD,
- ("number_of_entries=%u", number_of_entries));
+ log_debug(redefine, class, stackmap)("number_of_entries=%u", number_of_entries);
// walk through each stack_map_frame
u2 calc_number_of_entries = 0;
@@ -3084,16 +2993,14 @@
u2 cpool_index = Bytes::get_Java_u2(stackmap_p_ref);
u2 new_cp_index = find_new_index(cpool_index);
if (new_cp_index != 0) {
- RC_TRACE_WITH_THREAD(0x04000000, THREAD,
- ("mapped old cpool_index=%d", cpool_index));
+ log_debug(redefine, class, stackmap)("mapped old cpool_index=%d", cpool_index);
Bytes::put_Java_u2(stackmap_p_ref, new_cp_index);
cpool_index = new_cp_index;
}
stackmap_p_ref += 2;
- RC_TRACE_WITH_THREAD(0x04000000, THREAD,
- ("frame_i=%u, frame_type=%u, cpool_index=%d", frame_i,
- frame_type, cpool_index));
+ log_debug(redefine, class, stackmap)
+ ("frame_i=%u, frame_type=%u, cpool_index=%d", frame_i, frame_type, cpool_index);
} break;
// Uninitialized_variable_info {
@@ -3106,8 +3013,7 @@
break;
default:
- RC_TRACE_WITH_THREAD(0x04000000, THREAD,
- ("frame_i=%u, frame_type=%u, bad tag=0x%x", frame_i, frame_type, tag));
+ log_debug(redefine, class, stackmap)("frame_i=%u, frame_type=%u, bad tag=0x%x", frame_i, frame_type, tag);
ShouldNotReachHere();
break;
} // end switch (tag)
@@ -3157,29 +3063,25 @@
jshort cur_index = fs.name_index();
jshort new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("field-name_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("field-name_index change: %d to %d", cur_index, new_index);
fs.set_name_index(new_index);
}
cur_index = fs.signature_index();
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("field-signature_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("field-signature_index change: %d to %d", cur_index, new_index);
fs.set_signature_index(new_index);
}
cur_index = fs.initval_index();
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("field-initval_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("field-initval_index change: %d to %d", cur_index, new_index);
fs.set_initval_index(new_index);
}
cur_index = fs.generic_signature_index();
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("field-generic_signature change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("field-generic_signature change: %d to %d", cur_index, new_index);
fs.set_generic_signature_index(new_index);
}
} // end for each field
@@ -3196,22 +3098,19 @@
}
int new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("inner_class_info change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("inner_class_info change: %d to %d", cur_index, new_index);
iter.set_inner_class_info_index(new_index);
}
cur_index = iter.outer_class_info_index();
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("outer_class_info change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("outer_class_info change: %d to %d", cur_index, new_index);
iter.set_outer_class_info_index(new_index);
}
cur_index = iter.inner_name_index();
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("inner_name change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("inner_name change: %d to %d", cur_index, new_index);
iter.set_inner_name_index(new_index);
}
} // end for each inner class
@@ -3225,23 +3124,20 @@
int new_index = find_new_index(method->name_index());
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("method-name_index change: %d to %d", method->name_index(),
- new_index));
+ log_trace(redefine, class, constantpool)
+ ("method-name_index change: %d to %d", method->name_index(), new_index);
method->set_name_index(new_index);
}
new_index = find_new_index(method->signature_index());
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("method-signature_index change: %d to %d",
- method->signature_index(), new_index));
+ log_trace(redefine, class, constantpool)
+ ("method-signature_index change: %d to %d", method->signature_index(), new_index);
method->set_signature_index(new_index);
}
new_index = find_new_index(method->generic_signature_index());
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("method-generic_signature_index change: %d to %d",
- method->generic_signature_index(), new_index));
+ log_trace(redefine, class, constantpool)
+ ("method-generic_signature_index change: %d to %d", method->generic_signature_index(), new_index);
method->set_generic_signature_index(new_index);
}
@@ -3255,8 +3151,7 @@
int cur_index = cext_table[j].class_cp_index;
int new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("cext-class_cp_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("cext-class_cp_index change: %d to %d", cur_index, new_index);
cext_table[j].class_cp_index = (u2)new_index;
}
} // end for each checked exception table entry
@@ -3274,8 +3169,7 @@
int cur_index = ex_table.catch_type_index(j);
int new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("ext-klass_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("ext-klass_index change: %d to %d", cur_index, new_index);
ex_table.set_catch_type_index(j, new_index);
}
} // end for each exception table entry
@@ -3292,23 +3186,19 @@
int cur_index = lv_table[j].name_cp_index;
int new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("lvt-name_cp_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("lvt-name_cp_index change: %d to %d", cur_index, new_index);
lv_table[j].name_cp_index = (u2)new_index;
}
cur_index = lv_table[j].descriptor_cp_index;
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("lvt-descriptor_cp_index change: %d to %d", cur_index,
- new_index));
+ log_trace(redefine, class, constantpool)("lvt-descriptor_cp_index change: %d to %d", cur_index, new_index);
lv_table[j].descriptor_cp_index = (u2)new_index;
}
cur_index = lv_table[j].signature_cp_index;
new_index = find_new_index(cur_index);
if (new_index != 0) {
- RC_TRACE_WITH_THREAD(0x00080000, THREAD,
- ("lvt-signature_cp_index change: %d to %d", cur_index, new_index));
+ log_trace(redefine, class, constantpool)("lvt-signature_cp_index change: %d to %d", cur_index, new_index);
lv_table[j].signature_cp_index = (u2)new_index;
}
} // end for each local variable table entry
@@ -3332,13 +3222,6 @@
bool trace_name_printed = false;
InstanceKlass *the_class = InstanceKlass::cast(_the_class_oop);
- // Very noisy: only enable this call if you are trying to determine
- // that a specific class gets found by this routine.
- // RC_TRACE macro has an embedded ResourceMark
- // RC_TRACE_WITH_THREAD(0x00100000, THREAD,
- // ("adjust check: name=%s", k->external_name()));
- // trace_name_printed = true;
-
// If the class being redefined is java.lang.Object, we need to fix all
// array class vtables also
if (k->is_array_klass() && _the_class_oop == SystemDictionary::Object_klass()) {
@@ -3576,9 +3459,11 @@
// With tracing we try not to "yack" too much. The position of
// this trace assumes there are fewer obsolete methods than
// EMCP methods.
- RC_TRACE(0x00000100, ("mark %s(%s) as obsolete",
- old_method->name()->as_C_string(),
- old_method->signature()->as_C_string()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, mark)) {
+ ResourceMark rm;
+ log_trace(redefine, class, obsolete, mark)
+ ("mark %s(%s) as obsolete", old_method->name()->as_C_string(), old_method->signature()->as_C_string());
+ }
}
old_method->set_is_old();
}
@@ -3596,14 +3481,15 @@
// With tracing we try not to "yack" too much. The position of
// this trace assumes there are fewer obsolete methods than
// EMCP methods.
- RC_TRACE(0x00000100, ("mark deleted %s(%s) as obsolete",
- old_method->name()->as_C_string(),
- old_method->signature()->as_C_string()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, mark)) {
+ ResourceMark rm;
+ log_trace(redefine, class, obsolete, mark)
+ ("mark deleted %s(%s) as obsolete", old_method->name()->as_C_string(), old_method->signature()->as_C_string());
+ }
}
assert((emcp_method_count + obsolete_count) == _old_methods->length(),
"sanity check");
- RC_TRACE(0x00000100, ("EMCP_cnt=%d, obsolete_cnt=%d", emcp_method_count,
- obsolete_count));
+ log_trace(redefine, class, obsolete, mark)("EMCP_cnt=%d, obsolete_cnt=%d", emcp_method_count, obsolete_count);
return emcp_method_count;
}
@@ -3866,7 +3752,10 @@
Klass* scratch_class_oop, TRAPS) {
HandleMark hm(THREAD); // make sure handles from this call are freed
- RC_TIMER_START(_timer_rsc_phase1);
+
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_rsc_phase1.start();
+ }
instanceKlassHandle scratch_class(scratch_class_oop);
@@ -4083,8 +3972,10 @@
// keep track of previous versions of this class
the_class->add_previous_version(scratch_class, emcp_method_count);
- RC_TIMER_STOP(_timer_rsc_phase1);
- RC_TIMER_START(_timer_rsc_phase2);
+ _timer_rsc_phase1.stop();
+ if (log_is_enabled(Info, redefine, class, timer)) {
+ _timer_rsc_phase2.start();
+ }
// Adjust constantpool caches and vtables for all classes
// that reference methods of the evolved class.
@@ -4104,25 +3995,20 @@
the_class->oop_map_cache()->flush_obsolete_entries();
}
- // increment the classRedefinedCount field in the_class and in any
- // direct and indirect subclasses of the_class
- increment_class_counter((InstanceKlass *)the_class(), THREAD);
-
- // RC_TRACE macro has an embedded ResourceMark
- RC_TRACE_WITH_THREAD(0x00000001, THREAD,
- ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
- the_class->external_name(),
- java_lang_Class::classRedefinedCount(the_class_mirror),
- os::available_memory() >> 10));
-
{
ResourceMark rm(THREAD);
+ // increment the classRedefinedCount field in the_class and in any
+ // direct and indirect subclasses of the_class
+ increment_class_counter((InstanceKlass *)the_class(), THREAD);
+ log_info(redefine, class, load)
+ ("redefined name=%s, count=%d (avail_mem=" UINT64_FORMAT "K)",
+ the_class->external_name(), java_lang_Class::classRedefinedCount(the_class_mirror), os::available_memory() >> 10);
Events::log_redefinition(THREAD, "redefined class name=%s, count=%d",
the_class->external_name(),
java_lang_Class::classRedefinedCount(the_class_mirror));
}
- RC_TIMER_STOP(_timer_rsc_phase2);
+ _timer_rsc_phase2.stop();
} // end redefine_single_class()
@@ -4136,8 +4022,7 @@
if (class_oop != _the_class_oop) {
// _the_class_oop count is printed at end of redefine_single_class()
- RC_TRACE_WITH_THREAD(0x00000008, THREAD,
- ("updated count in subclass=%s to %d", ik->external_name(), new_count));
+ log_debug(redefine, class, subclass)("updated count in subclass=%s to %d", ik->external_name(), new_count);
}
for (Klass *subk = ik->subklass(); subk != NULL;
@@ -4159,11 +4044,10 @@
ResourceMark rm(_thread);
if (k->vtable_length() > 0 &&
!k->vtable()->check_no_old_or_obsolete_entries()) {
- if (RC_TRACE_ENABLED(0x00004000)) {
- RC_TRACE_WITH_THREAD(0x00004000, _thread,
- ("klassVtable::check_no_old_or_obsolete_entries failure"
- " -- OLD or OBSOLETE method found -- class: %s",
- k->signature_name()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
+ log_trace(redefine, class, obsolete, metadata)
+ ("klassVtable::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
+ k->signature_name());
k->vtable()->dump_vtable();
}
no_old_methods = false;
@@ -4176,11 +4060,10 @@
// an itable should never contain old or obsolete methods
if (ik->itable_length() > 0 &&
!ik->itable()->check_no_old_or_obsolete_entries()) {
- if (RC_TRACE_ENABLED(0x00004000)) {
- RC_TRACE_WITH_THREAD(0x00004000, _thread,
- ("klassItable::check_no_old_or_obsolete_entries failure"
- " -- OLD or OBSOLETE method found -- class: %s",
- ik->signature_name()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
+ log_trace(redefine, class, obsolete, metadata)
+ ("klassItable::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
+ ik->signature_name());
ik->itable()->dump_itable();
}
no_old_methods = false;
@@ -4190,11 +4073,10 @@
if (ik->constants() != NULL &&
ik->constants()->cache() != NULL &&
!ik->constants()->cache()->check_no_old_or_obsolete_entries()) {
- if (RC_TRACE_ENABLED(0x00004000)) {
- RC_TRACE_WITH_THREAD(0x00004000, _thread,
- ("cp-cache::check_no_old_or_obsolete_entries failure"
- " -- OLD or OBSOLETE method found -- class: %s",
- ik->signature_name()));
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
+ log_trace(redefine, class, obsolete, metadata)
+ ("cp-cache::check_no_old_or_obsolete_entries failure -- OLD or OBSOLETE method found -- class: %s",
+ ik->signature_name());
ik->constants()->cache()->dump_cache();
}
no_old_methods = false;
@@ -4203,10 +4085,10 @@
// print and fail guarantee if old methods are found.
if (!no_old_methods) {
- if (RC_TRACE_ENABLED(0x00004000)) {
+ if (log_is_enabled(Trace, redefine, class, obsolete, metadata)) {
dump_methods();
} else {
- tty->print_cr("INFO: use the '-XX:TraceRedefineClasses=16384' option "
+ log_trace(redefine, class)("Use the '-Xlog:redefine+class*:' option "
"to see more info about the following guarantee() failure.");
}
guarantee(false, "OLD and/or OBSOLETE method(s) found");
@@ -4216,54 +4098,60 @@
void VM_RedefineClasses::dump_methods() {
int j;
- RC_TRACE(0x00004000, ("_old_methods --"));
+ log_trace(redefine, class, dump)("_old_methods --");
for (j = 0; j < _old_methods->length(); ++j) {
+ LogStreamHandle(Trace, redefine, class, dump) log_stream;
Method* m = _old_methods->at(j);
- RC_TRACE_NO_CR(0x00004000, ("%4d (%5d) ", j, m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
+ log_stream.print("%4d (%5d) ", j, m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.print(" -- ");
+ m->print_name(&log_stream);
+ log_stream.cr();
}
- RC_TRACE(0x00004000, ("_new_methods --"));
+ log_trace(redefine, class, dump)("_new_methods --");
for (j = 0; j < _new_methods->length(); ++j) {
+ LogStreamHandle(Trace, redefine, class, dump) log_stream;
Method* m = _new_methods->at(j);
- RC_TRACE_NO_CR(0x00004000, ("%4d (%5d) ", j, m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
+ log_stream.print("%4d (%5d) ", j, m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.print(" -- ");
+ m->print_name(&log_stream);
+ log_stream.cr();
}
- RC_TRACE(0x00004000, ("_matching_(old/new)_methods --"));
+ log_trace(redefine, class, dump)("_matching_methods --");
for (j = 0; j < _matching_methods_length; ++j) {
+ LogStreamHandle(Trace, redefine, class, dump) log_stream;
Method* m = _matching_old_methods[j];
- RC_TRACE_NO_CR(0x00004000, ("%4d (%5d) ", j, m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
+ log_stream.print("%4d (%5d) ", j, m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.print(" -- ");
+ m->print_name();
+ log_stream.cr();
+
m = _matching_new_methods[j];
- RC_TRACE_NO_CR(0x00004000, (" (%5d) ", m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->cr();
+ log_stream.print(" (%5d) ", m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.cr();
}
- RC_TRACE(0x00004000, ("_deleted_methods --"));
+ log_trace(redefine, class, dump)("_deleted_methods --");
for (j = 0; j < _deleted_methods_length; ++j) {
+ LogStreamHandle(Trace, redefine, class, dump) log_stream;
Method* m = _deleted_methods[j];
- RC_TRACE_NO_CR(0x00004000, ("%4d (%5d) ", j, m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
+ log_stream.print("%4d (%5d) ", j, m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.print(" -- ");
+ m->print_name(&log_stream);
+ log_stream.cr();
}
- RC_TRACE(0x00004000, ("_added_methods --"));
+ log_trace(redefine, class, dump)("_added_methods --");
for (j = 0; j < _added_methods_length; ++j) {
+ LogStreamHandle(Trace, redefine, class, dump) log_stream;
Method* m = _added_methods[j];
- RC_TRACE_NO_CR(0x00004000, ("%4d (%5d) ", j, m->vtable_index()));
- m->access_flags().print_on(tty);
- tty->print(" -- ");
- m->print_name(tty);
- tty->cr();
+ log_stream.print("%4d (%5d) ", j, m->vtable_index());
+ m->access_flags().print_on(&log_stream);
+ log_stream.print(" -- ");
+ m->print_name(&log_stream);
+ log_stream.cr();
}
}