/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/parallelScavenge/psScavenge.hpp"
return _manager_array[index];
}
template <class T>
if (p != NULL) { // XXX: error if p != NULL here
if (o->is_forwarded()) {
o = o->forwardee();
// Card mark
}
} else {
push_depth(p);
}
}
}
template <class T>
"Sanity");
}
//
// This method is pretty bulky. It would be nice to split it up
// into smaller submethods, but we need to be careful not to hurt
// performance.
//
template<bool promote_immediately>
// NOTE! We must be very careful with any methods that access the mark
// in o. There may be multiple threads racing on it, and it may be forwarded
// at any time. Do not use oop methods for accessing the mark!
// The same test as "o->is_forwarded()"
bool new_obj_is_tenured = false;
if (!promote_immediately) {
// Find the objects age, MT safe.
// Try allocating obj in to-space (unless too old)
// Do we allocate directly, or flush and refill?
// Allocate this object directly
} else {
// Flush and fill
_young_lab.flush();
// Try the young lab allocation again.
} else {
_young_gen_is_full = true;
}
}
}
}
}
// Otherwise try allocating obj tenured
#ifndef PRODUCT
return oop_promotion_failed(o, test_mark);
}
#endif // #ifndef PRODUCT
new_obj_is_tenured = true;
if (!_old_gen_is_full) {
// Do we allocate directly, or flush and refill?
// Allocate this object directly
} else {
// Flush and fill
// Try the old lab allocation again.
}
}
}
// This is the promotion failed test, and code handling.
// The code belongs here for two reasons. It is slightly
// different than the code below, and cannot share the
// CAS testing code. Keeping the code here also minimizes
// the impact on the common case fast path code.
_old_gen_is_full = true;
return oop_promotion_failed(o, test_mark);
}
}
}
// Copy obj
// Now we have to CAS in the header.
// We won any races, we "own" this object.
// Increment age if obj still in new generation. Now that
// we're dealing with a markOop that cannot change, it is
// okay to use the non mt safe oop methods.
if (!new_obj_is_tenured) {
}
// Do the size comparison first with new_obj_size, which we
// already have. Hopefully, only a few objects are larger than
// _min_array_size_for_chunking, and most of them will be arrays.
// So, the is->objArray() test would be very infrequent.
if (new_obj_size > _min_array_size_for_chunking &&
new_obj->is_objArray() &&
// we'll chunk it
} else {
// we'll just push its contents
new_obj->push_contents(this);
}
} else {
// We lost, someone else "owns" this object
// Try to deallocate the space. If it was directly allocated we cannot
// deallocate it, so we have to test. If the deallocation fails,
// overwrite with a filler object.
if (new_obj_is_tenured) {
}
}
// don't update this before the unallocation!
}
} else {
}
#ifdef DEBUG
// This code must come after the CAS test, or it will print incorrect
// information.
if (TraceScavenge) {
}
#endif
return new_obj;
}
if (is_oop_masked(p)) {
} else {
if (p.is_narrow()) {
} else {
}
}
}
#if TASKQUEUE_STATS
if (is_oop_masked(p)) {
}
}
#endif // TASKQUEUE_STATS
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP