g1RemSet.hpp revision 626
342N/A * Copyright 2001-2007 Sun Microsystems, Inc. All Rights Reserved. 342N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 342N/A * This code is free software; you can redistribute it and/or modify it 342N/A * under the terms of the GNU General Public License version 2 only, as 342N/A * published by the Free Software Foundation. 342N/A * This code is distributed in the hope that it will be useful, but WITHOUT 342N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 342N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 342N/A * version 2 for more details (a copy is included in the LICENSE file that 342N/A * accompanied this code). 342N/A * You should have received a copy of the GNU General Public License version 342N/A * 2 along with this work; if not, write to the Free Software Foundation, 342N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 342N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 342N/A * CA 95054 USA or visit www.sun.com if you need additional information or 342N/A// A G1RemSet provides ways of iterating over pointers into a selected 342N/A // Invoke "blk->do_oop" on all pointers into the CS in object in regions 342N/A // outside the CS (having invoked "blk->set_region" to set the "from" 342N/A // region correctly beforehand.) The "worker_i" param is for the 342N/A // parallel case where the number of the worker thread calling this 342N/A // function can be helpful in partitioning the work to be done. It 342N/A // should be the same as the "i" passed to the calling thread's 342N/A // work(i) function. In the sequential case this param will be ingored. 342N/A // Prepare for and cleanup after an oops_into_collection_set_do 342N/A // call. Must call each of these once before and after (in sequential 342N/A // code) any threads call oops into collection set do. (This offers an 342N/A // opportunity to sequential setup and teardown of structures needed by a 342N/A // parallel iteration over the CS's RS.) 342N/A // If "this" is of the given subtype, return "this", else "NULL". 342N/A // Record, if necessary, the fact that *p (where "p" is in region "from") 342N/A // has changed to its new value. 342N/A // Requires "region_bm" and "card_bm" to be bitmaps with 1 bit per region 342N/A // or card, respectively, such that a region or card with a corresponding 342N/A // 0 bit contains no part of any live object. Eliminates any remembered 342N/A // set entries that correspond to dead heap ranges. 342N/A // Like the above, but assumes is called in parallel: "worker_num" is the 342N/A // parallel thread id of the current thread, and "claim_val" is the 342N/A // value that should be used to claim heap regions. 342N/A // Do any "refinement" activity that might be appropriate to the given 342N/A // G1RemSet. If "refinement" has iterateive "passes", do one pass. 342N/A // If "t" is non-NULL, it is the thread performing the refinement. 342N/A // Default implementation does nothing. 342N/A // Refine the card corresponding to "card_ptr". If "sts" is non-NULL, 342N/A // join and leave around parts that must be atomic wrt GC. (NULL means 342N/A // being done at a safepoint.) 342N/A // Print any relevant summary info. 342N/A // Prepare remebered set for verification. 342N/A// The simplest possible G1RemSet: iterates over all objects in non-CS 342N/A// regions, searching for pointers into the CS. 342N/A // Nothing is necessary in the version below. 342N/A// A G1RemSet in which each heap region has a rem set that records the 342N/A// external heap references into it. Uses a mod ref bs to track updates, 342N/A// so that they can be used to update the individual region remsets. 342N/A // _par_traversal_in_progress is "true" iff a parallel traversal is in 342N/A // progress. If so, then cards added to remembered sets should also have 342N/A // their references into the collection summarized in "_new_refs". 342N/A // This is called to reset dual hash tables after the gc pause 342N/A // is finished and the initial hash table is no longer being 342N/A // Record, if necessary, the fact that *p (where "p" is in region "from", 342N/A // which is required to be non-NULL) has changed to a new non-NULL value. 342N/A // The "_nv" version is the same; it exists just so that it is not virtual. 626N/A // Override: this closure is idempotent. 626N/A // bool idempotent() { return true; }