< prev index next >

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

Print this page
rev 49945 : imported patch 8191471-g1-varying-tlab-allocation
rev 49949 : imported patch 8191471-tschatzl-comments-open
rev 49950 : [mq]: 8191471-pliden-comments


1129   }
1130   return 0;
1131 }
1132 
1133 size_t GenCollectedHeap::tlab_used(Thread* thr) const {
1134   assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
1135   if (_young_gen->supports_tlab_allocation()) {
1136     return _young_gen->tlab_used();
1137   }
1138   return 0;
1139 }
1140 
1141 size_t GenCollectedHeap::unsafe_max_tlab_alloc(Thread* thr) const {
1142   assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
1143   if (_young_gen->supports_tlab_allocation()) {
1144     return _young_gen->unsafe_max_tlab_alloc();
1145   }
1146   return 0;
1147 }
1148 
1149 HeapWord* GenCollectedHeap::allocate_new_tlab(size_t size) {


1150   bool gc_overhead_limit_was_exceeded;
1151   return mem_allocate_work(size /* size */,
1152                            true /* is_tlab */,
1153                            &gc_overhead_limit_was_exceeded);





1154 }
1155 
1156 // Requires "*prev_ptr" to be non-NULL.  Deletes and a block of minimal size
1157 // from the list headed by "*prev_ptr".
1158 static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
1159   bool first = true;
1160   size_t min_size = 0;   // "first" makes this conceptually infinite.
1161   ScratchBlock **smallest_ptr, *smallest;
1162   ScratchBlock  *cur = *prev_ptr;
1163   while (cur) {
1164     assert(*prev_ptr == cur, "just checking");
1165     if (first || cur->num_words < min_size) {
1166       smallest_ptr = prev_ptr;
1167       smallest     = cur;
1168       min_size     = smallest->num_words;
1169       first        = false;
1170     }
1171     prev_ptr = &cur->next;
1172     cur     =  cur->next;
1173   }




1129   }
1130   return 0;
1131 }
1132 
1133 size_t GenCollectedHeap::tlab_used(Thread* thr) const {
1134   assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
1135   if (_young_gen->supports_tlab_allocation()) {
1136     return _young_gen->tlab_used();
1137   }
1138   return 0;
1139 }
1140 
1141 size_t GenCollectedHeap::unsafe_max_tlab_alloc(Thread* thr) const {
1142   assert(!_old_gen->supports_tlab_allocation(), "Old gen supports TLAB allocation?!");
1143   if (_young_gen->supports_tlab_allocation()) {
1144     return _young_gen->unsafe_max_tlab_alloc();
1145   }
1146   return 0;
1147 }
1148 
1149 HeapWord* GenCollectedHeap::allocate_new_tlab(size_t min_size,
1150                                               size_t requested_size,
1151                                               size_t* actual_size) {
1152   bool gc_overhead_limit_was_exceeded;
1153   HeapWord* result = mem_allocate_work(requested_size /* size */,
1154                                        true /* is_tlab */,
1155                                        &gc_overhead_limit_was_exceeded);
1156   if (result != NULL) {
1157     *actual_size = requested_size;
1158   }
1159 
1160   return result;
1161 }
1162 
1163 // Requires "*prev_ptr" to be non-NULL.  Deletes and a block of minimal size
1164 // from the list headed by "*prev_ptr".
1165 static ScratchBlock *removeSmallestScratch(ScratchBlock **prev_ptr) {
1166   bool first = true;
1167   size_t min_size = 0;   // "first" makes this conceptually infinite.
1168   ScratchBlock **smallest_ptr, *smallest;
1169   ScratchBlock  *cur = *prev_ptr;
1170   while (cur) {
1171     assert(*prev_ptr == cur, "just checking");
1172     if (first || cur->num_words < min_size) {
1173       smallest_ptr = prev_ptr;
1174       smallest     = cur;
1175       min_size     = smallest->num_words;
1176       first        = false;
1177     }
1178     prev_ptr = &cur->next;
1179     cur     =  cur->next;
1180   }


< prev index next >