43 } 44 // trying to keep the Windows compiler happy 45 return NULL; 46 } 47 48 const char* G1HRPrinter::region_type_name(RegionType type) { 49 switch (type) { 50 case Unset: return NULL; 51 case Eden: return "Eden"; 52 case Survivor: return "Survivor"; 53 case Old: return "Old"; 54 case StartsHumongous: return "StartsH"; 55 case ContinuesHumongous: return "ContinuesH"; 56 case Archive: return "Archive"; 57 default: ShouldNotReachHere(); 58 } 59 // trying to keep the Windows compiler happy 60 return NULL; 61 } 62 63 const char* G1HRPrinter::phase_name(PhaseType phase) { 64 switch (phase) { 65 case StartGC: return "StartGC"; 66 case EndGC: return "EndGC"; 67 case StartFullGC: return "StartFullGC"; 68 case EndFullGC: return "EndFullGC"; 69 default: ShouldNotReachHere(); 70 } 71 // trying to keep the Windows compiler happy 72 return NULL; 73 } 74 75 #define G1HR_PREFIX " G1HR" 76 77 void G1HRPrinter::print(ActionType action, RegionType type, 78 HeapRegion* hr, HeapWord* top) { 79 const char* action_str = action_name(action); 80 const char* type_str = region_type_name(type); 81 HeapWord* bottom = hr->bottom(); 82 83 if (type_str != NULL) { 84 if (top != NULL) { 85 gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, 86 action_str, type_str, p2i(bottom), p2i(top)); 87 } else { 88 gclog_or_tty->print_cr(G1HR_PREFIX " %s(%s) " PTR_FORMAT, 89 action_str, type_str, p2i(bottom)); 90 } 91 } else { 92 if (top != NULL) { 93 gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, 94 action_str, p2i(bottom), p2i(top)); 95 } else { 96 gclog_or_tty->print_cr(G1HR_PREFIX " %s " PTR_FORMAT, 97 action_str, p2i(bottom)); 98 } 99 } 100 } 101 102 void G1HRPrinter::print(ActionType action, HeapWord* bottom, HeapWord* end) { 103 const char* action_str = action_name(action); 104 105 gclog_or_tty->print_cr(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", 106 action_str, p2i(bottom), p2i(end)); 107 } 108 109 void G1HRPrinter::print(PhaseType phase, size_t phase_num) { 110 const char* phase_str = phase_name(phase); 111 gclog_or_tty->print_cr(G1HR_PREFIX " #%s " SIZE_FORMAT, phase_str, phase_num); 112 } | 43 } 44 // trying to keep the Windows compiler happy 45 return NULL; 46 } 47 48 const char* G1HRPrinter::region_type_name(RegionType type) { 49 switch (type) { 50 case Unset: return NULL; 51 case Eden: return "Eden"; 52 case Survivor: return "Survivor"; 53 case Old: return "Old"; 54 case StartsHumongous: return "StartsH"; 55 case ContinuesHumongous: return "ContinuesH"; 56 case Archive: return "Archive"; 57 default: ShouldNotReachHere(); 58 } 59 // trying to keep the Windows compiler happy 60 return NULL; 61 } 62 63 #define G1HR_PREFIX " G1HR" 64 65 void G1HRPrinter::print(ActionType action, RegionType type, 66 HeapRegion* hr, HeapWord* top) { 67 const char* action_str = action_name(action); 68 const char* type_str = region_type_name(type); 69 HeapWord* bottom = hr->bottom(); 70 71 if (type_str != NULL) { 72 if (top != NULL) { 73 log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT " " PTR_FORMAT, 74 action_str, type_str, p2i(bottom), p2i(top)); 75 } else { 76 log_trace(gc, region)(G1HR_PREFIX " %s(%s) " PTR_FORMAT, 77 action_str, type_str, p2i(bottom)); 78 } 79 } else { 80 if (top != NULL) { 81 log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT " " PTR_FORMAT, 82 action_str, p2i(bottom), p2i(top)); 83 } else { 84 log_trace(gc, region)(G1HR_PREFIX " %s " PTR_FORMAT, 85 action_str, p2i(bottom)); 86 } 87 } 88 } 89 90 void G1HRPrinter::print(ActionType action, HeapWord* bottom, HeapWord* end) { 91 const char* action_str = action_name(action); 92 93 log_trace(gc, region)(G1HR_PREFIX " %s [" PTR_FORMAT "," PTR_FORMAT "]", 94 action_str, p2i(bottom), p2i(end)); 95 } |