< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.cpp

Print this page




1017 #ifdef ASSERT
1018 // Don't implement this by using is_in_young().  This method is used
1019 // in some cases to check that is_in_young() is correct.
1020 bool GenCollectedHeap::is_in_partial_collection(const void* p) {
1021   assert(is_in_reserved(p) || p == NULL,
1022     "Does not work if address is non-null and outside of the heap");
1023   return p < _young_gen->reserved().end() && p != NULL;
1024 }
1025 #endif
1026 
1027 void GenCollectedHeap::oop_iterate(OopIterateClosure* cl) {
1028   _young_gen->oop_iterate(cl);
1029   _old_gen->oop_iterate(cl);
1030 }
1031 
1032 void GenCollectedHeap::object_iterate(ObjectClosure* cl) {
1033   _young_gen->object_iterate(cl);
1034   _old_gen->object_iterate(cl);
1035 }
1036 
1037 void GenCollectedHeap::safe_object_iterate(ObjectClosure* cl) {
1038   _young_gen->safe_object_iterate(cl);
1039   _old_gen->safe_object_iterate(cl);
1040 }
1041 
1042 Space* GenCollectedHeap::space_containing(const void* addr) const {
1043   Space* res = _young_gen->space_containing(addr);
1044   if (res != NULL) {
1045     return res;
1046   }
1047   res = _old_gen->space_containing(addr);
1048   assert(res != NULL, "Could not find containing space");
1049   return res;
1050 }
1051 
1052 HeapWord* GenCollectedHeap::block_start(const void* addr) const {
1053   assert(is_in_reserved(addr), "block_start of address outside of heap");
1054   if (_young_gen->is_in_reserved(addr)) {
1055     assert(_young_gen->is_in(addr), "addr should be in allocated part of generation");
1056     return _young_gen->block_start(addr);
1057   }
1058 
1059   assert(_old_gen->is_in_reserved(addr), "Some generation should contain the address");
1060   assert(_old_gen->is_in(addr), "addr should be in allocated part of generation");
1061   return _old_gen->block_start(addr);




1017 #ifdef ASSERT
1018 // Don't implement this by using is_in_young().  This method is used
1019 // in some cases to check that is_in_young() is correct.
1020 bool GenCollectedHeap::is_in_partial_collection(const void* p) {
1021   assert(is_in_reserved(p) || p == NULL,
1022     "Does not work if address is non-null and outside of the heap");
1023   return p < _young_gen->reserved().end() && p != NULL;
1024 }
1025 #endif
1026 
1027 void GenCollectedHeap::oop_iterate(OopIterateClosure* cl) {
1028   _young_gen->oop_iterate(cl);
1029   _old_gen->oop_iterate(cl);
1030 }
1031 
1032 void GenCollectedHeap::object_iterate(ObjectClosure* cl) {
1033   _young_gen->object_iterate(cl);
1034   _old_gen->object_iterate(cl);
1035 }
1036 





1037 Space* GenCollectedHeap::space_containing(const void* addr) const {
1038   Space* res = _young_gen->space_containing(addr);
1039   if (res != NULL) {
1040     return res;
1041   }
1042   res = _old_gen->space_containing(addr);
1043   assert(res != NULL, "Could not find containing space");
1044   return res;
1045 }
1046 
1047 HeapWord* GenCollectedHeap::block_start(const void* addr) const {
1048   assert(is_in_reserved(addr), "block_start of address outside of heap");
1049   if (_young_gen->is_in_reserved(addr)) {
1050     assert(_young_gen->is_in(addr), "addr should be in allocated part of generation");
1051     return _young_gen->block_start(addr);
1052   }
1053 
1054   assert(_old_gen->is_in_reserved(addr), "Some generation should contain the address");
1055   assert(_old_gen->is_in(addr), "addr should be in allocated part of generation");
1056   return _old_gen->block_start(addr);


< prev index next >