< prev index next >

src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp

Print this page


   1 /*
   2  * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 146 
 147   // Initialization at startup
 148   static void startup_initialization();
 149 
 150   // Make an in-use tlab parsable, optionally retiring and/or zapping it.
 151   void make_parsable(bool retire, bool zap = true);
 152 
 153   // Retire in-use tlab before allocation of a new tlab
 154   void clear_before_allocation();
 155 
 156   // Accumulate statistics across all tlabs before gc
 157   static void accumulate_statistics_before_gc();
 158 
 159   // Resize tlabs for all threads
 160   static void resize_all_tlabs();
 161 
 162   void fill(HeapWord* start, HeapWord* top, size_t new_size);
 163   void initialize();
 164 
 165   static size_t refill_waste_limit_increment()   { return TLABWasteIncrement; }







 166 
 167   // Code generation support
 168   static ByteSize start_offset()                 { return byte_offset_of(ThreadLocalAllocBuffer, _start); }
 169   static ByteSize end_offset()                   { return byte_offset_of(ThreadLocalAllocBuffer, _end  ); }
 170   static ByteSize top_offset()                   { return byte_offset_of(ThreadLocalAllocBuffer, _top  ); }
 171   static ByteSize pf_top_offset()                { return byte_offset_of(ThreadLocalAllocBuffer, _pf_top  ); }
 172   static ByteSize size_offset()                  { return byte_offset_of(ThreadLocalAllocBuffer, _desired_size ); }
 173   static ByteSize refill_waste_limit_offset()    { return byte_offset_of(ThreadLocalAllocBuffer, _refill_waste_limit ); }
 174 
 175   static ByteSize number_of_refills_offset()     { return byte_offset_of(ThreadLocalAllocBuffer, _number_of_refills ); }
 176   static ByteSize fast_refill_waste_offset()     { return byte_offset_of(ThreadLocalAllocBuffer, _fast_refill_waste ); }
 177   static ByteSize slow_allocations_offset()      { return byte_offset_of(ThreadLocalAllocBuffer, _slow_allocations ); }
 178 
 179   void verify();
 180 };
 181 
 182 class GlobalTLABStats: public CHeapObj<mtThread> {
 183 private:
 184 
 185   // Accumulate perfdata in private variables because


   1 /*
   2  * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 146 
 147   // Initialization at startup
 148   static void startup_initialization();
 149 
 150   // Make an in-use tlab parsable, optionally retiring and/or zapping it.
 151   void make_parsable(bool retire, bool zap = true);
 152 
 153   // Retire in-use tlab before allocation of a new tlab
 154   void clear_before_allocation();
 155 
 156   // Accumulate statistics across all tlabs before gc
 157   static void accumulate_statistics_before_gc();
 158 
 159   // Resize tlabs for all threads
 160   static void resize_all_tlabs();
 161 
 162   void fill(HeapWord* start, HeapWord* top, size_t new_size);
 163   void initialize();
 164 
 165   static size_t refill_waste_limit_increment()   { return TLABWasteIncrement; }
 166 
 167   template <typename T> void addresses_do(T f) {
 168     f(&_start);
 169     f(&_top);
 170     f(&_pf_top);
 171     f(&_end);
 172   }
 173 
 174   // Code generation support
 175   static ByteSize start_offset()                 { return byte_offset_of(ThreadLocalAllocBuffer, _start); }
 176   static ByteSize end_offset()                   { return byte_offset_of(ThreadLocalAllocBuffer, _end  ); }
 177   static ByteSize top_offset()                   { return byte_offset_of(ThreadLocalAllocBuffer, _top  ); }
 178   static ByteSize pf_top_offset()                { return byte_offset_of(ThreadLocalAllocBuffer, _pf_top  ); }
 179   static ByteSize size_offset()                  { return byte_offset_of(ThreadLocalAllocBuffer, _desired_size ); }
 180   static ByteSize refill_waste_limit_offset()    { return byte_offset_of(ThreadLocalAllocBuffer, _refill_waste_limit ); }
 181 
 182   static ByteSize number_of_refills_offset()     { return byte_offset_of(ThreadLocalAllocBuffer, _number_of_refills ); }
 183   static ByteSize fast_refill_waste_offset()     { return byte_offset_of(ThreadLocalAllocBuffer, _fast_refill_waste ); }
 184   static ByteSize slow_allocations_offset()      { return byte_offset_of(ThreadLocalAllocBuffer, _slow_allocations ); }
 185 
 186   void verify();
 187 };
 188 
 189 class GlobalTLABStats: public CHeapObj<mtThread> {
 190 private:
 191 
 192   // Accumulate perfdata in private variables because


< prev index next >