src/share/vm/gc_implementation/concurrentMarkSweep/promotionInfo.cpp
Print this page
rev 6796 : [mq]: templateOopIterate
@@ -32,92 +32,10 @@
/////////////////////////////////////////////////////////////////////////
//// PromotionInfo
/////////////////////////////////////////////////////////////////////////
-
-//////////////////////////////////////////////////////////////////////////////
-// We go over the list of promoted objects, removing each from the list,
-// and applying the closure (this may, in turn, add more elements to
-// the tail of the promoted list, and these newly added objects will
-// also be processed) until the list is empty.
-// To aid verification and debugging, in the non-product builds
-// we actually forward _promoHead each time we process a promoted oop.
-// Note that this is not necessary in general (i.e. when we don't need to
-// call PromotionInfo::verify()) because oop_iterate can only add to the
-// end of _promoTail, and never needs to look at _promoHead.
-
-#define PROMOTED_OOPS_ITERATE_DEFN(OopClosureType, nv_suffix) \
- \
-void PromotionInfo::promoted_oops_iterate##nv_suffix(OopClosureType* cl) { \
- NOT_PRODUCT(verify()); \
- PromotedObject *curObj, *nextObj; \
- for (curObj = _promoHead; curObj != NULL; curObj = nextObj) { \
- if ((nextObj = curObj->next()) == NULL) { \
- /* protect ourselves against additions due to closure application \
- below by resetting the list. */ \
- assert(_promoTail == curObj, "Should have been the tail"); \
- _promoHead = _promoTail = NULL; \
- } \
- if (curObj->hasDisplacedMark()) { \
- /* restore displaced header */ \
- oop(curObj)->set_mark(nextDisplacedHeader()); \
- } else { \
- /* restore prototypical header */ \
- oop(curObj)->init_mark(); \
- } \
- /* The "promoted_mark" should now not be set */ \
- assert(!curObj->hasPromotedMark(), \
- "Should have been cleared by restoring displaced mark-word"); \
- NOT_PRODUCT(_promoHead = nextObj); \
- if (cl != NULL) oop(curObj)->oop_iterate(cl); \
- if (nextObj == NULL) { /* start at head of list reset above */ \
- nextObj = _promoHead; \
- } \
- } \
- assert(noPromotions(), "post-condition violation"); \
- assert(_promoHead == NULL && _promoTail == NULL, "emptied promoted list");\
- assert(_spoolHead == _spoolTail, "emptied spooling buffers"); \
- assert(_firstIndex == _nextIndex, "empty buffer"); \
-}
-
-// This should have been ALL_SINCE_...() just like the others,
-// but, because the body of the method above is somehwat longer,
-// the MSVC compiler cannot cope; as a workaround, we split the
-// macro into its 3 constituent parts below (see original macro
-// definition in specializedOopClosures.hpp).
-SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(PROMOTED_OOPS_ITERATE_DEFN)
-PROMOTED_OOPS_ITERATE_DEFN(OopsInGenClosure,_v)
-
-
-// Return the next displaced header, incrementing the pointer and
-// recycling spool area as necessary.
-markOop PromotionInfo::nextDisplacedHeader() {
- assert(_spoolHead != NULL, "promotionInfo inconsistency");
- assert(_spoolHead != _spoolTail || _firstIndex < _nextIndex,
- "Empty spool space: no displaced header can be fetched");
- assert(_spoolHead->bufferSize > _firstIndex, "Off by one error at head?");
- markOop hdr = _spoolHead->displacedHdr[_firstIndex];
- // Spool forward
- if (++_firstIndex == _spoolHead->bufferSize) { // last location in this block
- // forward to next block, recycling this block into spare spool buffer
- SpoolBlock* tmp = _spoolHead->nextSpoolBlock;
- assert(_spoolHead != _spoolTail, "Spooling storage mix-up");
- _spoolHead->nextSpoolBlock = _spareSpool;
- _spareSpool = _spoolHead;
- _spoolHead = tmp;
- _firstIndex = 1;
- NOT_PRODUCT(
- if (_spoolHead == NULL) { // all buffers fully consumed
- assert(_spoolTail == NULL && _nextIndex == 1,
- "spool buffers processing inconsistency");
- }
- )
- }
- return hdr;
-}
-
void PromotionInfo::track(PromotedObject* trackOop) {
track(trackOop, oop(trackOop)->klass());
}
void PromotionInfo::track(PromotedObject* trackOop, Klass* klassOfOop) {