< prev index next >

src/share/vm/gc/g1/vm_operations_g1.cpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


   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 #include "precompiled.hpp"
  26 #include "gc_implementation/g1/concurrentMarkThread.inline.hpp"
  27 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  29 #include "gc_implementation/g1/g1Log.hpp"
  30 #include "gc_implementation/g1/vm_operations_g1.hpp"
  31 #include "gc_implementation/shared/gcTimer.hpp"
  32 #include "gc_implementation/shared/gcTraceTime.hpp"
  33 #include "gc_implementation/shared/isGCActiveMark.hpp"
  34 #include "gc_implementation/g1/vm_operations_g1.hpp"
  35 #include "runtime/interfaceSupport.hpp"
  36 
  37 VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
  38                                                      size_t word_size)
  39   : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
  40                                    GCCause::_allocation_failure) {
  41   guarantee(word_size != 0, "An allocation should always be requested with this operation.");
  42 }
  43 
  44 void VM_G1CollectForAllocation::doit() {
  45   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  46   GCCauseSetter x(g1h, _gc_cause);
  47 
  48   _result = g1h->satisfy_failed_allocation(_word_size, allocation_context(), &_pause_succeeded);
  49   assert(_result == NULL || _pause_succeeded,
  50          "if we get back a result, the pause should have succeeded");
  51 }
  52 
  53 void VM_G1CollectFull::doit() {
  54   G1CollectedHeap* g1h = G1CollectedHeap::heap();




   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 #include "precompiled.hpp"
  26 #include "gc/g1/concurrentMarkThread.inline.hpp"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/g1CollectorPolicy.hpp"
  29 #include "gc/g1/g1Log.hpp"
  30 #include "gc/g1/vm_operations_g1.hpp"
  31 #include "gc/shared/gcTimer.hpp"
  32 #include "gc/shared/gcTraceTime.hpp"
  33 #include "gc/shared/isGCActiveMark.hpp"

  34 #include "runtime/interfaceSupport.hpp"
  35 
  36 VM_G1CollectForAllocation::VM_G1CollectForAllocation(uint gc_count_before,
  37                                                      size_t word_size)
  38   : VM_G1OperationWithAllocRequest(gc_count_before, word_size,
  39                                    GCCause::_allocation_failure) {
  40   guarantee(word_size != 0, "An allocation should always be requested with this operation.");
  41 }
  42 
  43 void VM_G1CollectForAllocation::doit() {
  44   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  45   GCCauseSetter x(g1h, _gc_cause);
  46 
  47   _result = g1h->satisfy_failed_allocation(_word_size, allocation_context(), &_pause_succeeded);
  48   assert(_result == NULL || _pause_succeeded,
  49          "if we get back a result, the pause should have succeeded");
  50 }
  51 
  52 void VM_G1CollectFull::doit() {
  53   G1CollectedHeap* g1h = G1CollectedHeap::heap();


< prev index next >