< prev index next >

src/hotspot/share/gc/parallel/psPromotionLAB.cpp

Print this page

 66   }
 67 
 68   assert(this->top() <= this->end(), "pointers out of order");
 69 }
 70 
 71 // Fill all remaining lab space with an unreachable object.
 72 // The goal is to leave a contiguous parseable span of objects.
 73 void PSPromotionLAB::flush() {
 74   assert(_state != flushed, "Attempt to flush PLAB twice");
 75   assert(top() <= end(), "pointers out of order");
 76 
 77   // If we were initialized to a zero sized lab, there is
 78   // nothing to flush
 79   if (_state == zero_size)
 80     return;
 81 
 82   // PLAB's never allocate the last aligned_header_size
 83   // so they can always fill with an array.
 84   HeapWord* tlab_end = end() + filler_header_size;
 85   typeArrayOop filler_oop = (typeArrayOop) cast_to_oop(top());
 86   filler_oop->set_mark(markWord::prototype());
 87   filler_oop->set_klass(Universe::intArrayKlassObj());
 88   const size_t array_length =
 89     pointer_delta(tlab_end, top()) - typeArrayOopDesc::header_size(T_INT);
 90   assert( (array_length * (HeapWordSize/sizeof(jint))) < (size_t)max_jint, "array too big in PSPromotionLAB");
 91   filler_oop->set_length((int)(array_length * (HeapWordSize/sizeof(jint))));
 92 
 93 #ifdef ASSERT
 94   // Note that we actually DO NOT want to use the aligned header size!
 95   HeapWord* elt_words = cast_from_oop<HeapWord*>(filler_oop) + typeArrayOopDesc::header_size(T_INT);
 96   Copy::fill_to_words(elt_words, array_length, 0xDEAABABE);
 97 #endif
 98 
 99   set_bottom(NULL);
100   set_end(NULL);
101   set_top(NULL);
102 
103   _state = flushed;
104 }
105 
106 bool PSPromotionLAB::unallocate_object(HeapWord* obj, size_t obj_size) {

 66   }
 67 
 68   assert(this->top() <= this->end(), "pointers out of order");
 69 }
 70 
 71 // Fill all remaining lab space with an unreachable object.
 72 // The goal is to leave a contiguous parseable span of objects.
 73 void PSPromotionLAB::flush() {
 74   assert(_state != flushed, "Attempt to flush PLAB twice");
 75   assert(top() <= end(), "pointers out of order");
 76 
 77   // If we were initialized to a zero sized lab, there is
 78   // nothing to flush
 79   if (_state == zero_size)
 80     return;
 81 
 82   // PLAB's never allocate the last aligned_header_size
 83   // so they can always fill with an array.
 84   HeapWord* tlab_end = end() + filler_header_size;
 85   typeArrayOop filler_oop = (typeArrayOop) cast_to_oop(top());
 86   filler_oop->set_mark(Universe::intArrayKlassObj()->prototype_header());
 87   filler_oop->set_klass(Universe::intArrayKlassObj());
 88   const size_t array_length =
 89     pointer_delta(tlab_end, top()) - typeArrayOopDesc::header_size(T_INT);
 90   assert( (array_length * (HeapWordSize/sizeof(jint))) < (size_t)max_jint, "array too big in PSPromotionLAB");
 91   filler_oop->set_length((int)(array_length * (HeapWordSize/sizeof(jint))));
 92 
 93 #ifdef ASSERT
 94   // Note that we actually DO NOT want to use the aligned header size!
 95   HeapWord* elt_words = cast_from_oop<HeapWord*>(filler_oop) + typeArrayOopDesc::header_size(T_INT);
 96   Copy::fill_to_words(elt_words, array_length, 0xDEAABABE);
 97 #endif
 98 
 99   set_bottom(NULL);
100   set_end(NULL);
101   set_top(NULL);
102 
103   _state = flushed;
104 }
105 
106 bool PSPromotionLAB::unallocate_object(HeapWord* obj, size_t obj_size) {
< prev index next >