< prev index next >

src/share/vm/gc/g1/g1AllocRegion.inline.hpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:
   1 /*
   2  * Copyright (c) 2011, 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_G1ALLOCREGION_INLINE_HPP
  26 #define SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCREGION_INLINE_HPP
  27 
  28 #include "gc_implementation/g1/g1AllocRegion.hpp"
  29 #include "gc_implementation/g1/heapRegion.inline.hpp"
  30 
  31 inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
  32                                          size_t word_size,
  33                                          bool bot_updates) {
  34   assert(alloc_region != NULL, err_msg("pre-condition"));
  35 
  36   if (!bot_updates) {
  37     return alloc_region->allocate_no_bot_updates(word_size);
  38   } else {
  39     return alloc_region->allocate(word_size);
  40   }
  41 }
  42 
  43 inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region,
  44                                              size_t word_size,
  45                                              bool bot_updates) {
  46   assert(alloc_region != NULL, err_msg("pre-condition"));
  47   assert(!alloc_region->is_empty(), err_msg("pre-condition"));
  48 
  49   if (!bot_updates) {


  87   }
  88   trace("alloc locked failed", word_size);
  89   return NULL;
  90 }
  91 
  92 inline HeapWord* G1AllocRegion::attempt_allocation_force(size_t word_size,
  93                                                          bool bot_updates) {
  94   assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
  95   assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
  96 
  97   trace("forcing alloc");
  98   HeapWord* result = new_alloc_region_and_allocate(word_size, true /* force */);
  99   if (result != NULL) {
 100     trace("alloc forced", word_size, result);
 101     return result;
 102   }
 103   trace("alloc forced failed", word_size);
 104   return NULL;
 105 }
 106 
 107 #endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1ALLOCREGION_INLINE_HPP
   1 /*
   2  * Copyright (c) 2011, 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_G1ALLOCREGION_INLINE_HPP
  26 #define SHARE_VM_GC_G1_G1ALLOCREGION_INLINE_HPP
  27 
  28 #include "gc/g1/g1AllocRegion.hpp"
  29 #include "gc/g1/heapRegion.inline.hpp"
  30 
  31 inline HeapWord* G1AllocRegion::allocate(HeapRegion* alloc_region,
  32                                          size_t word_size,
  33                                          bool bot_updates) {
  34   assert(alloc_region != NULL, err_msg("pre-condition"));
  35 
  36   if (!bot_updates) {
  37     return alloc_region->allocate_no_bot_updates(word_size);
  38   } else {
  39     return alloc_region->allocate(word_size);
  40   }
  41 }
  42 
  43 inline HeapWord* G1AllocRegion::par_allocate(HeapRegion* alloc_region,
  44                                              size_t word_size,
  45                                              bool bot_updates) {
  46   assert(alloc_region != NULL, err_msg("pre-condition"));
  47   assert(!alloc_region->is_empty(), err_msg("pre-condition"));
  48 
  49   if (!bot_updates) {


  87   }
  88   trace("alloc locked failed", word_size);
  89   return NULL;
  90 }
  91 
  92 inline HeapWord* G1AllocRegion::attempt_allocation_force(size_t word_size,
  93                                                          bool bot_updates) {
  94   assert(bot_updates == _bot_updates, ar_ext_msg(this, "pre-condition"));
  95   assert(_alloc_region != NULL, ar_ext_msg(this, "not initialized properly"));
  96 
  97   trace("forcing alloc");
  98   HeapWord* result = new_alloc_region_and_allocate(word_size, true /* force */);
  99   if (result != NULL) {
 100     trace("alloc forced", word_size, result);
 101     return result;
 102   }
 103   trace("alloc forced failed", word_size);
 104   return NULL;
 105 }
 106 
 107 #endif // SHARE_VM_GC_G1_G1ALLOCREGION_INLINE_HPP
< prev index next >