2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2018-01-10 22:48:27 +01:00
|
|
|
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
2007-12-01 00:00:00 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
|
|
*
|
|
|
|
* This code is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License version 2 only, as
|
|
|
|
* published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* version 2 for more details (a copy is included in the LICENSE file that
|
|
|
|
* accompanied this code).
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License version
|
|
|
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*
|
2010-05-27 19:08:38 -07:00
|
|
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
|
|
* or visit www.oracle.com if you need additional information or have any
|
|
|
|
* questions.
|
2007-12-01 00:00:00 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#ifndef SHARE_VM_GC_PARALLEL_CARDTABLEEXTENSION_HPP
|
|
|
|
#define SHARE_VM_GC_PARALLEL_CARDTABLEEXTENSION_HPP
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#include "gc/shared/cardTableModRefBS.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
class MutableSpace;
|
|
|
|
class ObjectStartArray;
|
|
|
|
class PSPromotionManager;
|
|
|
|
class GCTaskQueue;
|
|
|
|
|
|
|
|
class CardTableExtension : public CardTableModRefBS {
|
|
|
|
private:
|
|
|
|
// Support methods for resizing the card table.
|
2010-06-23 08:35:31 -07:00
|
|
|
// resize_commit_uncommit() returns true if the pages were committed or
|
|
|
|
// uncommitted
|
|
|
|
bool resize_commit_uncommit(int changed_region, MemRegion new_region);
|
2007-12-01 00:00:00 +00:00
|
|
|
void resize_update_card_table_entries(int changed_region,
|
|
|
|
MemRegion new_region);
|
|
|
|
void resize_update_committed_table(int changed_region, MemRegion new_region);
|
|
|
|
void resize_update_covered_table(int changed_region, MemRegion new_region);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
static void verify_all_young_refs_precise_helper(MemRegion mr);
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum ExtendedCardValue {
|
|
|
|
youngergen_card = CardTableModRefBS::CT_MR_BS_last_reserved + 1,
|
|
|
|
verify_card = CardTableModRefBS::CT_MR_BS_last_reserved + 5
|
|
|
|
};
|
|
|
|
|
2014-11-18 10:36:42 +01:00
|
|
|
CardTableExtension(MemRegion whole_heap) :
|
2015-02-27 19:52:48 -05:00
|
|
|
CardTableModRefBS(
|
|
|
|
whole_heap,
|
2015-08-18 17:48:35 -04:00
|
|
|
BarrierSet::FakeRtti(BarrierSet::CardTableExtension))
|
2015-02-27 19:52:48 -05:00
|
|
|
{ }
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Scavenge support
|
|
|
|
void scavenge_contents_parallel(ObjectStartArray* start_array,
|
|
|
|
MutableSpace* sp,
|
|
|
|
HeapWord* space_top,
|
|
|
|
PSPromotionManager* pm,
|
2011-08-09 10:16:01 -07:00
|
|
|
uint stripe_number,
|
|
|
|
uint stripe_total);
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// Verification
|
|
|
|
static void verify_all_young_refs_imprecise();
|
|
|
|
static void verify_all_young_refs_precise();
|
|
|
|
|
|
|
|
bool addr_is_marked_imprecise(void *addr);
|
|
|
|
bool addr_is_marked_precise(void *addr);
|
|
|
|
|
|
|
|
void set_card_newgen(void* addr) { jbyte* p = byte_for(addr); *p = verify_card; }
|
|
|
|
|
|
|
|
// Testers for entries
|
|
|
|
static bool card_is_dirty(int value) { return value == dirty_card; }
|
|
|
|
static bool card_is_newgen(int value) { return value == youngergen_card; }
|
|
|
|
static bool card_is_clean(int value) { return value == clean_card; }
|
|
|
|
static bool card_is_verify(int value) { return value == verify_card; }
|
|
|
|
|
|
|
|
// Card marking
|
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
2008-04-13 17:43:42 -04:00
|
|
|
void inline_write_ref_field_gc(void* field, oop new_val) {
|
2007-12-01 00:00:00 +00:00
|
|
|
jbyte* byte = byte_for(field);
|
|
|
|
*byte = youngergen_card;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Adaptive size policy support
|
|
|
|
// Allows adjustment of the base and size of the covered regions
|
|
|
|
void resize_covered_region(MemRegion new_region);
|
|
|
|
// Finds the covered region to resize based on the start address
|
|
|
|
// of the covered regions.
|
|
|
|
void resize_covered_region_by_start(MemRegion new_region);
|
|
|
|
// Finds the covered region to resize based on the end address
|
|
|
|
// of the covered regions.
|
|
|
|
void resize_covered_region_by_end(int changed_region, MemRegion new_region);
|
|
|
|
// Finds the lowest start address of a covered region that is
|
|
|
|
// previous (i.e., lower index) to the covered region with index "ind".
|
|
|
|
HeapWord* lowest_prev_committed_start(int ind) const;
|
|
|
|
|
|
|
|
#ifdef ASSERT
|
|
|
|
|
|
|
|
bool is_valid_card_address(jbyte* addr) {
|
|
|
|
return (addr >= _byte_map) && (addr < _byte_map + _byte_map_size);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // ASSERT
|
2018-01-10 22:48:27 +01:00
|
|
|
|
|
|
|
// ReduceInitialCardMarks support
|
|
|
|
virtual bool is_in_young(oop obj) const;
|
|
|
|
|
|
|
|
virtual bool card_mark_must_follow_store() const {
|
|
|
|
return false;
|
|
|
|
}
|
2007-12-01 00:00:00 +00:00
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-02-27 19:52:48 -05:00
|
|
|
template<>
|
|
|
|
struct BarrierSet::GetName<CardTableExtension> {
|
|
|
|
static const BarrierSet::Name value = BarrierSet::CardTableExtension;
|
|
|
|
};
|
|
|
|
|
2017-11-20 13:07:44 +01:00
|
|
|
template<>
|
|
|
|
struct BarrierSet::GetType<BarrierSet::CardTableExtension> {
|
|
|
|
typedef ::CardTableExtension type;
|
|
|
|
};
|
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#endif // SHARE_VM_GC_PARALLEL_CARDTABLEEXTENSION_HPP
|