2007-12-01 00:00:00 +00:00
|
|
|
/*
|
2015-01-27 13:50:31 -05:00
|
|
|
* Copyright (c) 2000, 2015, 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_SHARED_MODREFBARRIERSET_HPP
|
|
|
|
#define SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#include "gc/shared/barrierSet.hpp"
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// This kind of "BarrierSet" allows a "CollectedHeap" to detect and
|
|
|
|
// enumerate ref fields that have been modified (since the last
|
|
|
|
// enumeration), using a card table.
|
|
|
|
|
|
|
|
class OopClosure;
|
|
|
|
class Generation;
|
|
|
|
|
|
|
|
class ModRefBarrierSet: public BarrierSet {
|
|
|
|
public:
|
2008-06-05 15:57:56 -07:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
// Barriers only on ref writes.
|
|
|
|
bool has_read_ref_barrier() { return false; }
|
|
|
|
bool has_read_prim_barrier() { return false; }
|
|
|
|
bool has_write_ref_barrier() { return true; }
|
|
|
|
bool has_write_prim_barrier() { return false; }
|
|
|
|
|
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
|
|
|
bool read_ref_needs_barrier(void* field) { return false; }
|
2007-12-01 00:00:00 +00:00
|
|
|
bool read_prim_needs_barrier(HeapWord* field, size_t bytes) { return false; }
|
|
|
|
bool write_prim_needs_barrier(HeapWord* field, size_t bytes,
|
|
|
|
juint val1, juint val2) { return false; }
|
|
|
|
|
|
|
|
void write_prim_field(oop obj, size_t offset, size_t bytes,
|
|
|
|
juint val1, juint val2) {}
|
|
|
|
|
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 read_ref_field(void* field) {}
|
2007-12-01 00:00:00 +00:00
|
|
|
void read_prim_field(HeapWord* field, size_t bytes) {}
|
2015-01-27 13:50:31 -05:00
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
protected:
|
2015-01-27 13:50:31 -05:00
|
|
|
|
2015-02-27 19:52:48 -05:00
|
|
|
ModRefBarrierSet(const BarrierSet::FakeRtti& fake_rtti)
|
|
|
|
: BarrierSet(fake_rtti.add_tag(BarrierSet::ModRef)) { }
|
2015-01-27 13:50:31 -05:00
|
|
|
~ModRefBarrierSet() { }
|
|
|
|
|
2007-12-01 00:00:00 +00:00
|
|
|
public:
|
|
|
|
void write_prim_field(HeapWord* field, size_t bytes,
|
|
|
|
juint val1, juint val2) {}
|
|
|
|
|
|
|
|
bool has_read_ref_array_opt() { return false; }
|
|
|
|
bool has_read_prim_array_opt() { return false; }
|
|
|
|
bool has_write_prim_array_opt() { return false; }
|
|
|
|
|
|
|
|
bool has_read_region_opt() { return false; }
|
|
|
|
|
|
|
|
|
2014-01-23 14:47:23 +01:00
|
|
|
// These operations should assert false unless the corresponding operation
|
2007-12-01 00:00:00 +00:00
|
|
|
// above returns true.
|
|
|
|
void read_ref_array(MemRegion mr) {
|
|
|
|
assert(false, "can't call");
|
|
|
|
}
|
|
|
|
void read_prim_array(MemRegion mr) {
|
|
|
|
assert(false, "can't call");
|
|
|
|
}
|
|
|
|
void write_prim_array(MemRegion mr) {
|
|
|
|
assert(false, "can't call");
|
|
|
|
}
|
|
|
|
void read_region(MemRegion mr) {
|
|
|
|
assert(false, "can't call");
|
|
|
|
}
|
|
|
|
|
2008-06-05 15:57:56 -07:00
|
|
|
// Causes all refs in "mr" to be assumed to be modified. If "whole_heap"
|
|
|
|
// is true, the caller asserts that the entire heap is being invalidated,
|
|
|
|
// which may admit an optimized implementation for some barriers.
|
|
|
|
virtual void invalidate(MemRegion mr, bool whole_heap = false) = 0;
|
2007-12-01 00:00:00 +00:00
|
|
|
|
|
|
|
// The caller guarantees that "mr" contains no references. (Perhaps it's
|
|
|
|
// objects have been moved elsewhere.)
|
|
|
|
virtual void clear(MemRegion mr) = 0;
|
|
|
|
};
|
2010-11-23 13:22:55 -08:00
|
|
|
|
2015-02-27 19:52:48 -05:00
|
|
|
template<>
|
|
|
|
struct BarrierSet::GetName<ModRefBarrierSet> {
|
|
|
|
static const BarrierSet::Name value = BarrierSet::ModRef;
|
|
|
|
};
|
|
|
|
|
2015-05-13 15:16:06 +02:00
|
|
|
#endif // SHARE_VM_GC_SHARED_MODREFBARRIERSET_HPP
|