17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
26 #include "gc/shenandoah/shenandoahConnectionMatrix.inline.hpp"
27 #include "gc/shenandoah/shenandoahHeap.hpp"
28 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
29 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "utilities/copy.hpp"
32
33 ShenandoahConnectionMatrix::ShenandoahConnectionMatrix(size_t max_regions) :
34 _stride(max_regions),
35 _region_shift(ShenandoahHeapRegion::region_size_shift()),
36 _matrix(NEW_C_HEAP_ARRAY(char, max_regions * max_regions, mtGC)),
37 _magic_offset( ((uintptr_t) _matrix) - ( ((uintptr_t) ShenandoahHeap::heap()->first_region_bottom()) >> _region_shift) * (_stride + 1))
38
39 {
40 if (UseShenandoahMatrix) {
41 clear_all();
42 }
43 }
44
45 ShenandoahConnectionMatrix::~ShenandoahConnectionMatrix() {
46 FREE_C_HEAP_ARRAY(char, _matrix);
47 }
48
49 void ShenandoahConnectionMatrix::clear_connected(size_t from_idx, size_t to_idx) {
50 assert (UseShenandoahMatrix, "call only when matrix is enabled");
51 _matrix[index_of(from_idx, to_idx)] = 0;
52 }
53
54 void ShenandoahConnectionMatrix::clear_region(size_t idx) {
55 assert (UseShenandoahMatrix, "call only when matrix is enabled");
56 clear_region_inbound(idx);
57 clear_region_outbound(idx);
|
17 *
18 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19 * or visit www.oracle.com if you need additional information or have any
20 * questions.
21 *
22 */
23
24 #include "precompiled.hpp"
25 #include "gc/shenandoah/shenandoahConnectionMatrix.hpp"
26 #include "gc/shenandoah/shenandoahConnectionMatrix.inline.hpp"
27 #include "gc/shenandoah/shenandoahHeap.hpp"
28 #include "gc/shenandoah/shenandoahHeapRegion.hpp"
29 #include "gc/shenandoah/shenandoahHeapRegionSet.hpp"
30 #include "memory/allocation.inline.hpp"
31 #include "utilities/copy.hpp"
32
33 ShenandoahConnectionMatrix::ShenandoahConnectionMatrix(size_t max_regions) :
34 _stride(max_regions),
35 _region_shift(ShenandoahHeapRegion::region_size_shift()),
36 _matrix(NEW_C_HEAP_ARRAY(char, max_regions * max_regions, mtGC)),
37 _magic_offset( ((uintptr_t) _matrix) - ( ((uintptr_t) ShenandoahHeap::heap()->base()) >> _region_shift) * (_stride + 1))
38
39 {
40 if (UseShenandoahMatrix) {
41 clear_all();
42 }
43 }
44
45 ShenandoahConnectionMatrix::~ShenandoahConnectionMatrix() {
46 FREE_C_HEAP_ARRAY(char, _matrix);
47 }
48
49 void ShenandoahConnectionMatrix::clear_connected(size_t from_idx, size_t to_idx) {
50 assert (UseShenandoahMatrix, "call only when matrix is enabled");
51 _matrix[index_of(from_idx, to_idx)] = 0;
52 }
53
54 void ShenandoahConnectionMatrix::clear_region(size_t idx) {
55 assert (UseShenandoahMatrix, "call only when matrix is enabled");
56 clear_region_inbound(idx);
57 clear_region_outbound(idx);
|