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 // The following class hierarchy represents 26 // a set of operations (VM_Operation) related to GC. 27 // 28 // VM_Operation 29 // VM_GC_Operation 30 // VM_GC_HeapInspection 31 // VM_GenCollectForAllocation 32 // VM_GenCollectFull 33 // VM_GenCollectFullConcurrent 34 // VM_ParallelGCFailedAllocation 35 // VM_ParallelGCFailedPermanentAllocation 36 // VM_ParallelGCSystemGC 37 // VM_GC_Operation 38 // - implements methods common to all classes in the hierarchy: 39 // prevents multiple gc requests and manages lock on heap; 40 // 41 // VM_GC_HeapInspection 42 // - prints class histogram on SIGBREAK if PrintClassHistogram 43 // is specified; and also the attach "inspectheap" operation 44 // 182 183 class VM_GenCollectForPermanentAllocation: public VM_GC_Operation { 184 private: 185 HeapWord* _res; 186 size_t _size; // size of object to be allocated 187 public: 188 VM_GenCollectForPermanentAllocation(size_t size, 189 unsigned int gc_count_before, 190 unsigned int full_gc_count_before, 191 GCCause::Cause gc_cause) 192 : VM_GC_Operation(gc_count_before, full_gc_count_before, true), 193 _size(size) { 194 _res = NULL; 195 _gc_cause = gc_cause; 196 } 197 ~VM_GenCollectForPermanentAllocation() {} 198 virtual VMOp_Type type() const { return VMOp_GenCollectForPermanentAllocation; } 199 virtual void doit(); 200 HeapWord* result() const { return _res; } 201 }; | 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_SHARED_VMGCOPERATIONS_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP 27 28 #include "memory/heapInspection.hpp" 29 #include "runtime/handles.hpp" 30 #include "runtime/jniHandles.hpp" 31 #include "runtime/synchronizer.hpp" 32 #include "runtime/vm_operations.hpp" 33 34 // The following class hierarchy represents 35 // a set of operations (VM_Operation) related to GC. 36 // 37 // VM_Operation 38 // VM_GC_Operation 39 // VM_GC_HeapInspection 40 // VM_GenCollectForAllocation 41 // VM_GenCollectFull 42 // VM_GenCollectFullConcurrent 43 // VM_ParallelGCFailedAllocation 44 // VM_ParallelGCFailedPermanentAllocation 45 // VM_ParallelGCSystemGC 46 // VM_GC_Operation 47 // - implements methods common to all classes in the hierarchy: 48 // prevents multiple gc requests and manages lock on heap; 49 // 50 // VM_GC_HeapInspection 51 // - prints class histogram on SIGBREAK if PrintClassHistogram 52 // is specified; and also the attach "inspectheap" operation 53 // 191 192 class VM_GenCollectForPermanentAllocation: public VM_GC_Operation { 193 private: 194 HeapWord* _res; 195 size_t _size; // size of object to be allocated 196 public: 197 VM_GenCollectForPermanentAllocation(size_t size, 198 unsigned int gc_count_before, 199 unsigned int full_gc_count_before, 200 GCCause::Cause gc_cause) 201 : VM_GC_Operation(gc_count_before, full_gc_count_before, true), 202 _size(size) { 203 _res = NULL; 204 _gc_cause = gc_cause; 205 } 206 ~VM_GenCollectForPermanentAllocation() {} 207 virtual VMOp_Type type() const { return VMOp_GenCollectForPermanentAllocation; } 208 virtual void doit(); 209 HeapWord* result() const { return _res; } 210 }; 211 212 #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_VMGCOPERATIONS_HPP |