This commit is contained in:
Coleen Phillimore 2016-05-09 23:06:05 +00:00
commit 0c4ccddf92
27 changed files with 394 additions and 653 deletions

View File

@ -27,12 +27,12 @@
#include "interp_masm_aarch64.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "logging/log.hpp"
#include "oops/arrayOop.hpp"
#include "oops/markOop.hpp"
#include "oops/methodData.hpp"
#include "oops/method.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/biasedLocking.hpp"
@ -1450,7 +1450,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
get_method(c_rarg1);
call_VM_leaf(
CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),

View File

@ -31,9 +31,9 @@
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interp_masm.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_aarch64.inline.hpp"
@ -1781,7 +1781,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
// protect the args we've loaded
save_args(masm, total_c_args, c_arg, out_regs);
__ mov_metadata(c_rarg1, method());

View File

@ -33,7 +33,6 @@
#include "interpreter/interp_masm.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_ppc.inline.hpp"

View File

@ -26,13 +26,13 @@
#include "interp_masm_sparc.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "logging/log.hpp"
#include "oops/arrayOop.hpp"
#include "oops/markOop.hpp"
#include "oops/methodData.hpp"
#include "oops/method.hpp"
#include "oops/methodCounters.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/biasedLocking.hpp"
@ -2645,7 +2645,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
call_VM_leaf(noreg,
CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),
G2_thread, Lmethod);

View File

@ -28,9 +28,9 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_sparc.inline.hpp"
@ -2450,7 +2450,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
// create inner frame
__ save_frame(0);
__ mov(G2_thread, L7_thread_cache);

View File

