Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 532:99c597293e35
Merge
author | coleenp |
---|---|
date | Fri, 23 Jan 2009 10:41:28 -0500 |
parents | 0af8b0718fc9 |
children | 5cfd8d19e546 |
comparison
equal
deleted
inserted
replaced
531:40ee984935b9 | 532:99c597293e35 |
---|---|
3012 if (freelistLock()->owned_by_self()) { | 3012 if (freelistLock()->owned_by_self()) { |
3013 Generation::object_iterate(cl); | 3013 Generation::object_iterate(cl); |
3014 } else { | 3014 } else { |
3015 MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag); | 3015 MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag); |
3016 Generation::object_iterate(cl); | 3016 Generation::object_iterate(cl); |
3017 } | |
3018 } | |
3019 | |
3020 void | |
3021 ConcurrentMarkSweepGeneration::safe_object_iterate(ObjectClosure* cl) { | |
3022 if (freelistLock()->owned_by_self()) { | |
3023 Generation::safe_object_iterate(cl); | |
3024 } else { | |
3025 MutexLockerEx x(freelistLock(), Mutex::_no_safepoint_check_flag); | |
3026 Generation::safe_object_iterate(cl); | |
3017 } | 3027 } |
3018 } | 3028 } |
3019 | 3029 |
3020 void | 3030 void |
3021 ConcurrentMarkSweepGeneration::pre_adjust_pointers() { | 3031 ConcurrentMarkSweepGeneration::pre_adjust_pointers() { |
6621 return 0; | 6631 return 0; |
6622 } | 6632 } |
6623 if (_bitMap->isMarked(addr)) { | 6633 if (_bitMap->isMarked(addr)) { |
6624 // it's marked; is it potentially uninitialized? | 6634 // it's marked; is it potentially uninitialized? |
6625 if (p->klass_or_null() != NULL) { | 6635 if (p->klass_or_null() != NULL) { |
6626 if (CMSPermGenPrecleaningEnabled && !p->is_parsable()) { | 6636 // If is_conc_safe is false, the object may be undergoing |
6637 // change by the VM outside a safepoint. Don't try to | |
6638 // scan it, but rather leave it for the remark phase. | |
6639 if (CMSPermGenPrecleaningEnabled && | |
6640 (!p->is_conc_safe() || !p->is_parsable())) { | |
6627 // Signal precleaning to redirty the card since | 6641 // Signal precleaning to redirty the card since |
6628 // the klass pointer is already installed. | 6642 // the klass pointer is already installed. |
6629 assert(size == 0, "Initial value"); | 6643 assert(size == 0, "Initial value"); |
6630 } else { | 6644 } else { |
6631 assert(p->is_parsable(), "must be parsable."); | 6645 assert(p->is_parsable(), "must be parsable."); |
6999 // future by detecting that condition and clearing fewer | 7013 // future by detecting that condition and clearing fewer |
7000 // MUT/CT entries. | 7014 // MUT/CT entries. |
7001 _mut->clear_range(mr); | 7015 _mut->clear_range(mr); |
7002 } | 7016 } |
7003 DEBUG_ONLY(}) | 7017 DEBUG_ONLY(}) |
7004 | |
7005 // Note: the finger doesn't advance while we drain | 7018 // Note: the finger doesn't advance while we drain |
7006 // the stack below. | 7019 // the stack below. |
7007 PushOrMarkClosure pushOrMarkClosure(_collector, | 7020 PushOrMarkClosure pushOrMarkClosure(_collector, |
7008 _span, _bitMap, _markStack, | 7021 _span, _bitMap, _markStack, |
7009 _revisitStack, | 7022 _revisitStack, |
8060 "alignment problem"); | 8073 "alignment problem"); |
8061 | 8074 |
8062 #ifdef DEBUG | 8075 #ifdef DEBUG |
8063 if (oop(addr)->klass_or_null() != NULL && | 8076 if (oop(addr)->klass_or_null() != NULL && |
8064 ( !_collector->should_unload_classes() | 8077 ( !_collector->should_unload_classes() |
8065 || oop(addr)->is_parsable())) { | 8078 || (oop(addr)->is_parsable()) && |
8079 oop(addr)->is_conc_safe())) { | |
8066 // Ignore mark word because we are running concurrent with mutators | 8080 // Ignore mark word because we are running concurrent with mutators |
8067 assert(oop(addr)->is_oop(true), "live block should be an oop"); | 8081 assert(oop(addr)->is_oop(true), "live block should be an oop"); |
8082 // is_conc_safe is checked before performing this assertion | |
8083 // because an object that is not is_conc_safe may yet have | |
8084 // the return from size() correct. | |
8068 assert(size == | 8085 assert(size == |
8069 CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()), | 8086 CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()), |
8070 "P-mark and computed size do not agree"); | 8087 "P-mark and computed size do not agree"); |
8071 } | 8088 } |
8072 #endif | 8089 #endif |
8075 // This should be an initialized object that's alive. | 8092 // This should be an initialized object that's alive. |
8076 assert(oop(addr)->klass_or_null() != NULL && | 8093 assert(oop(addr)->klass_or_null() != NULL && |
8077 (!_collector->should_unload_classes() | 8094 (!_collector->should_unload_classes() |
8078 || oop(addr)->is_parsable()), | 8095 || oop(addr)->is_parsable()), |
8079 "Should be an initialized object"); | 8096 "Should be an initialized object"); |
8097 // Note that there are objects used during class redefinition | |
8098 // (e.g., merge_cp in VM_RedefineClasses::merge_cp_and_rewrite() | |
8099 // which are discarded with their is_conc_safe state still | |
8100 // false. These object may be floating garbage so may be | |
8101 // seen here. If they are floating garbage their size | |
8102 // should be attainable from their klass. Do not that | |
8103 // is_conc_safe() is true for oop(addr). | |
8080 // Ignore mark word because we are running concurrent with mutators | 8104 // Ignore mark word because we are running concurrent with mutators |
8081 assert(oop(addr)->is_oop(true), "live block should be an oop"); | 8105 assert(oop(addr)->is_oop(true), "live block should be an oop"); |
8082 // Verify that the bit map has no bits marked between | 8106 // Verify that the bit map has no bits marked between |
8083 // addr and purported end of this block. | 8107 // addr and purported end of this block. |
8084 size = CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()); | 8108 size = CompactibleFreeListSpace::adjustObjectSize(oop(addr)->size()); |