< prev index next >

src/share/vm/code/nmethod.cpp

Print this page
rev 13180 : imported patch 8181917-refactor-ul-logstream

@@ -35,10 +35,11 @@
 #include "compiler/compilerDirectives.hpp"
 #include "compiler/directivesParser.hpp"
 #include "compiler/disassembler.hpp"
 #include "interpreter/bytecode.hpp"
 #include "logging/log.hpp"
+#include "logging/logStream.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/methodData.hpp"
 #include "oops/oop.inline.hpp"
 #include "prims/jvm.h"
 #include "prims/jvmtiImpl.hpp"

@@ -1034,18 +1035,19 @@
   assert(is_alive != NULL, "Should be non-NULL");
   // A non-NULL is_alive closure indicates that this is being called during GC.
   flush_dependencies(is_alive);
 
   // Break cycle between nmethod & method
-  if (log_is_enabled(Trace, class, unload)) {
-    outputStream* log = Log(class, unload)::trace_stream();
-    log->print_cr("making nmethod " INTPTR_FORMAT
+  LogTarget(Trace, class, unload) lt;
+  if (lt.is_enabled()) {
+    LogStream ls(lt);
+    ls.print_cr("making nmethod " INTPTR_FORMAT
                   " unloadable, Method*(" INTPTR_FORMAT
                   "), cause(" INTPTR_FORMAT ")",
                   p2i(this), p2i(_method), p2i(cause));
     if (!Universe::heap()->is_gc_active())
-      cause->klass()->print_on(log);
+      cause->klass()->print_on(&ls);
   }
   // Unlink the osr method, so we do not look this up again
   if (is_osr_method()) {
     // Invalidate the osr nmethod only once
     if (is_in_use()) {
< prev index next >