@ -26,12 +26,12 @@
#include "interp_masm_x86.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/interpreterRuntime.hpp"
#include "logging/log.hpp"
#include "oops/arrayOop.hpp"
#include "oops/markOop.hpp"
#include "oops/methodData.hpp"
#include "oops/method.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/biasedLocking.hpp"
@ -1953,7 +1953,7 @@ void InterpreterMacroAssembler::notify_method_entry() {
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
NOT_LP64(get_thread(rthread);)
get_method(rarg);
call_VM_leaf(

View File

@ -29,9 +29,9 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_x86.inline.hpp"
@ -1953,7 +1953,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
__ mov_metadata(rax, method());
__ call_VM_leaf(
CAST_FROM_FN_PTR(address, SharedRuntime::rc_trace_method_entry),

View File

@ -32,9 +32,9 @@
#include "code/icBuffer.hpp"
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_x86.inline.hpp"
@ -2322,7 +2322,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
}
// RedefineClasses() tracing support for obsolete method entry
if (RC_TRACE_IN_RANGE(0x00001000, 0x00002000)) {
if (log_is_enabled(Trace, redefine, class, obsolete)) {
// protect the args we've loaded
save_args(masm, total_c_args, c_arg, out_regs);
__ mov_metadata(c_rarg1, method());

View File

@ -31,7 +31,6 @@
#include "code/vtableStubs.hpp"
#include "interpreter/interpreter.hpp"
#include "oops/compiledICHolder.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/vframeArray.hpp"
#include "vmreg_zero.inline.hpp"

View File

@ -31,7 +31,6 @@
#include "memory/iterator.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/orderAccess.inline.hpp"
#include "utilities/hashtable.inline.hpp"

View File

@ -45,7 +45,6 @@
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "oops/typeArrayOop.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/fieldDescriptor.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/interfaceSupport.hpp"

View File

@ -36,10 +36,10 @@
#include "compiler/directivesParser.hpp"
#include "compiler/disassembler.hpp"
#include "interpreter/bytecode.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "oops/methodData.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiImpl.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/orderAccess.inline.hpp"
@ -2001,15 +2001,18 @@ bool nmethod::is_evol_dependent_on(Klass* dependee) {
Method* method = deps.method_argument(0);
for (int j = 0; j < dependee_methods->length(); j++) {
if (dependee_methods->at(j) == method) {
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x01000000,
("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)",
_method->method_holder()->external_name(),
_method->name()->as_C_string(),
_method->signature()->as_C_string(), compile_id(),
method->method_holder()->external_name(),
method->name()->as_C_string(),
method->signature()->as_C_string()));
if (log_is_enabled(Debug, redefine, class, nmethod)) {
ResourceMark rm;
log_debug(redefine, class, nmethod)
("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)",
_method->method_holder()->external_name(),
_method->name()->as_C_string(),
_method->signature()->as_C_string(),
compile_id(),
method->method_holder()->external_name(),
method->name()->as_C_string(),
method->signature()->as_C_string());
}
if (TraceDependencies || LogCompilation)
deps.log_dependency(dependee);
return true;

View File

@ -24,10 +24,10 @@
#include "precompiled.hpp"
#include "interpreter/oopMapCache.hpp"
#include "logging/log.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/signature.hpp"
@ -469,10 +469,12 @@ void OopMapCache::flush_obsolete_entries() {
if (!_array[i].is_empty() && _array[i].method()->is_old()) {
// Cache entry is occupied by an old redefined method and we don't want
// to pin it down so flush the entry.
RC_TRACE(0x08000000, ("flush: %s(%s): cached entry @%d",
_array[i].method()->name()->as_C_string(),
_array[i].method()->signature()->as_C_string(), i));
if (log_is_enabled(Debug, redefine, class, oopmap)) {
ResourceMark rm;
log_debug(redefine, class, oopmap)
("flush: %s(%s): cached entry @%d",
_array[i].method()->name()->as_C_string(), _array[i].method()->signature()->as_C_string(), i);
}
_array[i].flush();
}
}

View File

@ -32,23 +32,28 @@
// (The tags 'all', 'disable' and 'help' are special tags that can
// not be used in log calls, and should not be listed below.)
#define LOG_TAG_LIST \
LOG_TAG(alloc) \
LOG_TAG(add) \
LOG_TAG(age) \
LOG_TAG(alloc) \
LOG_TAG(arguments) \
LOG_TAG(annotation) \
LOG_TAG(barrier) \
LOG_TAG(biasedlocking) \
LOG_TAG(bot) \
LOG_TAG(breakpoint) \
LOG_TAG(census) \
LOG_TAG(class) \
LOG_TAG(classhisto) \
LOG_TAG(cleanup) \
LOG_TAG(compaction) \
LOG_TAG(constraints) \
LOG_TAG(constantpool) \
LOG_TAG(coops) \
LOG_TAG(cpu) \
LOG_TAG(cset) \
LOG_TAG(data) \
LOG_TAG(defaultmethods) \
LOG_TAG(dump) \
LOG_TAG(ergo) \
LOG_TAG(exceptions) \
LOG_TAG(exit) \
@ -57,6 +62,7 @@
LOG_TAG(heap) \
LOG_TAG(humongous) \
LOG_TAG(ihop) \
LOG_TAG(iklass) \
LOG_TAG(init) \
LOG_TAG(itables) \
LOG_TAG(jni) \
@ -65,13 +71,20 @@
LOG_TAG(load) /* Trace all classes loaded */ \
LOG_TAG(loader) \
LOG_TAG(logging) \
LOG_TAG(mark) \
LOG_TAG(marking) \
LOG_TAG(methodcomparator) \
LOG_TAG(metadata) \
LOG_TAG(metaspace) \
LOG_TAG(mmu) \
LOG_TAG(modules) \
LOG_TAG(monitorinflation) \
LOG_TAG(monitormismatch) \
LOG_TAG(nmethod) \
LOG_TAG(normalize) \
LOG_TAG(objecttagging) \
LOG_TAG(obsolete) \
LOG_TAG(oopmap) \
LOG_TAG(os) \
LOG_TAG(pagesize) \
LOG_TAG(path) \
@ -81,9 +94,11 @@
LOG_TAG(preorder) /* Trace all classes loaded in order referenced (not loaded) */ \
LOG_TAG(protectiondomain) /* "Trace protection domain verification" */ \
LOG_TAG(ref) \
LOG_TAG(redefine) \
LOG_TAG(refine) \
LOG_TAG(region) \
LOG_TAG(remset) \
LOG_TAG(purge) \
LOG_TAG(resolve) \
LOG_TAG(safepoint) \
LOG_TAG(scavenge) \
@ -95,6 +110,8 @@
LOG_TAG(stats) \
LOG_TAG(stringdedup) \
LOG_TAG(stringtable) \
LOG_TAG(stackmap) \
LOG_TAG(subclass) \
LOG_TAG(survivor) \
LOG_TAG(sweep) \
LOG_TAG(task) \
@ -102,6 +119,8 @@
LOG_TAG(thread) \
LOG_TAG(tlab) \
LOG_TAG(time) \
LOG_TAG(timer) \
LOG_TAG(update) \
LOG_TAG(unload) /* Trace unloading of classes */ \
LOG_TAG(verification) \
LOG_TAG(verify) \

View File

@ -55,7 +55,6 @@
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/typeArrayKlass.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/arguments.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/commandLineFlagConstraintList.hpp"

View File

@ -25,12 +25,12 @@
#include "precompiled.hpp"
#include "interpreter/interpreter.hpp"
#include "interpreter/rewriter.hpp"
#include "logging/log.hpp"
#include "memory/resourceArea.hpp"
#include "memory/universe.inline.hpp"
#include "oops/cpCache.hpp"
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/methodHandles.hpp"
#include "runtime/atomic.inline.hpp"
#include "runtime/handles.inline.hpp"
@ -438,17 +438,14 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
// match old_method so need an update
// NOTE: can't use set_f2_as_vfinal_method as it asserts on different values
_f2 = (intptr_t)new_method;
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: name=%s",
old_method->method_holder()->external_name()));
log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
*trace_name_printed = true;
}
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00400000, ("cpc vf-entry update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
log_debug(redefine, class, update, constantpool)
("cpc vf-entry update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
}
return true;
}
@ -465,17 +462,14 @@ bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
if (_f1 == old_method) {
_f1 = new_method;
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: name=%s",
old_method->method_holder()->external_name()));
log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
*trace_name_printed = true;
}
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00400000, ("cpc entry update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
log_debug(redefine, class, update, constantpool)
("cpc entry update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
}
return true;
}

View File

@ -53,7 +53,6 @@
#include "oops/symbol.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClasses.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/jvmtiThreadState.hpp"
#include "prims/methodComparator.hpp"
#include "runtime/atomic.inline.hpp"
@ -2574,17 +2573,17 @@ void InstanceKlass::adjust_default_methods(InstanceKlass* holder, bool* trace_na
assert(old_method != new_method, "sanity check");
default_methods()->at_put(index, new_method);
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: klassname=%s default methods from name=%s",
external_name(),
old_method->method_holder()->external_name()));
log_info(redefine, class, update)
("adjust: klassname=%s default methods from name=%s",
external_name(), old_method->method_holder()->external_name());
*trace_name_printed = true;
}
RC_TRACE(0x00100000, ("default method update: %s(%s) ",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
log_debug(redefine, class, update, vtables)
("default method update: %s(%s) ",
new_method->name()->as_C_string(), new_method->signature()->as_C_string());
}
}
}
@ -3353,8 +3352,8 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
ClassLoaderData* loader_data = ik->class_loader_data();
assert(loader_data != NULL, "should never be null");
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00000200, ("purge: %s: previous versions", ik->external_name()));
ResourceMark rm;
log_trace(redefine, class, iklass, purge)("%s: previous versions", ik->external_name());
// previous versions are linked together through the InstanceKlass
InstanceKlass* pv_node = ik->previous_versions();
@ -3372,8 +3371,7 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
// are executing. Unlink this previous_version.
// The previous version InstanceKlass is on the ClassLoaderData deallocate list
// so will be deallocated during the next phase of class unloading.
RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is dead",
p2i(pv_node)));
log_trace(redefine, class, iklass, purge)("previous version " INTPTR_FORMAT " is dead", p2i(pv_node));
// For debugging purposes.
pv_node->set_is_scratch_class();
pv_node->class_loader_data()->add_to_deallocate_list(pv_node);
@ -3383,8 +3381,7 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
version++;
continue;
} else {
RC_TRACE(0x00000200, ("purge: previous version " INTPTR_FORMAT " is alive",
p2i(pv_node)));
log_trace(redefine, class, iklass, purge)("previous version " INTPTR_FORMAT " is alive", p2i(pv_node));
assert(pvcp->pool_holder() != NULL, "Constant pool with no holder");
guarantee (!loader_data->is_unloading(), "unloaded classes can't be on the stack");
live_count++;
@ -3396,8 +3393,7 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
// longer running.
Array<Method*>* method_refs = pv_node->methods();
if (method_refs != NULL) {
RC_TRACE(0x00000200, ("purge: previous methods length=%d",
method_refs->length()));
log_trace(redefine, class, iklass, purge)("previous methods length=%d", method_refs->length());
for (int j = 0; j < method_refs->length(); j++) {
Method* method = method_refs->at(j);
@ -3409,11 +3405,9 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
} else {
assert (method->is_obsolete() || method->is_running_emcp(),
"emcp method cannot run after emcp bit is cleared");
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00000200,
log_trace(redefine, class, iklass, purge)
("purge: %s(%s): prev method @%d in version @%d is alive",
method->name()->as_C_string(),
method->signature()->as_C_string(), j, version));
method->name()->as_C_string(), method->signature()->as_C_string(), j, version);
}
}
}
@ -3422,9 +3416,9 @@ void InstanceKlass::purge_previous_versions(InstanceKlass* ik) {
pv_node = pv_node->previous_versions();
version++;
}
RC_TRACE(0x00000200,
("purge: previous version stats: live=%d, deleted=%d", live_count,
deleted_count));
log_trace(redefine, class, iklass, purge)
("previous version stats: live=%d, deleted=%d",
live_count, deleted_count);
}
}
@ -3459,9 +3453,9 @@ void InstanceKlass::mark_newly_obsolete_methods(Array<Method*>* old_methods,
method->signature() == m_signature) {
// The current RedefineClasses() call has made all EMCP
// versions of this method obsolete so mark it as obsolete
RC_TRACE(0x00000400,
("add: %s(%s): flush obsolete method @%d in version @%d",
m_name->as_C_string(), m_signature->as_C_string(), k, j));
log_trace(redefine, class, iklass, add)
("%s(%s): flush obsolete method @%d in version @%d",
m_name->as_C_string(), m_signature->as_C_string(), k, j);
method->set_is_obsolete();
break;
@ -3493,9 +3487,9 @@ void InstanceKlass::add_previous_version(instanceKlassHandle scratch_class,
assert(Thread::current()->is_VM_thread(),
"only VMThread can add previous versions");
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00000400, ("adding previous version ref for %s, EMCP_cnt=%d",
scratch_class->external_name(), emcp_method_count));
ResourceMark rm;
log_trace(redefine, class, iklass, add)
("adding previous version ref for %s, EMCP_cnt=%d", scratch_class->external_name(), emcp_method_count);
// Clean out old previous versions
purge_previous_versions(this);
@ -3511,7 +3505,7 @@ void InstanceKlass::add_previous_version(instanceKlassHandle scratch_class,
// we don't need to add this as a previous version.
ConstantPool* cp_ref = scratch_class->constants();
if (!cp_ref->on_stack()) {
RC_TRACE(0x00000400, ("add: scratch class not added; no methods are running"));
log_trace(redefine, class, iklass, add)("scratch class not added; no methods are running");
// For debugging purposes.
scratch_class->set_is_scratch_class();
scratch_class->class_loader_data()->add_to_deallocate_list(scratch_class());
@ -3534,17 +3528,17 @@ void InstanceKlass::add_previous_version(instanceKlassHandle scratch_class,
// method may exit. If so, we would set a breakpoint in a method that
// is never reached, but this won't be noticeable to the programmer.
old_method->set_running_emcp(true);
RC_TRACE(0x00000400, ("add: EMCP method %s is on_stack " INTPTR_FORMAT,
old_method->name_and_sig_as_C_string(), p2i(old_method)));
log_trace(redefine, class, iklass, add)
("EMCP method %s is on_stack " INTPTR_FORMAT, old_method->name_and_sig_as_C_string(), p2i(old_method));
} else if (!old_method->is_obsolete()) {
RC_TRACE(0x00000400, ("add: EMCP method %s is NOT on_stack " INTPTR_FORMAT,
old_method->name_and_sig_as_C_string(), p2i(old_method)));
log_trace(redefine, class, iklass, add)
("EMCP method %s is NOT on_stack " INTPTR_FORMAT, old_method->name_and_sig_as_C_string(), p2i(old_method));
}
}
}
// Add previous version if any methods are still running.
RC_TRACE(0x00000400, ("add: scratch class added; one of its methods is on_stack"));
log_trace(redefine, class, iklass, add)("scratch class added; one of its methods is on_stack");
assert(scratch_class->previous_versions() == NULL, "shouldn't have a previous version");
scratch_class->link_previous_versions(previous_versions());
link_previous_versions(scratch_class());

View File

@ -34,7 +34,6 @@
#include "oops/method.hpp"
#include "oops/objArrayOop.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/arguments.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/copy.hpp"
@ -887,19 +886,17 @@ void klassVtable::adjust_method_entries(InstanceKlass* holder, bool * trace_name
updated_default = adjust_default_method(index, old_method, new_method);
}
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: klassname=%s for methods from name=%s",
klass()->external_name(),
old_method->method_holder()->external_name()));
log_info(redefine, class, update)
("adjust: klassname=%s for methods from name=%s",
klass()->external_name(), old_method->method_holder()->external_name());
*trace_name_printed = true;
}
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00100000, ("vtable method update: %s(%s), updated default = %s",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string(),
updated_default ? "true" : "false"));
log_debug(redefine, class, update, vtables)
("vtable method update: %s(%s), updated default = %s",
new_method->name()->as_C_string(), new_method->signature()->as_C_string(), updated_default ? "true" : "false");
}
}
}
@ -1205,17 +1202,14 @@ void klassItable::adjust_method_entries(InstanceKlass* holder, bool * trace_name
ime->initialize(new_method);
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: name=%s",
old_method->method_holder()->external_name()));
log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
*trace_name_printed = true;
}
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00200000, ("itable method update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
log_trace(redefine, class, update, itables)
("itable method update: %s(%s)", new_method->name()->as_C_string(), new_method->signature()->as_C_string());
}
}
}

