defNewGeneration.hpp revision 3863
3679N/A * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// DefNewGeneration is a young generation containing eden, from- and 0N/A // Size of object to pretenure in words; command line provides bytes 0N/A // Initialize state to optimistically assume no promotion failure will 0N/A // True iff a promotion has failed in the current collection. 0N/A // Handling promotion failure. A young generation collection 0N/A // can fail if a live object cannot be copied out of its 0N/A // location in eden or from-space during the collection. If 0N/A // a collection fails, the young generation is left in a 0N/A // consistent state such that it can be collected by a 0N/A // Before the collection 0N/A // Objects are in eden or from-space 0N/A // All roots into the young generation point into eden or from-space. 0N/A // After a failed collection 0N/A // Objects may be in eden, from-space, or to-space 0N/A // An object A in eden or from-space may have a copy B 0N/A // in to-space. If B exists, all roots that once pointed 0N/A // to A must now point to B. 0N/A // All objects in the young generation are unmarked. 0N/A // Eden, from-space, and to-space will all be collected by 0N/A // the full collection. 0N/A // In the absence of promotion failure, we wouldn't look at "from-space" 0N/A // objects after a young-gen collection. When promotion fails, however, 0N/A // the subsequent full collection will look at from-space objects: 0N/A // therefore we must remove their forwarding pointers. 0N/A // Preserve the mark of "obj", if necessary, in preparation for its mark 0N/A // word being overwritten with a self-forwarding-pointer. 1756N/A // Together, these keep <object with a preserved mark, mark value> pairs. 1756N/A // They should always contain the same number of elements. 0N/A // Promotion failure handling 0N/A // Performance Counters 0N/A // sizing information 0N/A // Allocation support 0N/A // Generations are GenGrain-aligned and have size that are multiples of 0N/A // Return the size of a survivor space if this generation were of size 0N/A public:
// was "protected" but caused compile error on win32 0N/A // Thread-local allocation buffers 0N/A // Grow the generation by the specified number of bytes. 0N/A // The size of bytes is assumed to be properly aligned. 0N/A // Return true if the expansion was successful. 0N/A // DefNewGeneration cannot currently expand except at 0N/A // Allocation support 0N/A // Prologue & Epilogue 263N/A // Save the tops for eden, from, and to 0N/A // Doesn't require additional work during GC prologue and epilogue 0N/A // Need to declare the full complement of closures, whether we'll 0N/A // override them or not, or get message from the compiler: 0N/A // oop_since_save_marks_iterate_nv hides virtual function... 0N/A // For non-youngest collection, the DefNewGeneration can contribute 263N/A // Reset for contribution of "to-space". 1808N/A // Returns true if the collection is likely to be safely 1808N/A // completed. Even if this method returns true, a collection 1808N/A // may not be guaranteed to succeed, and the system should be 1808N/A // able to safely unwind and recover from that failure, albeit 1808N/A // at some additional cost. Override superclass's implementation. 0N/A // Performance Counter support 0N/A // PrintHeapAtGC support. 263N/A // If clear_space is true, clear the survivor spaces. Eden is 263N/A // cleared if the minimum size of eden is 0. If mangle_space 263N/A // is true, also mangle the space in debug mode. 1879N/A#
endif // SHARE_VM_MEMORY_DEFNEWGENERATION_HPP