< prev index next >

src/share/vm/gc/g1/ptrQueue.hpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:
   1 /*
   2  * Copyright (c) 2001, 2014, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/sizes.hpp"
  30 
  31 // There are various techniques that require threads to be able to log
  32 // addresses.  For example, a generational write barrier might log
  33 // the addresses of modified old-generation objects.  This type supports
  34 // this operation.
  35 
  36 // The definition of placement operator new(size_t, void*) in the <new>.
  37 #include <new>
  38 
  39 class PtrQueueSet;
  40 class PtrQueue VALUE_OBJ_CLASS_SPEC {
  41   friend class VMStructs;
  42 
  43 protected:
  44   // The ptr queue set to which this queue belongs.
  45   PtrQueueSet* _qset;
  46 


 299   int process_completed_threshold() const { return _process_completed_threshold; }
 300 
 301   // Must only be called at a safe point.  Indicates that the buffer free
 302   // list size may be reduced, if that is deemed desirable.
 303   void reduce_free_list();
 304 
 305   int completed_buffers_num() { return _n_completed_buffers; }
 306 
 307   void merge_bufferlists(PtrQueueSet* src);
 308 
 309   void set_max_completed_queue(int m) { _max_completed_queue = m; }
 310   int max_completed_queue() { return _max_completed_queue; }
 311 
 312   void set_completed_queue_padding(int padding) { _completed_queue_padding = padding; }
 313   int completed_queue_padding() { return _completed_queue_padding; }
 314 
 315   // Notify the consumer if the number of buffers crossed the threshold
 316   void notify_if_necessary();
 317 };
 318 
 319 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_PTRQUEUE_HPP
   1 /*
   2  * Copyright (c) 2001, 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  *
  23  */
  24 
  25 #ifndef SHARE_VM_GC_G1_PTRQUEUE_HPP
  26 #define SHARE_VM_GC_G1_PTRQUEUE_HPP
  27 
  28 #include "memory/allocation.hpp"
  29 #include "utilities/sizes.hpp"
  30 
  31 // There are various techniques that require threads to be able to log
  32 // addresses.  For example, a generational write barrier might log
  33 // the addresses of modified old-generation objects.  This type supports
  34 // this operation.
  35 
  36 // The definition of placement operator new(size_t, void*) in the <new>.
  37 #include <new>
  38 
  39 class PtrQueueSet;
  40 class PtrQueue VALUE_OBJ_CLASS_SPEC {
  41   friend class VMStructs;
  42 
  43 protected:
  44   // The ptr queue set to which this queue belongs.
  45   PtrQueueSet* _qset;
  46 


 299   int process_completed_threshold() const { return _process_completed_threshold; }
 300 
 301   // Must only be called at a safe point.  Indicates that the buffer free
 302   // list size may be reduced, if that is deemed desirable.
 303   void reduce_free_list();
 304 
 305   int completed_buffers_num() { return _n_completed_buffers; }
 306 
 307   void merge_bufferlists(PtrQueueSet* src);
 308 
 309   void set_max_completed_queue(int m) { _max_completed_queue = m; }
 310   int max_completed_queue() { return _max_completed_queue; }
 311 
 312   void set_completed_queue_padding(int padding) { _completed_queue_padding = padding; }
 313   int completed_queue_padding() { return _completed_queue_padding; }
 314 
 315   // Notify the consumer if the number of buffers crossed the threshold
 316   void notify_if_necessary();
 317 };
 318 
 319 #endif // SHARE_VM_GC_G1_PTRQUEUE_HPP
< prev index next >