View File

@ -303,11 +303,10 @@ void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
if (method->is_running_emcp() &&
method->name() == m_name &&
method->signature() == m_signature) {
RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)",
meth_act == &Method::set_breakpoint ? "sett" : "clear",
method->name()->as_C_string(),
method->signature()->as_C_string()));
ResourceMark rm;
log_debug(redefine, class, breakpoint)
("%sing breakpoint in %s(%s)", meth_act == &Method::set_breakpoint ? "sett" : "clear",
method->name()->as_C_string(), method->signature()->as_C_string());
(method->*meth_act)(_bci);
break;
}

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,6 @@
#include "memory/resourceArea.hpp"
#include "oops/objArrayKlass.hpp"
#include "oops/objArrayOop.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/vm_operations.hpp"
// Introduction:

View File

@ -1,138 +0,0 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
#define SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP
// RedefineClasses tracing support via the TraceRedefineClasses
// option. A bit is assigned to each group of trace messages.
// Groups of messages are individually selectable. We have to use
// decimal values on the command line since the command option
// parsing logic doesn't like non-decimal numerics. The HEX values
// are used in the actual RC_TRACE() calls for sanity. To achieve
// the old cumulative behavior, pick the level after the one in
// which you are interested and subtract one, e.g., 33554431 will
// print every tracing message.
//
// 0x00000000 | 0 - default; no tracing messages
// 0x00000001 | 1 - name each target class before loading, after
// loading and after redefinition is completed
// 0x00000002 | 2 - print info if parsing, linking or
// verification throws an exception
// 0x00000004 | 4 - print timer info for the VM operation
// 0x00000008 | 8 - print subclass counter updates
// 0x00000010 | 16 - unused
// 0x00000020 | 32 - unused
// 0x00000040 | 64 - unused
// 0x00000080 | 128 - unused
// 0x00000100 | 256 - previous class weak reference addition
// 0x00000200 | 512 - previous class weak reference mgmt during
// class unloading checks (GC)
// 0x00000400 | 1024 - previous class weak reference mgmt during
// add previous ops (GC)
// 0x00000800 | 2048 - previous class breakpoint mgmt
// 0x00001000 | 4096 - detect calls to obsolete methods
// 0x00002000 | 8192 - fail a guarantee() in addition to detection
// 0x00004000 | 16384 - detect old/obsolete methods in metadata
// 0x00008000 | 32768 - old/new method matching/add/delete
// 0x00010000 | 65536 - impl details: CP size info
// 0x00020000 | 131072 - impl details: CP merge pass info
// 0x00040000 | 262144 - impl details: CP index maps
// 0x00080000 | 524288 - impl details: modified CP index values
// 0x00100000 | 1048576 - impl details: vtable updates
// 0x00200000 | 2097152 - impl details: itable updates
// 0x00400000 | 4194304 - impl details: constant pool cache updates
// 0x00800000 | 8388608 - impl details: methodComparator info
// 0x01000000 | 16777216 - impl details: nmethod evolution info
// 0x02000000 | 33554432 - impl details: annotation updates
// 0x04000000 | 67108864 - impl details: StackMapTable updates
// 0x08000000 | 134217728 - impl details: OopMapCache updates
// 0x10000000 | 268435456 - unused
// 0x20000000 | 536870912 - unused
// 0x40000000 | 1073741824 - unused
// 0x80000000 | 2147483648 - unused
// Macro for checking if TraceRedefineClasses has a specific bit
// enabled. Returns true if the bit specified by level is set.
#define RC_TRACE_ENABLED(level) ((TraceRedefineClasses & level) != 0)
// Macro for checking if TraceRedefineClasses has one or more bits
// set in a range of bit values. Returns true if one or more bits
// is set in the range from low..high inclusive. Assumes that low
// and high are single bit values.
//
// ((high << 1) - 1)
// Yields a mask that removes bits greater than the high bit value.
// This algorithm doesn't work with highest bit.
// ~(low - 1)
// Yields a mask that removes bits lower than the low bit value.
#define RC_TRACE_IN_RANGE(low, high) \
(((TraceRedefineClasses & ((high << 1) - 1)) & ~(low - 1)) != 0)
// Note: The ResourceMark is to cleanup resource allocated args.
// The "do {...} while (0)" is so we can use semi-colon at end of RC_TRACE().
#define RC_TRACE(level, args) do { \
if (RC_TRACE_ENABLED(level)) { \
ResourceMark rm; \
tty->print("RedefineClasses-0x%x: ", level); \
tty->print_cr args; \
} \
} while (0)
#define RC_TRACE_NO_CR(level, args) do { \
if (RC_TRACE_ENABLED(level)) { \
ResourceMark rm; \
tty->print("RedefineClasses-0x%x: ", level); \
tty->print args; \
} \
} while (0)
#define RC_TRACE_WITH_THREAD(level, thread, args) do { \
if (RC_TRACE_ENABLED(level)) { \
ResourceMark rm(thread); \
tty->print("RedefineClasses-0x%x: ", level); \
tty->print_cr args; \
} \
} while (0)
#define RC_TRACE_MESG(args) do { \
ResourceMark rm; \
tty->print("RedefineClasses: "); \
tty->print_cr args; \
} while (0)
// Timer support macros. Only do timer operations if timer tracing is enabled.
// The "do {...} while (0)" is so we can use semi-colon at end of the macro.
#define RC_TIMER_START(t) do { \
if (RC_TRACE_ENABLED(0x00000004)) { \
t.start(); \
} \
} while (0)
#define RC_TIMER_STOP(t) do { \
if (RC_TRACE_ENABLED(0x00000004)) { \
t.stop(); \
} \
} while (0)
#endif // SHARE_VM_PRIMS_JVMTIREDEFINECLASSESTRACE_HPP

