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

Print this page


   1 /*
   2  * Copyright (c) 2001, 2009, 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 #include "incls/_precompiled.incl"
  26 #include "incls/_vm_operations_g1.cpp.incl"




  27 
  28 void VM_G1CollectForAllocation::doit() {
  29   JvmtiGCForAllocationMarker jgcm;
  30   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  31   _res = g1h->satisfy_failed_allocation(_size);
  32   assert(g1h->is_in_or_null(_res), "result not in heap");
  33 }
  34 
  35 void VM_G1CollectFull::doit() {
  36   JvmtiGCFullMarker jgcm;
  37   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  38   GCCauseSetter x(g1h, _gc_cause);
  39   g1h->do_full_collection(false /* clear_all_soft_refs */);
  40 }
  41 
  42 void VM_G1IncCollectionPause::doit() {
  43   JvmtiGCForAllocationMarker jgcm;
  44   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  45   assert(!_should_initiate_conc_mark ||
  46   ((_gc_cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||


   1 /*
   2  * Copyright (c) 2001, 2010, 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 #include "precompiled.hpp"
  26 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  27 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  28 #include "gc_implementation/g1/vm_operations_g1.hpp"
  29 #include "gc_implementation/shared/isGCActiveMark.hpp"
  30 #include "runtime/interfaceSupport.hpp"
  31 
  32 void VM_G1CollectForAllocation::doit() {
  33   JvmtiGCForAllocationMarker jgcm;
  34   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  35   _res = g1h->satisfy_failed_allocation(_size);
  36   assert(g1h->is_in_or_null(_res), "result not in heap");
  37 }
  38 
  39 void VM_G1CollectFull::doit() {
  40   JvmtiGCFullMarker jgcm;
  41   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  42   GCCauseSetter x(g1h, _gc_cause);
  43   g1h->do_full_collection(false /* clear_all_soft_refs */);
  44 }
  45 
  46 void VM_G1IncCollectionPause::doit() {
  47   JvmtiGCForAllocationMarker jgcm;
  48   G1CollectedHeap* g1h = G1CollectedHeap::heap();
  49   assert(!_should_initiate_conc_mark ||
  50   ((_gc_cause == GCCause::_gc_locker && GCLockerInvokesConcurrent) ||