3067N/A * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. 2596N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2596N/A * This code is free software; you can redistribute it and/or modify it 2596N/A * under the terms of the GNU General Public License version 2 only, as 2596N/A * published by the Free Software Foundation. 2596N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2596N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2596N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2596N/A * version 2 for more details (a copy is included in the LICENSE file that 2596N/A * You should have received a copy of the GNU General Public License version 2596N/A * 2 along with this work; if not, write to the Free Software Foundation, 2596N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2596N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 4050N/A// Utility routine to set an exclusive range of cards on the given 4050N/A // Set the exclusive bit range [start_idx, end_idx). 4050N/A // Silently clip the end index 4050N/A // For small ranges use a simple loop; otherwise use set_range or 4050N/A // use par_at_put_range (if parallel). The range is made up of the 4050N/A // allow up to object sizes up to 4K to be handled using the loop. 4050N/A // Note BitMap::par_at_put_range() and BitMap::set_range() are exclusive. 3119N/A// Returns the index in the liveness accounting card bitmap 3119N/A // Below, the term "card num" means the result of shifting an address 3119N/A // by the card shift -- address 0 corresponds to card number 0. One 3119N/A // must subtract the card num of the bottom of the heap to obtain a 3119N/A// counting data structures. 3119N/A // Add to the task local marked bytes for this region. 4050N/A // Note: if we're looking at the last region in heap - end 4050N/A // could be actually just beyond the end of the heap; end_idx 4050N/A // will then correspond to a (non-existent) card that is also 4050N/A // end of region is not card aligned - incremement to cover 4050N/A // all the cards spanned by the region. 4050N/A // the 'par' BitMap routines. 4050N/A // Set bits in the exclusive bit range [start_idx, end_idx). 3120N/A// data structures for the given worker id. 3119N/A// Counts the given memory region, which may be a single object, in the 3119N/A// structures for the given worker id. 3119N/A// Attempts to mark the given object and, if successful, counts 3119N/A // Update the task specific count data for the object. 3119N/A// Attempts to mark the given object and, if successful, counts 3120N/A// Attempts to mark the given object and, if successful, counts 3119N/A // Update the task specific count data for the object. 3119N/A// As above - but we don't know the heap region containing the 3119N/A// object and so have to supply it. 3119N/A// Similar to the above routine but we already know the size, in words, of 3119N/A // Update the task specific count data for the object. 3119N/A// Unconditionally mark the given object, and unconditinally count 3119N/A// the object in the counting structures for worker id 0. 3119N/A// Should *not* be called from parallel code. 3119N/A // Update the task specific count data for the object. 3119N/A// As above - but we don't have the heap region containing the 3119N/A// object, so we have to supply it. 3110N/A // Right-open interval [start-offset, end-offset). 2596N/A // The local task queue looks full. We need to push some entries 2596N/A "moving entries to the global stack",
2596N/A // this should succeed since, even if we overflow the global 2596N/A // stack, we should have definitely removed some entries from the 2596N/A // local queue. So, there must be space on it. 2596N/A// This determines whether the method below will check both the local 2596N/A// and global fingers when determining whether to push on the stack a 2596N/A// gray object (value 1) or whether it will only check the global one 2596N/A// (value 0). The tradeoffs are that the former will be a bit more 2596N/A// accurate and possibly push less on the stack, but it might also be 2596N/A // Only get the containing region if the object is not marked on the 2596N/A // bitmap (otherwise, it's a waste of time since we won't do 2596N/A // we need to mark it first 2596N/A // No OrderAccess:store_load() is needed. It is implicit in the 3119N/A // CAS done in CMBitMap::parMark() call in the routine above. 2596N/A // we will check both the local and global fingers 2596N/A // Notice that the global finger might be moving forward 2596N/A // concurrently. This is not a problem. In the worst case, we 2596N/A // mark the object while it is above the global finger and, by 2596N/A // the time we read the global finger, it has moved forward 2596N/A // passed this object. In this case, the object will probably 2596N/A // be visited when a task is scanning the region and will also 2596N/A // be pushed on the stack. So, some duplicate work, but no 2596N/A#
else // _CHECK_BOTH_FINGERS_ 2596N/A // we will only check the global finger 2596N/A#
endif // _CHECK_BOTH_FINGERS_ 3067N/A // Note we are overriding the read-only view of the prev map here, via 3120N/A // Given that we're looking for a region that contains an object 3120N/A // header it's impossible to get back a HC region. 3067N/A // We cannot assert that word_size == obj->size() given that obj 3067N/A // might not be in a consistent state (another thread might be in 3067N/A // the process of copying it). So the best thing we can do is to 3067N/A // assert that word_size is under an upper bound which is its 3067N/A // containing region's capacity. 2596N/A#
endif // SHARE_VM_GC_IMPLEMENTATION_G1_CONCURRENTMARK_INLINE_HPP