diff src/share/vm/gc/cms/parOopClosures.inline.hpp @ 10585:d5e9c320ac68

8151603: Use error stream instead of tty for logging before ShouldNotReachHere() Reviewed-by: mgerdin, sjohanss
author brutisso
date Fri, 11 Mar 2016 10:27:45 +0100
parents f944761a3ce3
children 4a0121d1e772
line wrap: on
line diff
--- a/src/share/vm/gc/cms/parOopClosures.inline.hpp	Fri Mar 11 10:06:30 2016 +0100
+++ b/src/share/vm/gc/cms/parOopClosures.inline.hpp	Fri Mar 11 10:27:45 2016 +0100
@@ -82,18 +82,19 @@
     if ((HeapWord*)obj < _boundary) {
 #ifndef PRODUCT
       if (_g->to()->is_in_reserved(obj)) {
-        tty->print_cr("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
+        LogHandle(gc) log;
+        log.error("Scanning field (" PTR_FORMAT ") twice?", p2i(p));
         GenCollectedHeap* gch = GenCollectedHeap::heap();
         Space* sp = gch->space_containing(p);
         oop obj = oop(sp->block_start(p));
         assert((HeapWord*)obj < (HeapWord*)p, "Error");
-        tty->print_cr("Object: " PTR_FORMAT, p2i((void *)obj));
-        tty->print_cr("-------");
-        obj->print();
-        tty->print_cr("-----");
-        tty->print_cr("Heap:");
-        tty->print_cr("-----");
-        gch->print();
+        log.error("Object: " PTR_FORMAT, p2i((void *)obj));
+        log.error("-------");
+        obj->print_on(log.error_stream());
+        log.error("-----");
+        log.error("Heap:");
+        log.error("-----");
+        gch->print_on(log.error_stream());
         ShouldNotReachHere();
       }
 #endif