2362N/A * Copyright (c) 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. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// Closures and tasks associated with any self-forwarding pointers 0N/A// installed as a result of an evacuation failure. 0N/A // <original comment> 0N/A // The original idea here was to coalesce evacuated and dead objects. 0N/A // However that caused complications with the block offset table (BOT). 0N/A // In particular if there were two TLABs, one of them partially refined. 0N/A // |----- TLAB_1--------|----TLAB_2-~~~(partially refined part)~~~| 0N/A // The BOT entries of the unrefined part of TLAB_2 point to the start 0N/A // of TLAB_2. If the last object of the TLAB_1 and the first object 0N/A // of TLAB_2 are coalesced, then the cards of the unrefined part 0N/A // would point into middle of the filler object. 0N/A // The current approach is to not coalesce and leave the BOT contents intact. 0N/A // </original comment> 0N/A // We now reset the BOT when we start the object iteration over the 0N/A // region and refine its entries for every object we come across. So 0N/A // the above comment is not really relevant and we should be able 0N/A // to coalesce dead objects if we want to. 0N/A // The object failed to move. 0N/A // We consider all objects that we find self-forwarded to be 0N/A // live. What we'll do is that we'll update the prev marking 0N/A // info so that they are all under PTAMS and explicitly marked. 0N/A // For the next marking info we'll only mark the 0N/A // self-forwarded objects explicitly if we are during 0N/A // initial-mark (since, normally, we only mark objects pointed 0N/A // to by roots if we succeed in copying them). By marking all 0N/A // self-forwarded objects we ensure that we mark any that are 0N/A // still pointed to be roots. During concurrent marking, and 0N/A // after initial-mark, we don't need to mark any objects 0N/A // explicitly and all objects in the CSet are considered 0N/A // (implicitly) live. So, we won't mark them explicitly and 0N/A // we'll leave them over NTAMS. 0N/A // While we were processing RSet buffers during the collection, 0N/A // we actually didn't scan any cards on the collection set, 0N/A // since we didn't want to update remembered sets with entries 0N/A // that point into the collection set, given that live objects 0N/A // from the collection set are about to move and such entries 0N/A // will be stale very soon. 0N/A // This change also dealt with a reliability issue which 0N/A // involved scanning a card in the collection set and coming 0N/A // across an array that was being chunked and looking malformed. 0N/A // The problem is that, if evacuation fails, we might have 0N/A // remembered set entries missing given that we skipped cards on 0N/A // the collection set. So, we'll recreate such entries now. 0N/A // The object has been either evacuated or is dead. Fill it with a // We'll recreate the prev marking info so we'll first clear // the prev bitmap range for this region. We never mark any // CSet objects explicitly so the next bitmap range should be // In the common case (i.e. when there is no evacuation // failure) we make sure that the following is done when // the region is freed so that it is "ready-to-go" when it's // re-allocated. However, when evacuation failure happens, a // region will remain in the heap and might ultimately be added // to a CSet in the future. So we have to be careful here and // make sure the region's RSet is ready for parallel iteration // whenever this might be required in the future. #
endif // SHARE_VM_GC_IMPLEMENTATION_G1_G1EVACFAILURE_HPP