View File

@ -25,7 +25,6 @@
#include "precompiled.hpp"
#include "oops/oop.inline.hpp"
#include "oops/symbol.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/methodComparator.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/globalDefinitions.hpp"
@ -39,10 +38,12 @@ bool MethodComparator::methods_EMCP(Method* old_method, Method* new_method) {
if (old_method->code_size() != new_method->code_size())
return false;
if (check_stack_and_locals_size(old_method, new_method) != 0) {
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00800000, ("Methods %s non-comparable with diagnosis %d",
old_method->name()->as_C_string(),
check_stack_and_locals_size(old_method, new_method)));
if (log_is_enabled(Debug, redefine, class, methodcomparator)) {
ResourceMark rm;
log_debug(redefine, class, methodcomparator)
("Methods %s non-comparable with diagnosis %d",
old_method->name()->as_C_string(), check_stack_and_locals_size(old_method, new_method));
}
return false;
}

View File

@ -38,7 +38,6 @@
#include "oops/objArrayOop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/methodHandles.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "runtime/compilationPolicy.hpp"
#include "runtime/javaCalls.hpp"
#include "runtime/timerTrace.hpp"
@ -1084,17 +1083,15 @@ void MemberNameTable::adjust_method_entries(InstanceKlass* holder, bool * trace_
java_lang_invoke_MemberName::set_vmtarget(mem_name, new_method);
if (RC_TRACE_IN_RANGE(0x00100000, 0x00400000)) {
if (log_is_enabled(Info, redefine, class, update)) {
ResourceMark rm;
if (!(*trace_name_printed)) {
// RC_TRACE_MESG macro has an embedded ResourceMark
RC_TRACE_MESG(("adjust: name=%s",
old_method->method_holder()->external_name()));
log_info(redefine, class, update)("adjust: name=%s", old_method->method_holder()->external_name());
*trace_name_printed = true;
}
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE(0x00400000, ("MemberName method update: %s(%s)",
new_method->name()->as_C_string(),
new_method->signature()->as_C_string()));
log_debug(redefine, class, update, constantpool)
("MemberName method update: %s(%s)",
new_method->name()->as_C_string(), new_method->signature()->as_C_string());
}
}
}

