58 |
58 |
59 ResourceMark rm; |
59 ResourceMark rm; |
60 stringStream ss; |
60 stringStream ss; |
61 r->print_on(&ss); |
61 r->print_on(&ss); |
62 |
62 |
|
63 stringStream mw_ss; |
|
64 obj->mark()->print_on(&mw_ss); |
|
65 |
63 ShenandoahMarkingContext* const ctx = heap->marking_context(); |
66 ShenandoahMarkingContext* const ctx = heap->marking_context(); |
64 |
67 |
65 msg.append(" " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name()); |
68 msg.append(" " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name()); |
66 msg.append(" %3s allocated after mark start\n", ctx->allocated_after_mark_start((HeapWord *) obj) ? "" : "not"); |
69 msg.append(" %3s allocated after mark start\n", ctx->allocated_after_mark_start((HeapWord *) obj) ? "" : "not"); |
67 msg.append(" %3s marked \n", ctx->is_marked(obj) ? "" : "not"); |
70 msg.append(" %3s marked \n", ctx->is_marked(obj) ? "" : "not"); |
68 msg.append(" %3s in collection set\n", heap->in_collection_set(obj) ? "" : "not"); |
71 msg.append(" %3s in collection set\n", heap->in_collection_set(obj) ? "" : "not"); |
69 if (heap->traversal_gc() != NULL) { |
72 if (heap->traversal_gc() != NULL) { |
70 msg.append(" %3s in traversal set\n", heap->traversal_gc()->traversal_set()->is_in((HeapWord*) obj) ? "" : "not"); |
73 msg.append(" %3s in traversal set\n", heap->traversal_gc()->traversal_set()->is_in((HeapWord*) obj) ? "" : "not"); |
71 } |
74 } |
|
75 msg.append(" mark:%s\n", mw_ss.as_string()); |
72 msg.append(" region: %s", ss.as_string()); |
76 msg.append(" region: %s", ss.as_string()); |
73 } |
77 } |
74 |
78 |
75 void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) { |
79 void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) { |
76 ShenandoahHeap* heap = ShenandoahHeap::heap(); |
80 ShenandoahHeap* heap = ShenandoahHeap::heap(); |
248 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed", |
252 print_failure(_safe_unknown, obj, interior_loc, NULL, "Shenandoah assert_in_correct_region failed", |
249 "Object must reside in active region", |
253 "Object must reside in active region", |
250 file, line); |
254 file, line); |
251 } |
255 } |
252 |
256 |
253 size_t alloc_size = obj->size() + ShenandoahForwarding::word_size(); |
257 size_t alloc_size = obj->size(); |
254 if (alloc_size > ShenandoahHeapRegion::humongous_threshold_words()) { |
258 if (alloc_size > ShenandoahHeapRegion::humongous_threshold_words()) { |
255 size_t idx = r->region_number(); |
259 size_t idx = r->region_number(); |
256 size_t num_regions = ShenandoahHeapRegion::required_regions(alloc_size * HeapWordSize); |
260 size_t num_regions = ShenandoahHeapRegion::required_regions(alloc_size * HeapWordSize); |
257 for (size_t i = idx; i < idx + num_regions; i++) { |
261 for (size_t i = idx; i < idx + num_regions; i++) { |
258 ShenandoahHeapRegion* chain_reg = heap->get_region(i); |
262 ShenandoahHeapRegion* chain_reg = heap->get_region(i); |