< prev index next >

src/share/vm/gc/g1/heapRegion.hpp

Print this page
rev 12513 : 8071278: Fix the closure mess in G1RemSet::refine_card()
Summary: Remove the use of many nested closure in the code to refine a card.
Reviewed-by: kbarrett, sjohanss
   1 /*
   2  * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 644   // Sets the "evacuation_failed" property of the region.
 645   void set_evacuation_failed(bool b) {
 646     _evacuation_failed = b;
 647 
 648     if (b) {
 649       _next_marked_bytes = 0;
 650     }
 651   }
 652 
 653   // Iterate over the objects overlapping part of a card, applying cl
 654   // to all references in the region.  This is a helper for
 655   // G1RemSet::refine_card, and is tightly coupled with it.
 656   // mr: the memory region covered by the card, trimmed to the
 657   // allocated space for this region.  Must not be empty.
 658   // This region must be old or humongous.
 659   // Returns true if the designated objects were successfully
 660   // processed, false if an unparsable part of the heap was
 661   // encountered; that only happens when invoked concurrently with the
 662   // mutator.
 663   bool oops_on_card_seq_iterate_careful(MemRegion mr,
 664                                         FilterOutOfRegionClosure* cl);
 665 
 666   size_t recorded_rs_length() const        { return _recorded_rs_length; }
 667   double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
 668 
 669   void set_recorded_rs_length(size_t rs_length) {
 670     _recorded_rs_length = rs_length;
 671   }
 672 
 673   void set_predicted_elapsed_time_ms(double ms) {
 674     _predicted_elapsed_time_ms = ms;
 675   }
 676 
 677   virtual CompactibleSpace* next_compaction_space() const;
 678 
 679   virtual void reset_after_compaction();
 680 
 681   // Routines for managing a list of code roots (attached to the
 682   // this region's RSet) that point into this heap region.
 683   void add_strong_code_root(nmethod* nm);
 684   void add_strong_code_root_locked(nmethod* nm);


   1 /*
   2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 644   // Sets the "evacuation_failed" property of the region.
 645   void set_evacuation_failed(bool b) {
 646     _evacuation_failed = b;
 647 
 648     if (b) {
 649       _next_marked_bytes = 0;
 650     }
 651   }
 652 
 653   // Iterate over the objects overlapping part of a card, applying cl
 654   // to all references in the region.  This is a helper for
 655   // G1RemSet::refine_card, and is tightly coupled with it.
 656   // mr: the memory region covered by the card, trimmed to the
 657   // allocated space for this region.  Must not be empty.
 658   // This region must be old or humongous.
 659   // Returns true if the designated objects were successfully
 660   // processed, false if an unparsable part of the heap was
 661   // encountered; that only happens when invoked concurrently with the
 662   // mutator.
 663   bool oops_on_card_seq_iterate_careful(MemRegion mr,
 664                                         G1UpdateRSOrPushRefOopClosure* cl);
 665 
 666   size_t recorded_rs_length() const        { return _recorded_rs_length; }
 667   double predicted_elapsed_time_ms() const { return _predicted_elapsed_time_ms; }
 668 
 669   void set_recorded_rs_length(size_t rs_length) {
 670     _recorded_rs_length = rs_length;
 671   }
 672 
 673   void set_predicted_elapsed_time_ms(double ms) {
 674     _predicted_elapsed_time_ms = ms;
 675   }
 676 
 677   virtual CompactibleSpace* next_compaction_space() const;
 678 
 679   virtual void reset_after_compaction();
 680 
 681   // Routines for managing a list of code roots (attached to the
 682   // this region's RSet) that point into this heap region.
 683   void add_strong_code_root(nmethod* nm);
 684   void add_strong_code_root_locked(nmethod* nm);


< prev index next >