comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 1779:6eddcbe17c83

6981746: G1: SEGV with -XX:+TraceGen0Time Summary: Pass correct value for length to NumberSeq constructor. Guard dereferences of "body_summary" pointer with a NULL check. Reviewed-by: tonyp, ysr
author johnc
date Mon, 13 Sep 2010 10:00:24 -0700
parents 0ce1569c90e5
children 8b10f48633dc
comparison
equal deleted inserted replaced
1778:eeade8e89248 1779:6eddcbe17c83
2146 body_summary->get_scan_rs_seq(), 2146 body_summary->get_scan_rs_seq(),
2147 body_summary->get_obj_copy_seq(), 2147 body_summary->get_obj_copy_seq(),
2148 body_summary->get_termination_seq() 2148 body_summary->get_termination_seq()
2149 }; 2149 };
2150 NumberSeq calc_other_times_ms(body_summary->get_parallel_seq(), 2150 NumberSeq calc_other_times_ms(body_summary->get_parallel_seq(),
2151 7, other_parts); 2151 6, other_parts);
2152 check_other_times(2, body_summary->get_parallel_other_seq(), 2152 check_other_times(2, body_summary->get_parallel_other_seq(),
2153 &calc_other_times_ms); 2153 &calc_other_times_ms);
2154 } 2154 }
2155 print_summary(1, "Mark Closure", body_summary->get_mark_closure_seq()); 2155 print_summary(1, "Mark Closure", body_summary->get_mark_closure_seq());
2156 print_summary(1, "Clear CT", body_summary->get_clear_ct_seq()); 2156 print_summary(1, "Clear CT", body_summary->get_clear_ct_seq());
2164 print_summary(1, "Object Copy", body_summary->get_obj_copy_seq()); 2164 print_summary(1, "Object Copy", body_summary->get_obj_copy_seq());
2165 } 2165 }
2166 } 2166 }
2167 print_summary(1, "Other", summary->get_other_seq()); 2167 print_summary(1, "Other", summary->get_other_seq());
2168 { 2168 {
2169 NumberSeq calc_other_times_ms; 2169 if (body_summary != NULL) {
2170 if (parallel) { 2170 NumberSeq calc_other_times_ms;
2171 // parallel 2171 if (parallel) {
2172 NumberSeq* other_parts[] = { 2172 // parallel
2173 body_summary->get_satb_drain_seq(), 2173 NumberSeq* other_parts[] = {
2174 body_summary->get_parallel_seq(), 2174 body_summary->get_satb_drain_seq(),
2175 body_summary->get_clear_ct_seq() 2175 body_summary->get_parallel_seq(),
2176 }; 2176 body_summary->get_clear_ct_seq()
2177 calc_other_times_ms = NumberSeq(summary->get_total_seq(), 2177 };
2178 3, other_parts); 2178 calc_other_times_ms = NumberSeq(summary->get_total_seq(),
2179 } else { 2179 3, other_parts);
2180 // serial 2180 } else {
2181 NumberSeq* other_parts[] = { 2181 // serial
2182 body_summary->get_satb_drain_seq(), 2182 NumberSeq* other_parts[] = {
2183 body_summary->get_update_rs_seq(), 2183 body_summary->get_satb_drain_seq(),
2184 body_summary->get_ext_root_scan_seq(), 2184 body_summary->get_update_rs_seq(),
2185 body_summary->get_mark_stack_scan_seq(), 2185 body_summary->get_ext_root_scan_seq(),
2186 body_summary->get_scan_rs_seq(), 2186 body_summary->get_mark_stack_scan_seq(),
2187 body_summary->get_obj_copy_seq() 2187 body_summary->get_scan_rs_seq(),
2188 }; 2188 body_summary->get_obj_copy_seq()
2189 calc_other_times_ms = NumberSeq(summary->get_total_seq(), 2189 };
2190 7, other_parts); 2190 calc_other_times_ms = NumberSeq(summary->get_total_seq(),
2191 6, other_parts);
2192 }
2193 check_other_times(1, summary->get_other_seq(), &calc_other_times_ms);
2191 } 2194 }
2192 check_other_times(1, summary->get_other_seq(), &calc_other_times_ms);
2193 } 2195 }
2194 } else { 2196 } else {
2195 print_indent(0); 2197 print_indent(0);
2196 gclog_or_tty->print_cr("none"); 2198 gclog_or_tty->print_cr("none");
2197 } 2199 }