3198N/A * Copyright (c) 2002, 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 113N/A if (p !=
NULL) {
// XXX: error if p != NULL here 3198N/A// This method is pretty bulky. It would be nice to split it up 3198N/A// into smaller submethods, but we need to be careful not to hurt 3198N/A // NOTE! We must be very careful with any methods that access the mark 3198N/A // in o. There may be multiple threads racing on it, and it may be forwarded 3198N/A // at any time. Do not use oop methods for accessing the mark! 3198N/A // The same test as "o->is_forwarded()" 3198N/A // Find the objects age, MT safe. 3198N/A // Try allocating obj in to-space (unless too old) 3198N/A // Do we allocate directly, or flush and refill? 3198N/A // Allocate this object directly 3198N/A // Try the young lab allocation again. 3198N/A // Otherwise try allocating obj tenured 3198N/A // Do we allocate directly, or flush and refill? 3198N/A // Allocate this object directly 3198N/A // Try the old lab allocation again. 3198N/A // This is the promotion failed test, and code handling. 3198N/A // The code belongs here for two reasons. It is slightly 4141N/A // different than the code below, and cannot share the 3198N/A // CAS testing code. Keeping the code here also minimizes 3198N/A // the impact on the common case fast path code. 3198N/A // Now we have to CAS in the header. 3198N/A // We won any races, we "own" this object. 3198N/A // Increment age if obj still in new generation. Now that 3198N/A // we're dealing with a markOop that cannot change, it is 3198N/A // okay to use the non mt safe oop methods. 3198N/A // Do the size comparison first with new_obj_size, which we 3198N/A // already have. Hopefully, only a few objects are larger than 3198N/A // _min_array_size_for_chunking, and most of them will be arrays. 3198N/A // So, the is->objArray() test would be very infrequent. 3198N/A // we'll just push its contents 3198N/A // We lost, someone else "owns" this object 3198N/A // Try to deallocate the space. If it was directly allocated we cannot 3198N/A // deallocate it, so we have to test. If the deallocation fails, 3198N/A // overwrite with a filler object. 3198N/A // don't update this before the unallocation! 3198N/A // This code must come after the CAS test, or it will print incorrect 1879N/A#
endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONMANAGER_INLINE_HPP