88 } 89 global_stats()->update_allocating_threads(); 90 global_stats()->update_number_of_refills(_number_of_refills); 91 global_stats()->update_allocation(_number_of_refills * desired_size()); 92 global_stats()->update_gc_waste(_gc_waste); 93 global_stats()->update_slow_refill_waste(_slow_refill_waste); 94 global_stats()->update_fast_refill_waste(_fast_refill_waste); 95 96 } else { 97 assert(_number_of_refills == 0 && _fast_refill_waste == 0 && 98 _slow_refill_waste == 0 && _gc_waste == 0, 99 "tlab stats == 0"); 100 } 101 global_stats()->update_slow_allocations(_slow_allocations); 102 } 103 104 // Fills the current tlab with a dummy filler array to create 105 // an illusion of a contiguous Eden and optionally retires the tlab. 106 // Waste accounting should be done in caller as appropriate; see, 107 // for example, clear_before_allocation(). 108 void ThreadLocalAllocBuffer::make_parsable(bool retire) { 109 if (end() != NULL) { 110 invariants(); 111 112 if (retire) { 113 myThread()->incr_allocated_bytes(used_bytes()); 114 } 115 116 CollectedHeap::fill_with_object(top(), hard_end(), retire); 117 118 if (retire || ZeroTLAB) { // "Reset" the TLAB 119 set_start(NULL); 120 set_top(NULL); 121 set_pf_top(NULL); 122 set_end(NULL); 123 } 124 } 125 assert(!(retire || ZeroTLAB) || 126 (start() == NULL && end() == NULL && top() == NULL), 127 "TLAB must be reset"); 128 } 129 130 void ThreadLocalAllocBuffer::resize_all_tlabs() { 131 if (ResizeTLAB) { 132 for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) { 133 thread->tlab().resize(); 134 } 135 } 136 } | 88 } 89 global_stats()->update_allocating_threads(); 90 global_stats()->update_number_of_refills(_number_of_refills); 91 global_stats()->update_allocation(_number_of_refills * desired_size()); 92 global_stats()->update_gc_waste(_gc_waste); 93 global_stats()->update_slow_refill_waste(_slow_refill_waste); 94 global_stats()->update_fast_refill_waste(_fast_refill_waste); 95 96 } else { 97 assert(_number_of_refills == 0 && _fast_refill_waste == 0 && 98 _slow_refill_waste == 0 && _gc_waste == 0, 99 "tlab stats == 0"); 100 } 101 global_stats()->update_slow_allocations(_slow_allocations); 102 } 103 104 // Fills the current tlab with a dummy filler array to create 105 // an illusion of a contiguous Eden and optionally retires the tlab. 106 // Waste accounting should be done in caller as appropriate; see, 107 // for example, clear_before_allocation(). 108 void ThreadLocalAllocBuffer::make_parsable(bool retire, bool zap) { 109 if (end() != NULL) { 110 invariants(); 111 112 if (retire) { 113 myThread()->incr_allocated_bytes(used_bytes()); 114 } 115 116 CollectedHeap::fill_with_object(top(), hard_end(), retire && zap); 117 118 if (retire || ZeroTLAB) { // "Reset" the TLAB 119 set_start(NULL); 120 set_top(NULL); 121 set_pf_top(NULL); 122 set_end(NULL); 123 } 124 } 125 assert(!(retire || ZeroTLAB) || 126 (start() == NULL && end() == NULL && top() == NULL), 127 "TLAB must be reset"); 128 } 129 130 void ThreadLocalAllocBuffer::resize_all_tlabs() { 131 if (ResizeTLAB) { 132 for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) { 133 thread->tlab().resize(); 134 } 135 } 136 } |