< prev index next >

src/share/vm/memory/universe.cpp

Print this page
rev 13105 : imported patch 8181917-refactor-ul-logstream-alt1-callsite-changes

@@ -39,10 +39,11 @@
 #include "gc/shared/generation.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "gc/shared/space.hpp"
 #include "interpreter/interpreter.hpp"
 #include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/filemap.hpp"
 #include "memory/metadataFactory.hpp"
 #include "memory/metaspaceShared.hpp"
 #include "memory/oopFactory.hpp"
 #include "memory/resourceArea.hpp"

@@ -758,14 +759,15 @@
       Universe::set_narrow_oop_base(0);
     }
 
     Universe::set_narrow_ptrs_base(Universe::narrow_oop_base());
 
-    if (log_is_enabled(Info, gc, heap, coops)) {
+    LogTarget(Info, gc, heap, coops) lt;
+    if (lt.is_enabled()) {
       ResourceMark rm;
-      outputStream* logst = Log(gc, heap, coops)::info_stream();
-      Universe::print_compressed_oops_mode(logst);
+      LogStream ls(lt);
+      Universe::print_compressed_oops_mode(&ls);
     }
 
     // Tell tests in which mode we run.
     Arguments::PropertyList_add(new SystemProperty("java.vm.compressedOopsMode",
                                                    narrow_oop_mode_to_string(narrow_oop_mode()),

@@ -1094,24 +1096,26 @@
     tty->flush();
   }
 }
 
 void Universe::print_heap_before_gc() {
-  Log(gc, heap) log;
-  if (log.is_debug()) {
-    log.debug("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
+  LogTarget(Debug, gc, heap) lt;
+  if (lt.is_enabled()) {
+    LogStream ls(lt);
+    ls.print("Heap before GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
     ResourceMark rm;
-    heap()->print_on(log.debug_stream());
+    heap()->print_on(&ls);
   }
 }
 
 void Universe::print_heap_after_gc() {
-  Log(gc, heap) log;
-  if (log.is_debug()) {
-    log.debug("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
+  LogTarget(Debug, gc, heap) lt;
+  if (lt.is_enabled()) {
+    LogStream ls(lt);
+    ls.print("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
     ResourceMark rm;
-    heap()->print_on(log.debug_stream());
+    heap()->print_on(&ls);
   }
 }
 
 void Universe::initialize_verify_flags() {
   verify_flags = 0;
< prev index next >