View File

@ -420,6 +420,7 @@ static AliasedLoggingFlag const aliased_logging_flags[] = {
{ "TraceMonitorInflation", LogLevel::Debug, true, LOG_TAGS(monitorinflation) },
{ "TraceSafepointCleanupTime", LogLevel::Info, true, LOG_TAGS(safepoint, cleanup) },
{ "TraceJVMTIObjectTagging", LogLevel::Debug, true, LOG_TAGS(jvmti, objecttagging) },
{ "TraceRedefineClasses", LogLevel::Info, false, LOG_TAGS(redefine, class) },
{ NULL, LogLevel::Off, false, LOG_TAGS(_NO_TAG) }
};
@ -804,7 +805,9 @@ void log_deprecated_flag(const char* name, bool on, AliasedLoggingFlag alf) {
}
strncat(tagset_buffer, LogTag::name(tagSet[i]), max_tagset_len - strlen(tagset_buffer));
}
if (!alf.exactMatch) {
strncat(tagset_buffer, "*", max_tagset_len - strlen(tagset_buffer));
}
log_warning(arguments)("-XX:%s%s is deprecated. Will use -Xlog:%s=%s instead.",
(on) ? "+" : "-",
name,
@ -865,6 +868,11 @@ bool Arguments::parse_argument(const char* arg, Flag::Flags origin) {
Flag* flag;
// this scanf pattern matches both strings (handled here) and numbers (handled later))
AliasedLoggingFlag alf = catch_logging_aliases(name, true);
if (alf.alias_name != NULL) {
LogConfiguration::configure_stdout(alf.level, alf.exactMatch, alf.tag0, alf.tag1, alf.tag2, alf.tag3, alf.tag4, alf.tag5);
return true;
}
real_name = handle_aliases_and_deprecation(name, warn_if_deprecated);
if (real_name == NULL) {
return false;

View File

@ -1418,10 +1418,6 @@ public:
product(bool, StressLdcRewrite, false, \
"Force ldc -> ldc_w rewrite during RedefineClasses") \
\
product(uintx, TraceRedefineClasses, 0, \
"Trace level for JVMTI RedefineClasses") \
range(0, 0xFFFFFFFF) \
\
/* change to false by default sometime after Mustang */ \
product(bool, VerifyMergedCPBytecodes, true, \
"Verify bytecodes after RedefineClasses constant pool merging") \

View File

@ -46,7 +46,6 @@
#include "oops/oop.inline.hpp"
#include "prims/forte.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiRedefineClassesTrace.hpp"
#include "prims/methodHandles.hpp"
#include "prims/nativeLookup.hpp"
#include "runtime/arguments.hpp"
@ -603,27 +602,18 @@ void SharedRuntime::throw_and_post_jvmti_exception(JavaThread *thread, Symbol* n
}
// The interpreter code to call this tracing function is only
// called/generated when TraceRedefineClasses has the right bits
// set. Since obsolete methods are never compiled, we don't have
// called/generated when UL is on for redefine, class and has the right level
// and tags. Since obsolete methods are never compiled, we don't have
// to modify the compilers to generate calls to this function.
//
JRT_LEAF(int, SharedRuntime::rc_trace_method_entry(
JavaThread* thread, Method* method))
assert(RC_TRACE_IN_RANGE(0x00001000, 0x00002000), "wrong call");
if (method->is_obsolete()) {
// We are calling an obsolete method, but this is not necessarily
// an error. Our method could have been redefined just after we
// fetched the Method* from the constant pool.
// RC_TRACE macro has an embedded ResourceMark
RC_TRACE_WITH_THREAD(0x00001000, thread,
("calling obsolete method '%s'",
method->name_and_sig_as_C_string()));
if (RC_TRACE_ENABLED(0x00002000)) {
// this option is provided to debug calls to obsolete methods
guarantee(false, "faulting at call to an obsolete method.");
}
ResourceMark rm;
log_trace(redefine, class, obsolete)("calling obsolete method '%s'", method->name_and_sig_as_C_string());
}
return 0;
JRT_END