This commit is contained in:
Stefan Karlsson 2016-04-04 11:32:04 +02:00
commit 64efc0eb0f
51 changed files with 144 additions and 143 deletions

View File

@ -5700,7 +5700,7 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
if (!is_internal()) {
if (log_is_enabled(Debug, classload, preorder)){
ResourceMark rm(THREAD);
outputStream* log = LogHandle(classload, preorder)::debug_stream();
outputStream* log = Log(classload, preorder)::debug_stream();
log->print("%s", _class_name->as_klass_external_name());
if (stream->source() != NULL) {
log->print(" source: %s", stream->source());

View File

@ -535,7 +535,7 @@ void ClassLoader::exit_with_path_failure(const char* error, const char* message)
void ClassLoader::trace_class_path(const char* msg, const char* name) {
if (log_is_enabled(Info, classpath)) {
ResourceMark rm;
outputStream* out = LogHandle(classpath)::info_stream();
outputStream* out = Log(classpath)::info_stream();
if (msg) {
out->print("%s", msg);
}

View File

@ -357,7 +357,7 @@ void ClassLoaderData::unload() {
if (log_is_enabled(Debug, classloaderdata)) {
ResourceMark rm;
outputStream* log = LogHandle(classloaderdata)::debug_stream();
outputStream* log = Log(classloaderdata)::debug_stream();
log->print(": unload loader data " INTPTR_FORMAT, p2i(this));
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)class_loader()),
loader_name());
@ -717,7 +717,7 @@ void ClassLoaderDataGraph::log_creation(Handle loader, ClassLoaderData* cld, TRA
}
ResourceMark rm;
outputStream* log = LogHandle(classloaderdata)::debug_stream();
outputStream* log = Log(classloaderdata)::debug_stream();
log->print("create class loader data " INTPTR_FORMAT, p2i(cld));
log->print(" for instance " INTPTR_FORMAT " of %s", p2i((void *)cld->class_loader()),
cld->loader_name());
@ -859,7 +859,7 @@ GrowableArray<ClassLoaderData*>* ClassLoaderDataGraph::new_clds() {
array->push(curr);
if (log_is_enabled(Debug, classloaderdata)) {
outputStream* log = LogHandle(classloaderdata)::debug_stream();
outputStream* log = Log(classloaderdata)::debug_stream();
log->print("found new CLD: ");
curr->print_value_on(log);
log->cr();

View File

@ -437,7 +437,7 @@ class MethodFamily : public ResourceObj {
_exception_name = vmSymbols::java_lang_IncompatibleClassChangeError();
if (log_is_enabled(Debug, defaultmethods)) {
ResourceMark rm;
outputStream* logstream = LogHandle(defaultmethods)::debug_stream();
outputStream* logstream = Log(defaultmethods)::debug_stream();
_exception_message->print_value_on(logstream);
logstream->cr();
}
@ -663,7 +663,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
if (log_is_enabled(Debug, defaultmethods)) {
log_debug(defaultmethods)("Slots that need filling:");
ResourceMark rm;
outputStream* logstream = LogHandle(defaultmethods)::debug_stream();
outputStream* logstream = Log(defaultmethods)::debug_stream();
streamIndentor si(logstream);
for (int i = 0; i < slots->length(); ++i) {
logstream->indent();
@ -799,7 +799,7 @@ void DefaultMethods::generate_default_methods(
log_debug(defaultmethods)("%s %s requires default method processing",
klass->is_interface() ? "Interface" : "Class",
klass->name()->as_klass_external_name());
PrintHierarchy printer(LogHandle(defaultmethods)::debug_stream());
PrintHierarchy printer(Log(defaultmethods)::debug_stream());
printer.run(klass);
}
@ -809,7 +809,7 @@ void DefaultMethods::generate_default_methods(
for (int i = 0; i < empty_slots->length(); ++i) {
EmptyVtableSlot* slot = empty_slots->at(i);
if (log_is_enabled(Debug, defaultmethods)) {
outputStream* logstream = LogHandle(defaultmethods)::debug_stream();
outputStream* logstream = Log(defaultmethods)::debug_stream();
streamIndentor si(logstream, 2);
logstream->indent().print("Looking for default methods for slot ");
slot->print_on(logstream);
@ -917,7 +917,7 @@ static void create_defaults_and_exceptions(
if (log_is_enabled(Debug, defaultmethods)) {
ResourceMark rm;
outputStream* logstream = LogHandle(defaultmethods)::debug_stream();
outputStream* logstream = Log(defaultmethods)::debug_stream();
logstream->print("for slot: ");
slot->print_on(logstream);
logstream->cr();

View File

@ -137,7 +137,7 @@ void DictionaryEntry::add_protection_domain(Dictionary* dict, oop protection_dom
}
if (log_is_enabled(Trace, protectiondomain)) {
ResourceMark rm;
outputStream* log = LogHandle(protectiondomain)::trace_stream();
outputStream* log = Log(protectiondomain)::trace_stream();
print_count(log);
}
}

View File

@ -113,7 +113,7 @@ void LoaderConstraintTable::purge_loader_constraints() {
probe->set_klass(NULL);
if (log_is_enabled(Info, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("purging class object from constraint for name %s,"
" loader list:",
probe->name()->as_C_string());
@ -129,7 +129,7 @@ void LoaderConstraintTable::purge_loader_constraints() {
if (probe->loader_data(n)->is_unloading()) {
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("purging loader %s from constraint for name %s",
probe->loader_data(n)->loader_name(),
probe->name()->as_C_string()
@ -144,7 +144,7 @@ void LoaderConstraintTable::purge_loader_constraints() {
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("new loader list:");
for (int i = 0; i < probe->num_loaders(); i++) {
out->print_cr(" [%d]: %s", i,
@ -161,7 +161,7 @@ void LoaderConstraintTable::purge_loader_constraints() {
if (probe->num_loaders() < 2) {
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("purging complete constraint for name %s",
probe->name()->as_C_string());
}
@ -233,7 +233,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
set_entry(index, p);
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("adding new constraint for name: %s, loader[0]: %s,"
" loader[1]: %s",
class_name->as_C_string(),
@ -247,7 +247,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
(*pp1)->set_klass(klass);
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("setting class object in existing constraint for"
" name: %s and loader %s",
class_name->as_C_string(),
@ -269,7 +269,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
if (failure_code != 0 && log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
const char* reason = "";
switch(failure_code) {
case 1: reason = "the class objects presented by loader[0] and loader[1]"
@ -302,7 +302,7 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
if (p && p->klass() != NULL && p->klass() != k()) {
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("constraint check failed for name %s, loader %s: "
"the presented class object differs from that stored",
name->as_C_string(),
@ -314,7 +314,7 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
p->set_klass(k());
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("updating constraint for name %s, loader %s, "
"by setting class object",
name->as_C_string(),
@ -364,7 +364,7 @@ void LoaderConstraintTable::extend_loader_constraint(LoaderConstraintEntry* p,
p->set_num_loaders(num + 1);
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("extending constraint for name %s by adding loader[%d]: %s %s",
p->name()->as_C_string(),
num,
@ -404,7 +404,7 @@ void LoaderConstraintTable::merge_loader_constraints(
if (log_is_enabled(Info, classload, constraints)) {
ResourceMark rm;
outputStream* out = LogHandle(classload, constraints)::info_stream();
outputStream* out = Log(classload, constraints)::info_stream();
out->print_cr("merged constraints for name %s, new loader list:",
p1->name()->as_C_string()
);

View File

@ -480,7 +480,7 @@ void Modules::define_module(jobject module, jstring version,
}
if (log_is_enabled(Debug, modules)) {
outputStream* logst = LogHandle(modules)::debug_stream();
outputStream* logst = Log(modules)::debug_stream();
logst->print("define_module(): creation of module: %s, version: %s, location: %s, ",
module_name, module_version != NULL ? module_version : "NULL",
module_location != NULL ? module_location : "NULL");
@ -789,7 +789,7 @@ jobject Modules::get_module(jclass clazz, TRAPS) {
if (log_is_enabled(Debug, modules)) {
ResourceMark rm(THREAD);
outputStream* logst = LogHandle(modules)::debug_stream();
outputStream* logst = Log(modules)::debug_stream();
Klass* klass = java_lang_Class::as_Klass(mirror);
oop module_name = java_lang_reflect_Module::name(module);
if (module_name != NULL) {

View File

@ -74,7 +74,7 @@ bool SharedPathsMiscInfo::fail(const char* msg, const char* name) {
void SharedPathsMiscInfo::print_path(int type, const char* path) {
ResourceMark rm;
outputStream* out = LogHandle(classpath)::info_stream();
outputStream* out = Log(classpath)::info_stream();
switch (type) {
case BOOT:
out->print("Expecting BOOT path=%s", path);

View File

@ -436,7 +436,7 @@ void SystemDictionary::validate_protection_domain(instanceKlassHandle klass,
if (log_is_enabled(Debug, protectiondomain)) {
ResourceMark rm;
// Print out trace information
outputStream* log = LogHandle(protectiondomain)::debug_stream();
outputStream* log = Log(protectiondomain)::debug_stream();
log->print_cr("Checking package access");
log->print("class loader: "); class_loader()->print_value_on(log);
log->print(" protection domain: "); protection_domain()->print_value_on(log);

View File

@ -191,10 +191,10 @@ bool Verifier::verify(instanceKlassHandle klass, Verifier::Mode mode, bool shoul
}
if (log_is_enabled(Info, classinit)){
log_end_verification(LogHandle(classinit)::info_stream(), klassName, exception_name, THREAD);
log_end_verification(Log(classinit)::info_stream(), klassName, exception_name, THREAD);
}
if (log_is_enabled(Info, verboseverification)){
log_end_verification(LogHandle(verboseverification)::info_stream(), klassName, exception_name, THREAD);
log_end_verification(Log(verboseverification)::info_stream(), klassName, exception_name, THREAD);
}
if (HAS_PENDING_EXCEPTION) {
@ -658,7 +658,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
if (log_is_enabled(Info, verboseverification)) {
ResourceMark rm(THREAD);
stackmap_table.print_on(LogHandle(verboseverification)::info_stream());
stackmap_table.print_on(Log(verboseverification)::info_stream());
}
RawBytecodeStream bcs(m);
@ -700,7 +700,7 @@ void ClassVerifier::verify_method(const methodHandle& m, TRAPS) {
if (log_is_enabled(Info, verboseverification)) {
ResourceMark rm(THREAD);
current_frame.print_on(LogHandle(verboseverification)::info_stream());
current_frame.print_on(Log(verboseverification)::info_stream());
log_info(verboseverification)("offset = %d, opcode = %s", bci, Bytecodes::name(opcode));
}

View File

@ -1322,7 +1322,7 @@ void nmethod::make_unloaded(BoolObjectClosure* is_alive, oop cause) {
// Break cycle between nmethod & method
if (log_is_enabled(Trace, classunload)) {
outputStream* log = LogHandle(classunload)::trace_stream();
outputStream* log = Log(classunload)::trace_stream();
log->print_cr("making nmethod " INTPTR_FORMAT
" unloadable, Method*(" INTPTR_FORMAT
"), cause(" INTPTR_FORMAT ")",

View File

@ -500,7 +500,7 @@ void CompactibleFreeListSpace::dump_at_safepoint_with_locks(CMSCollector* c, out
void CompactibleFreeListSpace::reportFreeListStatistics(const char* title) const {
assert_lock_strong(&_freelistLock);
LogHandle(gc, freelist, stats) log;
Log(gc, freelist, stats) log;
if (!log.is_debug()) {
return;
}
@ -2199,7 +2199,7 @@ class VerifyAllBlksClosure: public BlkClosure {
}
}
if (res == 0) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
log.error("Livelock: no rank reduction!");
log.error(" Current: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n"
" Previous: addr = " PTR_FORMAT ", size = " SIZE_FORMAT ", obj = %s, live = %s \n",
@ -2373,7 +2373,7 @@ void CompactibleFreeListSpace::check_free_list_consistency() const {
void CompactibleFreeListSpace::printFLCensus(size_t sweep_count) const {
assert_lock_strong(&_freelistLock);
LogHandle(gc, freelist, census) log;
Log(gc, freelist, census) log;
if (!log.is_debug()) {
return;
}

View File

@ -693,7 +693,7 @@ bool ConcurrentMarkSweepGeneration::promotion_attempt_is_safe(size_t max_promoti
// At a promotion failure dump information on block layout in heap
// (cms old generation).
void ConcurrentMarkSweepGeneration::promotion_failure_occurred() {
LogHandle(gc, promotion) log;
Log(gc, promotion) log;
if (log.is_trace()) {
ResourceMark rm;
cmsSpace()->dump_at_safepoint_with_locks(collector(), log.trace_stream());
@ -752,7 +752,7 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() {
size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
assert(desired_capacity >= capacity(), "invalid expansion size");
size_t expand_bytes = MAX2(desired_capacity - capacity(), MinHeapDeltaBytes);
LogHandle(gc) log;
Log(gc) log;
if (log.is_trace()) {
size_t desired_capacity = (size_t)(used() / ((double) 1 - desired_free_percentage));
log.trace("From compute_new_size: ");
@ -1117,7 +1117,7 @@ bool CMSCollector::shouldConcurrentCollect() {
// ------------------------------------------------------------------
// Print out lots of information which affects the initiation of
// a collection.
LogHandle(gc) log;
Log(gc) log;
if (log.is_trace() && stats().valid()) {
log.trace("CMSCollector shouldConcurrentCollect: ");
ResourceMark rm;
@ -1605,7 +1605,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
}
void CMSCollector::print_eden_and_survivor_chunk_arrays() {
LogHandle(gc, heap) log;
Log(gc, heap) log;
if (!log.is_trace()) {
return;
}
@ -2221,7 +2221,7 @@ class VerifyMarkedClosure: public BitMapClosure {
bool do_bit(size_t offset) {
HeapWord* addr = _marks->offsetToHeapWord(offset);
if (!_marks->isMarked(addr)) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
ResourceMark rm;
oop(addr)->print_on(log.error_stream());
log.error(" (" INTPTR_FORMAT " should have been marked)", p2i(addr));
@ -2347,7 +2347,7 @@ void CMSCollector::verify_after_remark_work_1() {
VerifyMarkedClosure vcl(markBitMap());
verification_mark_bm()->iterate(&vcl);
if (vcl.failed()) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
log.error("Failed marking verification after remark");
ResourceMark rm;
gch->print_on(log.error_stream());
@ -5874,7 +5874,7 @@ void MarkRefsIntoVerifyClosure::do_oop(oop obj) {
if (_span.contains(addr)) {
_verification_bm->mark(addr);
if (!_cms_bm->isMarked(addr)) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
ResourceMark rm;
oop(addr)->print_on(log.error_stream());
log.error(" (" INTPTR_FORMAT " should have been marked)", p2i(addr));
@ -6655,7 +6655,7 @@ void PushAndMarkVerifyClosure::do_oop(oop obj) {
// Oop lies in _span and isn't yet grey or black
_verification_bm->mark(addr); // now grey
if (!_cms_bm->isMarked(addr)) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
ResourceMark rm;
oop(addr)->print_on(log.error_stream());
log.error(" (" INTPTR_FORMAT " should have been marked)", p2i(addr));
@ -7062,7 +7062,7 @@ SweepClosure::~SweepClosure() {
assert(_limit >= _sp->bottom() && _limit <= _sp->end(),
"sweep _limit out of bounds");
if (inFreeRange()) {
LogHandle(gc, sweep) log;
Log(gc, sweep) log;
log.error("inFreeRange() should have been reset; dumping state of SweepClosure");
ResourceMark rm;
print_on(log.error_stream());

View File

@ -398,7 +398,7 @@ void ParScanThreadStateSet::print_termination_stats_hdr(outputStream* const st)
}
void ParScanThreadStateSet::print_termination_stats() {
LogHandle(gc, task, stats) log;
Log(gc, task, stats) log;
if (!log.is_debug()) {
return;
}
@ -430,7 +430,7 @@ void ParScanThreadStateSet::print_taskqueue_stats() {
if (!log_develop_is_enabled(Trace, gc, task, stats)) {
return;
}
LogHandle(gc, task, stats) log;
Log(gc, task, stats) log;
ResourceMark rm;
outputStream* st = log.trace_stream();
print_taskqueue_stats_hdr(st);

View File

@ -82,7 +82,7 @@ inline void ParScanClosure::do_oop_work(T* p,
if ((HeapWord*)obj < _boundary) {
#ifndef PRODUCT
if (_g->to()->is_in_reserved(obj)) {
LogHandle(gc) log;
Log(gc) log;
log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
GenCollectedHeap* gch = GenCollectedHeap::heap();
Space* sp = gch->space_containing(p);

View File

@ -201,7 +201,7 @@ void G1AllocRegion::trace(const char* str, size_t min_word_size, size_t desired_
// and the result are considered part of detailed tracing and are
// skipped during other tracing.
LogHandle(gc, alloc, region) log;
Log(gc, alloc, region) log;
if (!log.is_debug()) {
return;

View File

@ -2676,7 +2676,7 @@ bool G1CollectedHeap::is_obj_dead_cond(const oop obj,
}
void G1CollectedHeap::print_heap_regions() const {
LogHandle(gc, heap, region) log;
Log(gc, heap, region) log;
if (log.is_trace()) {
ResourceMark rm;
print_regions_on(log.trace_stream());
@ -3112,7 +3112,7 @@ void G1CollectedHeap::print_taskqueue_stats() const {
if (!log_is_enabled(Trace, gc, task, stats)) {
return;
}
LogHandle(gc, task, stats) log;
Log(gc, task, stats) log;
ResourceMark rm;
outputStream* st = log.trace_stream();

View File

@ -2620,7 +2620,7 @@ static void print_ms_time_info(const char* prefix, const char* name,
}
void G1ConcurrentMark::print_summary_info() {
LogHandle(gc, marking) log;
Log(gc, marking) log;
if (!log.is_trace()) {
return;
}

View File

@ -181,7 +181,7 @@ size_t G1GCPhaseTimes::sum_thread_work_items(GCParPhases phase) {
template <class T>
void G1GCPhaseTimes::details(T* phase, const char* indent) {
LogHandle(gc, phases, task) log;
Log(gc, phases, task) log;
if (log.is_level(LogLevel::Trace)) {
outputStream* trace_out = log.trace_stream();
trace_out->print("%s", indent);
@ -203,7 +203,7 @@ void G1GCPhaseTimes::log_phase(WorkerDataArray<double>* phase, uint indent, outp
}
void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase) {
LogHandle(gc, phases) log;
Log(gc, phases) log;
if (log.is_level(LogLevel::Debug)) {
ResourceMark rm;
log_phase(phase, 2, log.debug_stream(), true);
@ -211,7 +211,7 @@ void G1GCPhaseTimes::debug_phase(WorkerDataArray<double>* phase) {
}
void G1GCPhaseTimes::trace_phase(WorkerDataArray<double>* phase, bool print_sum) {
LogHandle(gc, phases) log;
Log(gc, phases) log;
if (log.is_level(LogLevel::Trace)) {
ResourceMark rm;
log_phase(phase, 3, log.trace_stream(), print_sum);

View File

@ -60,7 +60,7 @@ public:
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
if (_g1h->is_obj_dead_cond(obj, _vo)) {
LogHandle(gc, verify) log;
Log(gc, verify) log;
log.info("Root location " PTR_FORMAT " points to dead obj " PTR_FORMAT, p2i(p), p2i(obj));
if (_vo == VerifyOption_G1UseMarkWord) {
log.error(" Mark word: " PTR_FORMAT, p2i(obj->mark()));
@ -406,7 +406,7 @@ void G1HeapVerifier::verify(VerifyOption vo) {
// It helps to have the per-region information in the output to
// help us track down what went wrong. This is why we call
// print_extended_on() instead of print_on().
LogHandle(gc, verify) log;
Log(gc, verify) log;
ResourceMark rm;
_g1h->print_extended_on(log.error_stream());
}

View File

@ -536,7 +536,7 @@ void G1RemSet::print_periodic_summary_info(const char* header, uint period_count
current.initialize(this);
_prev_period_summary.subtract_from(&current);
LogHandle(gc, remset) log;
Log(gc, remset) log;
log.trace("%s", header);
ResourceMark rm;
_prev_period_summary.print_on(log.trace_stream());
@ -546,7 +546,7 @@ void G1RemSet::print_periodic_summary_info(const char* header, uint period_count
}
void G1RemSet::print_summary_info() {
LogHandle(gc, remset, exit) log;
Log(gc, remset, exit) log;
if (log.is_trace()) {
log.trace(" Cumulative RS summary");
G1RemSetSummary current;

View File

@ -570,7 +570,7 @@ void G1StringDedupTable::trim_entry_cache() {
}
void G1StringDedupTable::print_statistics() {
LogHandle(gc, stringdedup) log;
Log(gc, stringdedup) log;
log.debug(" [Table]");
log.debug(" [Memory Usage: " G1_STRDEDUP_BYTES_FORMAT_NS "]",
G1_STRDEDUP_BYTES_PARAM(_table->_size * sizeof(G1StringDedupEntry*) + (_table->_entries + _entry_cache->size()) * sizeof(G1StringDedupEntry)));

View File

@ -694,7 +694,7 @@ public:
template <class T>
void verify_liveness(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
LogHandle(gc, verify) log;
Log(gc, verify) log;
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
bool failed = false;
@ -748,7 +748,7 @@ public:
template <class T>
void verify_remembered_set(T* p) {
T heap_oop = oopDesc::load_heap_oop(p);
LogHandle(gc, verify) log;
Log(gc, verify) log;
if (!oopDesc::is_null(heap_oop)) {
oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
bool failed = false;

View File

@ -120,7 +120,7 @@ size_t AdjoiningGenerations::reserved_byte_size() {
}
void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_bytes, size_t max_size) {
LogHandle(heap, ergo) log;
Log(heap, ergo) log;
if (!log.is_debug()) {
return;
}
@ -133,7 +133,7 @@ void log_before_expansion(bool old, size_t expand_in_bytes, size_t change_in_byt
}
void log_after_expansion(bool old, size_t max_size) {
LogHandle(heap, ergo) log;
Log(heap, ergo) log;
if (!log.is_debug()) {
return;
}

View File

@ -126,7 +126,7 @@ size_t ASPSOldGen::available_for_contraction() {
// Also adjust for inter-generational alignment
size_t result_aligned = align_size_down(result, gen_alignment);
LogHandle(gc, ergo) log;
Log(gc, ergo) log;
if (log.is_trace()) {
size_t working_promoted = (size_t) policy->avg_promoted()->padded_average();
size_t promo_increment = policy->promo_increment(max_contraction);

View File

@ -405,7 +405,7 @@ void GCTaskManager::initialize() {
for (uint t = 0; t < workers(); t += 1) {
set_thread(t, GCTaskThread::create(this, t, processor_assignment[t]));
}
LogHandle(gc, task, thread) log;
Log(gc, task, thread) log;
if (log.is_trace()) {
ResourceMark rm;
outputStream* out = log.trace_stream();

View File

@ -198,7 +198,7 @@ void PSParallelCompact::print_region_ranges() {
if (!log_develop_is_enabled(Trace, gc, compaction)) {
return;
}
LogHandle(gc, compaction) log;
Log(gc, compaction) log;
ResourceMark rm;
Universe::print_on(log.trace_stream());
log.trace("space bottom top end new_top");
@ -2175,7 +2175,7 @@ void PSParallelCompact::adjust_roots(ParCompactionManager* cm) {
// Helper class to print 8 region numbers per line and then print the total at the end.
class FillableRegionLogger : public StackObj {
private:
LogHandle(gc, compaction) log;
Log(gc, compaction) log;
static const int LineLength = 8;
size_t _regions[LineLength];
int _next_index;
@ -2377,7 +2377,7 @@ void PSParallelCompact::write_block_fill_histogram()
return;
}
LogHandle(gc, compaction) log;
Log(gc, compaction) log;
ResourceMark rm;
outputStream* out = log.trace_stream();

View File

@ -151,7 +151,7 @@ PSPromotionManager::print_taskqueue_stats() {
if (!log_develop_is_enabled(Trace, gc, task, stats)) {
return;
}
LogHandle(gc, task, stats) log;
Log(gc, task, stats) log;
ResourceMark rm;
outputStream* out = log.trace_stream();
out->print_cr("== GC Tasks Stats, GC %3d",

View File

@ -580,7 +580,7 @@ void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
HeapDumper::dump_heap();
}
LogHandle(gc, classhisto) log;
Log(gc, classhisto) log;
if (log.is_trace()) {
GCTraceTime(Trace, gc, classhisto) tm(before ? "Class Histogram (before full gc)" : "Class Histogram (after full gc)", timer);
ResourceMark rm;

View File

@ -75,7 +75,7 @@ void GCLocker::decrement_debug_jni_lock_count() {
#endif
void GCLocker::log_debug_jni(const char* msg) {
LogHandle(gc, jni) log;
Log(gc, jni) log;
if (log.is_debug()) {
ResourceMark rm; // JavaThread::name() allocates to convert to UTF8
log.debug("%s Thread \"%s\" %d locked.", msg, Thread::current()->name(), _jni_lock_count);

View File

@ -45,11 +45,11 @@ void GCTraceTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::log_start(jlong start
// Get log with start tag appended (replace first occurrence of NO_TAG)
const LogTagType start_tag = PREFIX_LOG_TAG(start);
const LogTagType no_tag = PREFIX_LOG_TAG(_NO_TAG);
Log<T0,
T1 == no_tag ? start_tag : T1,
T1 != no_tag && T2 == no_tag ? start_tag : T2,
T2 != no_tag && T3 == no_tag ? start_tag : T3,
T3 != no_tag && T4 == no_tag ? start_tag : T4
LogImpl<T0,
T1 == no_tag ? start_tag : T1,
T1 != no_tag && T2 == no_tag ? start_tag : T2,
T2 != no_tag && T3 == no_tag ? start_tag : T3,
T3 != no_tag && T4 == no_tag ? start_tag : T4
> log;
if (log.is_level(Level)) {
@ -73,14 +73,14 @@ void GCTraceTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::log_stop(jlong start_
stop_msg.append(" (%s)", GCCause::to_string(_gc_cause));
}
if (_heap_usage_before == SIZE_MAX) {
Log<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_TIME_FORMAT,
LogImpl<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_TIME_FORMAT,
stop_msg.buffer(), start_time_in_secs, stop_time_in_secs, duration_in_ms);
} else {
CollectedHeap* heap = Universe::heap();
size_t used_before_m = _heap_usage_before / M;
size_t used_m = heap->used() / M;
size_t capacity_m = heap->capacity() / M;
Log<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_HEAP_FORMAT " " LOG_STOP_TIME_FORMAT,
LogImpl<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_HEAP_FORMAT " " LOG_STOP_TIME_FORMAT,
stop_msg.buffer(), used_before_m, used_m, capacity_m, start_time_in_secs, stop_time_in_secs, duration_in_ms);
}
}
@ -94,7 +94,7 @@ void GCTraceTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::time_stamp(Ticks& tic
template <LogLevelType Level, LogTagType T0, LogTagType T1, LogTagType T2, LogTagType T3, LogTagType T4, LogTagType GuardTag >
GCTraceTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::GCTraceTimeImpl(const char* title, GCTimer* timer, GCCause::Cause gc_cause, bool log_heap_usage) :
_enabled(Log<T0, T1, T2, T3, T4, GuardTag>::is_level(Level)),
_enabled(LogImpl<T0, T1, T2, T3, T4, GuardTag>::is_level(Level)),
_start_ticks(),
_heap_usage_before(SIZE_MAX),
_title(title),
@ -127,9 +127,9 @@ GCTraceTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::~GCTraceTimeImpl() {
template <LogLevelType Level, LogTagType T0, LogTagType T1, LogTagType T2, LogTagType T3, LogTagType T4, LogTagType GuardTag >
GCTraceConcTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::GCTraceConcTimeImpl(const char* title) :
_enabled(Log<T0, T1, T2, T3, T4, GuardTag>::is_level(Level)), _start_time(os::elapsed_counter()), _title(title) {
_enabled(LogImpl<T0, T1, T2, T3, T4, GuardTag>::is_level(Level)), _start_time(os::elapsed_counter()), _title(title) {
if (_enabled) {
Log<T0, T1, T2, T3, T4>::template write<Level>("%s (%.3fs)", _title, TimeHelper::counter_to_seconds(_start_time));
LogImpl<T0, T1, T2, T3, T4>::template write<Level>("%s (%.3fs)", _title, TimeHelper::counter_to_seconds(_start_time));
}
}
@ -137,7 +137,7 @@ template <LogLevelType Level, LogTagType T0, LogTagType T1, LogTagType T2, LogTa
GCTraceConcTimeImpl<Level, T0, T1, T2, T3, T4, GuardTag>::~GCTraceConcTimeImpl() {
if (_enabled) {
jlong stop_time = os::elapsed_counter();
Log<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_TIME_FORMAT,
LogImpl<T0, T1, T2, T3, T4>::template write<Level>("%s " LOG_STOP_TIME_FORMAT,
_title,
TimeHelper::counter_to_seconds(_start_time),
TimeHelper::counter_to_seconds(stop_time),

View File

@ -242,7 +242,7 @@ size_t ThreadLocalAllocBuffer::initial_desired_size() {
}
void ThreadLocalAllocBuffer::print_stats(const char* tag) {
LogHandle(gc, tlab) log;
Log(gc, tlab) log;
if (!log.is_trace()) {
return;
}
@ -385,7 +385,7 @@ void GlobalTLABStats::publish() {
}
void GlobalTLABStats::print() {
LogHandle(gc, tlab) log;
Log(gc, tlab) log;
if (!log.is_debug()) {
return;
}

View File

@ -749,9 +749,9 @@ static void trace_method_resolution(const char* prefix,
ResourceMark rm;
outputStream* st;
if (logitables) {
st = LogHandle(itables)::trace_stream();
st = Log(itables)::trace_stream();
} else {
st = LogHandle(vtables)::trace_stream();
st = Log(vtables)::trace_stream();
}
st->print("%s%s, compile-time-class:%s, method:%s, method_holder:%s, access_flags: ",
prefix,

View File

@ -90,7 +90,7 @@ class TestLogSavedConfig {
private:
char* _saved_config;
char* _new_output;
LogHandle(logging) _log;
Log(logging) _log;
public:
TestLogSavedConfig(const char* apply_output = NULL, const char* apply_setting = NULL) : _new_output(0) {
_saved_config = os::strdup_check_oom(LogOutput::Stdout->config_string());
@ -152,7 +152,7 @@ static void Test_logconfiguration_subscribe_helper() {
void Test_logconfiguration_subscribe() {
ResourceMark rm;
LogHandle(logging) log;
Log(logging) log;
TestLogSavedConfig log_cfg("stdout", "logging+test=trace");

View File

@ -43,19 +43,19 @@
//
// Note that these macros will not evaluate the arguments unless the logging is enabled.
//
#define log_error(...) (!log_is_enabled(Error, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Error>
#define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
#define log_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
#define log_error(...) (!log_is_enabled(Error, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Error>
#define log_warning(...) (!log_is_enabled(Warning, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Warning>
#define log_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
// Macros for logging that should be excluded in product builds.
// Available for levels Info, Debug and Trace. Includes test macro that
// evaluates to false in product builds.
#ifndef PRODUCT
#define log_develop_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_develop_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_develop_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
#define log_develop_info(...) (!log_is_enabled(Info, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Info>
#define log_develop_debug(...) (!log_is_enabled(Debug, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Debug>
#define log_develop_trace(...) (!log_is_enabled(Trace, __VA_ARGS__)) ? (void)0 : LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::Trace>
#define log_develop_is_enabled(level, ...) log_is_enabled(level, __VA_ARGS__)
#else
#define DUMMY_ARGUMENT_CONSUMER(...)
@ -66,7 +66,7 @@
#endif
// Convenience macro to test if the logging is enabled on the specified level for given tags.
#define log_is_enabled(level, ...) (Log<LOG_TAGS(__VA_ARGS__)>::is_level(LogLevel::level))
#define log_is_enabled(level, ...) (LogImpl<LOG_TAGS(__VA_ARGS__)>::is_level(LogLevel::level))
//
// Log class for more advanced logging scenarios.
@ -77,24 +77,24 @@
// calls to <level>_stream() functions (trace_stream(), debug_stream(), etc).
//
// Example usage:
// LogHandle(logging) log;
// Log(logging) log;
// if (log.is_debug()) {
// ...
// log.debug("result = %d", result).trace(" tracing info");
// obj->print_on(log.debug_stream());
// }
//
#define LogHandle(...) Log<LOG_TAGS(__VA_ARGS__)>
#define Log(...) LogImpl<LOG_TAGS(__VA_ARGS__)>
template <LogTagType T0, LogTagType T1, LogTagType T2, LogTagType T3, LogTagType T4, LogTagType GuardTag>
class Log;
class LogImpl;
// Non-template helper class for implementing write-slowpath in cpp
class LogWriteHelper : AllStatic {
private:
template <LogTagType T0, LogTagType T1, LogTagType T2, LogTagType T3, LogTagType T4, LogTagType GuardTag>
friend class Log;
friend class LogImpl;
ATTRIBUTE_PRINTF(6, 0)
static void write_large(LogTagSet& lts,
@ -108,7 +108,7 @@ class LogWriteHelper : AllStatic {
template <LogTagType T0, LogTagType T1 = LogTag::__NO_TAG, LogTagType T2 = LogTag::__NO_TAG, LogTagType T3 = LogTag::__NO_TAG,
LogTagType T4 = LogTag::__NO_TAG, LogTagType GuardTag = LogTag::__NO_TAG>
class Log VALUE_OBJ_CLASS_SPEC {
class LogImpl VALUE_OBJ_CLASS_SPEC {
private:
static const size_t LogBufferSize = 512;
public:
@ -119,7 +119,7 @@ class Log VALUE_OBJ_CLASS_SPEC {
// Empty constructor to avoid warnings on MSVC about unused variables
// when the log instance is only used for static functions.
Log() {
LogImpl() {
}
static bool is_level(LogLevelType level) {
@ -163,11 +163,11 @@ class Log VALUE_OBJ_CLASS_SPEC {
}
#define LOG_LEVEL(level, name) ATTRIBUTE_PRINTF(2, 0) \
Log& v##name(const char* fmt, va_list args) { \
LogImpl& v##name(const char* fmt, va_list args) { \
vwrite(LogLevel::level, fmt, args); \
return *this; \
} \
Log& name(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3) { \
LogImpl& name(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3) { \
va_list args; \
va_start(args, fmt); \
vwrite(LogLevel::level, fmt, args); \

View File

@ -74,7 +74,7 @@ bool ConfigurationLock::current_thread_has_lock() {
void LogConfiguration::post_initialize() {
LogDiagnosticCommand::registerCommand();
LogHandle(logging) log;
Log(logging) log;
log.info("Log configuration fully initialized.");
log_develop_info(logging)("Develop logging is available.");
if (log.is_trace()) {

View File

@ -49,10 +49,6 @@ LogTagSet::LogTagSet(LogTagType t0, LogTagType t1, LogTagType t2, LogTagType t3,
_output_list.set_output_level(LogOutput::Stderr, LogLevel::Default);
}
bool LogTagSet::is_level(LogLevelType level) const {
return _output_list.is_level(level);
}
void LogTagSet::update_decorators(const LogDecorators& decorator) {
LogDecorators new_decorators = decorator;
for (LogOutputList::Iterator it = _output_list.iterator(); it != _output_list.end(); it++) {

View File

@ -95,7 +95,12 @@ class LogTagSet VALUE_OBJ_CLASS_SPEC {
int label(char *buf, size_t len, const char* separator = ",") const;
bool has_output(const LogOutput* output);
bool is_level(LogLevelType level) const;
// The implementation of this function is put here to ensure
// that it is inline:able by the log_is_enabled(level, ...) macro.
bool is_level(LogLevelType level) const {
return _output_list.is_level(level);
}
void log(LogLevelType level, const char* msg);
};

View File

@ -1190,7 +1190,7 @@ void BinaryTreeDictionary<Chunk_t, FreeList_t>::end_sweep_dict_census(double spl
// Does walking the tree 3 times hurt?
set_tree_surplus(splitSurplusPercent);
set_tree_hints();
LogHandle(gc, freelist, stats) log;
Log(gc, freelist, stats) log;
if (log.is_trace()) {
ResourceMark rm;
report_statistics(log.trace_stream());
@ -1232,7 +1232,7 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure<Chunk_t, FreeList_
FreeList_t* total() { return &_total; }
size_t total_free() { return _total_free; }
void do_list(FreeList<Chunk_t>* fl) {
LogHandle(gc, freelist, census) log;
Log(gc, freelist, census) log;
outputStream* out = log.debug_stream();
if (++_print_line >= 40) {
ResourceMark rm;
@ -1246,7 +1246,7 @@ class PrintTreeCensusClosure : public AscendTreeCensusClosure<Chunk_t, FreeList_
#if INCLUDE_ALL_GCS
void do_list(AdaptiveFreeList<Chunk_t>* fl) {
LogHandle(gc, freelist, census) log;
Log(gc, freelist, census) log;
outputStream* out = log.debug_stream();
if (++_print_line >= 40) {
FreeList_t::print_labels_on(out, "size");

View File

@ -810,7 +810,7 @@ void VirtualSpaceNode::verify_container_count() {
BlockFreelist::BlockFreelist() : _dictionary(new BlockTreeDictionary()) {}
BlockFreelist::~BlockFreelist() {
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
if (log.is_trace()) {
ResourceMark rm;
dictionary()->print_free_lists(log.trace_stream());
@ -893,7 +893,7 @@ Metachunk* VirtualSpaceNode::take_from_committed(size_t chunk_word_size) {
"The committed memory doesn't match the expanded memory.");
if (!is_available(chunk_word_size)) {
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
log.debug("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size);
// Dump some information about the virtual space that is nearly full
ResourceMark rm;
@ -1234,7 +1234,7 @@ void VirtualSpaceList::link_vs(VirtualSpaceNode* new_entry) {
new_entry->mangle();
#endif
if (log_is_enabled(Trace, gc, metaspace)) {
LogHandle(gc, metaspace) log;
Log(gc, metaspace) log;
VirtualSpaceNode* vsl = current_virtual_space();
ResourceMark rm;
vsl->print_on(log.trace_stream());
@ -1796,7 +1796,7 @@ Metachunk* ChunkManager::chunk_freelist_allocate(size_t word_size) {
assert((word_size <= chunk->word_size()) ||
list_index(chunk->word_size() == HumongousIndex),
"Non-humongous variable sized chunk");
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
if (log.is_debug()) {
size_t list_count;
if (list_index(word_size) < HumongousIndex) {
@ -1995,7 +1995,7 @@ size_t SpaceManager::calc_chunk_size(size_t word_size) {
"Size calculation is wrong, word_size " SIZE_FORMAT
" chunk_word_size " SIZE_FORMAT,
word_size, chunk_word_size);
LogHandle(gc, metaspace, alloc) log;
Log(gc, metaspace, alloc) log;
if (log.is_debug() && SpaceManager::is_humongous(word_size)) {
log.debug("Metadata humongous allocation:");
log.debug(" word_size " PTR_FORMAT, word_size);
@ -2163,7 +2163,7 @@ SpaceManager::~SpaceManager() {
dec_total_from_size_metrics();
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
if (log.is_trace()) {
log.trace("~SpaceManager(): " PTR_FORMAT, p2i(this));
ResourceMark rm;
@ -2306,7 +2306,7 @@ void SpaceManager::add_chunk(Metachunk* new_chunk, bool make_current) {
inc_size_metrics(new_chunk->word_size());
assert(new_chunk->is_empty(), "Not ready for reuse");
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
if (log.is_trace()) {
log.trace("SpaceManager::add_chunk: " SIZE_FORMAT ") ", sum_count_in_chunks_in_use());
ResourceMark rm;
@ -2337,7 +2337,7 @@ Metachunk* SpaceManager::get_new_chunk(size_t word_size,
medium_chunk_bunch());
}
LogHandle(gc, metaspace, alloc) log;
Log(gc, metaspace, alloc) log;
if (log.is_debug() && next != NULL &&
SpaceManager::is_humongous(next->word_size())) {
log.debug(" new humongous chunk word size " PTR_FORMAT, next->word_size());
@ -3037,7 +3037,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a
initialize_class_space(metaspace_rs);
if (log_is_enabled(Trace, gc, metaspace)) {
LogHandle(gc, metaspace) log;
Log(gc, metaspace) log;
ResourceMark rm;
print_compressed_class_space(log.trace_stream(), requested_addr);
}
@ -3512,7 +3512,7 @@ void Metaspace::report_metadata_oome(ClassLoaderData* loader_data, size_t word_s
tracer()->report_metadata_oom(loader_data, word_size, type, mdtype);
// If result is still null, we are out of memory.
LogHandle(gc, metaspace, freelist) log;
Log(gc, metaspace, freelist) log;
if (log.is_trace()) {
log.trace("Metaspace allocation failed for size " SIZE_FORMAT, word_size);
ResourceMark rm;

View File

@ -1082,7 +1082,7 @@ void Universe::print_heap_at_SIGBREAK() {
}
void Universe::print_heap_before_gc() {
LogHandle(gc, heap) log;
Log(gc, heap) log;
if (log.is_debug()) {
log.debug("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
ResourceMark rm;
@ -1091,7 +1091,7 @@ void Universe::print_heap_before_gc() {
}
void Universe::print_heap_after_gc() {
LogHandle(gc, heap) log;
Log(gc, heap) log;
if (log.is_debug()) {
log.debug("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
ResourceMark rm;

View File

@ -1258,7 +1258,7 @@ void GenerateOopMap::do_exception_edge(BytecodeStream* itr) {
void GenerateOopMap::report_monitor_mismatch(const char *msg) {
ResourceMark rm;
outputStream* out = LogHandle(monitormismatch)::info_stream();
outputStream* out = Log(monitormismatch)::info_stream();
out->print("Monitor mismatch in method ");
method()->print_short_name(out);
out->print_cr(": %s", msg);

View File

@ -1089,7 +1089,7 @@ void InstanceKlass::call_class_initializer_impl(instanceKlassHandle this_k, TRAP
assert(!this_k->is_initialized(), "we cannot initialize twice");
if (log_is_enabled(Info, classinit)) {
ResourceMark rm;
outputStream* log = LogHandle(classinit)::info_stream();
outputStream* log = Log(classinit)::info_stream();
log->print("%d Initializing ", call_class_initializer_impl_counter++);
this_k->name()->print_value_on(log);
log->print_cr("%s (" INTPTR_FORMAT ")", h_method() == NULL ? "(no method)" : "", p2i(this_k()));
@ -3010,11 +3010,11 @@ void InstanceKlass::print_loading_log(LogLevel::type type,
assert(type == LogLevel::Info || type == LogLevel::Debug, "sanity");
if (type == LogLevel::Info) {
log = LogHandle(classload)::info_stream();
log = Log(classload)::info_stream();
} else {
assert(type == LogLevel::Debug,
"print_loading_log supports only Debug and Info levels");
log = LogHandle(classload)::debug_stream();
log = Log(classload)::debug_stream();
}
// Name and class hierarchy info

View File

@ -274,7 +274,7 @@ InstanceKlass* klassVtable::find_transitive_override(InstanceKlass* initialsuper
if (supersuperklass->is_override(super_method, target_loader, target_classname, THREAD)) {
if (log_develop_is_enabled(Trace, vtables)) {
ResourceMark rm(THREAD);
outputStream* logst = LogHandle(vtables)::trace_stream();
outputStream* logst = Log(vtables)::trace_stream();
char* sig = target_method()->name_and_sig_as_C_string();
logst->print("transitive overriding superclass %s with %s::%s index %d, original flags: ",
supersuperklass->internal_name(),
@ -305,7 +305,7 @@ static void log_vtables(int i, bool overrides, methodHandle target_method,
#ifndef PRODUCT
if (log_develop_is_enabled(Trace, vtables)) {
ResourceMark rm(thread);
outputStream* logst = LogHandle(vtables)::trace_stream();
outputStream* logst = Log(vtables)::trace_stream();
char* sig = target_method()->name_and_sig_as_C_string();
if (overrides) {
logst->print("overriding with %s::%s index %d, original flags: ",
@ -493,7 +493,7 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar
void klassVtable::put_method_at(Method* m, int index) {
if (log_develop_is_enabled(Trace, vtables)) {
ResourceMark rm;
outputStream* logst = LogHandle(vtables)::trace_stream();
outputStream* logst = Log(vtables)::trace_stream();
const char* sig = (m != NULL) ? m->name_and_sig_as_C_string() : "<NULL>";
logst->print("adding %s at index %d, flags: ", sig, index);
if (m != NULL) {
@ -821,7 +821,7 @@ int klassVtable::fill_in_mirandas(int initialized) {
if (log_develop_is_enabled(Trace, vtables)) {
Method* meth = mirandas.at(i);
ResourceMark rm(Thread::current());
outputStream* logst = LogHandle(vtables)::trace_stream();
outputStream* logst = Log(vtables)::trace_stream();
if (meth != NULL) {
char* sig = meth->name_and_sig_as_C_string();
logst->print("fill in mirandas with %s index %d, flags: ",
@ -1045,7 +1045,7 @@ int klassItable::assign_itable_indices_for_interface(Klass* klass) {
// If m is already assigned a vtable index, do not disturb it.
if (log_develop_is_enabled(Trace, itables)) {
ResourceMark rm;
outputStream* logst = LogHandle(itables)::trace_stream();
outputStream* logst = Log(itables)::trace_stream();
assert(m != NULL, "methods can never be null");
const char* sig = m->name_and_sig_as_C_string();
if (m->has_vtable_index()) {
@ -1161,7 +1161,7 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
if (log_develop_is_enabled(Trace, itables)) {
ResourceMark rm(THREAD);
if (target() != NULL) {
outputStream* logst = LogHandle(itables)::trace_stream();
outputStream* logst = Log(itables)::trace_stream();
char* sig = target()->name_and_sig_as_C_string();
logst->print("interface: %s, ime_num: %d, target: %s, method_holder: %s ",
interf_h()->internal_name(), ime_num, sig,

View File

@ -1288,7 +1288,7 @@ JRT_ENTRY_NO_ASYNC(address, OptoRuntime::handle_exception_C_helper(JavaThread* t
if (log_is_enabled(Info, exceptions)) {
ResourceMark rm;
trace_exception(LogHandle(exceptions)::info_stream(), exception(), pc, "");
trace_exception(Log(exceptions)::info_stream(), exception(), pc, "");
}
// for AbortVMOnException flag

View File

@ -465,7 +465,7 @@ void before_exit(JavaThread* thread) {
Universe::heap()->stop();
// Print GC/heap related information.
LogHandle(gc, heap, exit) log;
Log(gc, heap, exit) log;
if (log.is_info()) {
ResourceMark rm;
Universe::print_on(log.info_stream());

View File

@ -228,7 +228,7 @@ void SafepointSynchronize::begin() {
}
if (log_is_enabled(Trace, safepoint)) {
ResourceMark rm;
cur_state->print_on(LogHandle(safepoint)::trace_stream());
cur_state->print_on(Log(safepoint)::trace_stream());
}
}
}

View File

@ -2093,7 +2093,7 @@ void JavaThread::check_and_handle_async_exceptions(bool check_unsafe_error) {
if (log_is_enabled(Info, exceptions)) {
ResourceMark rm;
outputStream* logstream = LogHandle(exceptions)::info_stream();
outputStream* logstream = Log(exceptions)::info_stream();
logstream->print("Async. exception installed at runtime exit (" INTPTR_FORMAT ")", p2i(this));
if (has_last_Java_frame()) {
frame f = last_frame();

View File

@ -38,10 +38,10 @@
typedef void (*TraceTimerLogPrintFunc)(const char*, ...);
// We need to explicit take address of Log<>write<> and static cast
// We need to explicit take address of LogImpl<>write<> and static cast
// due to MSVC is not compliant with templates two-phase lookup
#define TRACETIME_LOG(TT_LEVEL, ...) \
log_is_enabled(TT_LEVEL, __VA_ARGS__) ? static_cast<TraceTimerLogPrintFunc>(&Log<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::TT_LEVEL>) : (TraceTimerLogPrintFunc)NULL
log_is_enabled(TT_LEVEL, __VA_ARGS__) ? static_cast<TraceTimerLogPrintFunc>(&LogImpl<LOG_TAGS(__VA_ARGS__)>::write<LogLevel::TT_LEVEL>) : (TraceTimerLogPrintFunc)NULL
class TraceTime: public StackObj {
private:

View File

@ -59,7 +59,7 @@ void VM_Operation::evaluate() {
outputStream* debugstream;
bool enabled = log_is_enabled(Debug, vmoperation);
if (enabled) {
debugstream = LogHandle(vmoperation)::debug_stream();
debugstream = Log(vmoperation)::debug_stream();
debugstream->print("begin ");
print_on_error(debugstream);
debugstream->cr();

View File

@ -54,7 +54,7 @@ void ThreadShadow::set_pending_exception(oop exception, const char* file, int li
void ThreadShadow::clear_pending_exception() {
if (_pending_exception != NULL && log_is_enabled(Debug, exceptions)) {
ResourceMark rm;
outputStream* logst = LogHandle(exceptions)::debug_stream();
outputStream* logst = Log(exceptions)::debug_stream();
logst->print("Thread::clear_pending_exception: cleared exception:");
_pending_exception->print_on(logst);
}