Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @ 17749:b7e42ada4898
8036672: G1: alloc_purpose in copy_to_survivor_space() used incorrectly
Reviewed-by: brutisso, tschatzl
author | pliden |
---|---|
date | Mon, 17 Mar 2014 15:18:38 +0100 |
parents | d60ecdb2773e |
children | 191174b49bec |
comparison
equal
deleted
inserted
replaced
17748:d60ecdb2773e | 17749:b7e42ada4898 |
---|---|
4741 Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes); | 4741 Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes); |
4742 | 4742 |
4743 oop forward_ptr = old->forward_to_atomic(obj); | 4743 oop forward_ptr = old->forward_to_atomic(obj); |
4744 if (forward_ptr == NULL) { | 4744 if (forward_ptr == NULL) { |
4745 Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz); | 4745 Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz); |
4746 | |
4747 // alloc_purpose is just a hint to allocate() above, recheck the type of region | |
4748 // we actually allocated from and update alloc_purpose accordingly | |
4749 HeapRegion* to_region = _g1h->heap_region_containing_raw(obj_ptr); | |
4750 alloc_purpose = to_region->is_young() ? GCAllocForSurvived : GCAllocForTenured; | |
4751 | |
4746 if (g1p->track_object_age(alloc_purpose)) { | 4752 if (g1p->track_object_age(alloc_purpose)) { |
4747 // We could simply do obj->incr_age(). However, this causes a | 4753 // We could simply do obj->incr_age(). However, this causes a |
4748 // performance issue. obj->incr_age() will first check whether | 4754 // performance issue. obj->incr_age() will first check whether |
4749 // the object has a displaced mark by checking its mark word; | 4755 // the object has a displaced mark by checking its mark word; |
4750 // getting the mark word from the new location of the object | 4756 // getting the mark word from the new location of the object |