mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8162104: Use in_cset() instead of obj_in_cs()
Reviewed-by: ehelin, sjohanss
This commit is contained in:
parent
342c0bc788
commit
3b93aefe93
7 changed files with 15 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -37,7 +37,7 @@ void G1CodeBlobClosure::HeapRegionGatheringOopClosure::do_oop_work(T* p) {
|
||||||
if (!oopDesc::is_null(oop_or_narrowoop)) {
|
if (!oopDesc::is_null(oop_or_narrowoop)) {
|
||||||
oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
|
oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
|
||||||
HeapRegion* hr = _g1h->heap_region_containing(o);
|
HeapRegion* hr = _g1h->heap_region_containing(o);
|
||||||
assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in collection set then evacuation failed and nm must already be in the remset");
|
assert(!_g1h->is_in_cset(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in collection set then evacuation failed and nm must already be in the remset");
|
||||||
hr->add_strong_code_root(_nm);
|
hr->add_strong_code_root(_nm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -2364,11 +2364,6 @@ bool G1CollectedHeap::is_in_exact(const void* p) const {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool G1CollectedHeap::obj_in_cs(oop obj) {
|
|
||||||
HeapRegion* r = _hrm.addr_to_region((HeapWord*) obj);
|
|
||||||
return r != NULL && r->in_collection_set();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Iteration functions.
|
// Iteration functions.
|
||||||
|
|
||||||
// Applies an ExtendedOopClosure onto all references of objects within a HeapRegion.
|
// Applies an ExtendedOopClosure onto all references of objects within a HeapRegion.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -1129,9 +1129,7 @@ public:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Return "TRUE" iff the given object address is within the collection
|
// Return "TRUE" iff the given object address is within the collection
|
||||||
// set. Slow implementation.
|
// set. Assumes that the reference points into the heap.
|
||||||
bool obj_in_cs(oop obj);
|
|
||||||
|
|
||||||
inline bool is_in_cset(const HeapRegion *hr);
|
inline bool is_in_cset(const HeapRegion *hr);
|
||||||
inline bool is_in_cset(oop obj);
|
inline bool is_in_cset(oop obj);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -142,16 +142,8 @@ inline bool G1CollectedHeap::isMarkedNext(oop obj) const {
|
||||||
return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
|
return _cm->nextMarkBitMap()->isMarked((HeapWord *)obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a fast test on whether a reference points into the
|
|
||||||
// collection set or not. Assume that the reference
|
|
||||||
// points into the heap.
|
|
||||||
inline bool G1CollectedHeap::is_in_cset(oop obj) {
|
inline bool G1CollectedHeap::is_in_cset(oop obj) {
|
||||||
bool ret = _in_cset_fast_test.is_in_cset((HeapWord*)obj);
|
return _in_cset_fast_test.is_in_cset((HeapWord*)obj);
|
||||||
// let's make sure the result is consistent with what the slower
|
|
||||||
// test returns
|
|
||||||
assert( ret || !obj_in_cs(obj), "sanity");
|
|
||||||
assert(!ret || obj_in_cs(obj), "sanity");
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
|
bool G1CollectedHeap::is_in_cset(const HeapRegion* hr) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -2012,7 +2012,7 @@ public:
|
||||||
guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || obj->is_oop(),
|
guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || obj->is_oop(),
|
||||||
"Non-oop " PTR_FORMAT ", phase: %s, info: %d",
|
"Non-oop " PTR_FORMAT ", phase: %s, info: %d",
|
||||||
p2i(obj), _phase, _info);
|
p2i(obj), _phase, _info);
|
||||||
guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || !_g1h->obj_in_cs(obj),
|
guarantee(G1CMObjArrayProcessor::is_array_slice(obj) || !_g1h->is_in_cset(obj),
|
||||||
"obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
|
"obj: " PTR_FORMAT " in CSet, phase: %s, info: %d",
|
||||||
p2i(obj), _phase, _info);
|
p2i(obj), _phase, _info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -114,7 +114,7 @@ inline void G1ParPushHeapRSClosure::do_oop_nv(T* p) {
|
||||||
} else if (state.is_ext()) {
|
} else if (state.is_ext()) {
|
||||||
_par_scan_state->do_oop_ext(p);
|
_par_scan_state->do_oop_ext(p);
|
||||||
} else {
|
} else {
|
||||||
assert(!_g1->obj_in_cs(obj), "checking");
|
assert(!_g1->is_in_cset(obj), "checking");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -113,7 +113,7 @@ bool G1ParScanThreadState::verify_ref(oop* ref) const {
|
||||||
if (has_partial_array_mask(ref)) {
|
if (has_partial_array_mask(ref)) {
|
||||||
// Must be in the collection set--it's already been copied.
|
// Must be in the collection set--it's already been copied.
|
||||||
oop p = clear_partial_array_mask(ref);
|
oop p = clear_partial_array_mask(ref);
|
||||||
assert(_g1h->obj_in_cs(p),
|
assert(_g1h->is_in_cset(p),
|
||||||
"ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p));
|
"ref=" PTR_FORMAT " p=" PTR_FORMAT, p2i(ref), p2i(p));
|
||||||
} else {
|
} else {
|
||||||
oop p = oopDesc::load_decode_heap_oop(ref);
|
oop p = oopDesc::load_decode_heap_oop(ref);
|
||||||
|
@ -372,7 +372,7 @@ void G1ParScanThreadStateSet::flush() {
|
||||||
}
|
}
|
||||||
|
|
||||||
oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
|
oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
|
||||||
assert(_g1h->obj_in_cs(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old));
|
assert(_g1h->is_in_cset(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old));
|
||||||
|
|
||||||
oop forward_ptr = old->forward_to_atomic(old);
|
oop forward_ptr = old->forward_to_atomic(old);
|
||||||
if (forward_ptr == NULL) {
|
if (forward_ptr == NULL) {
|
||||||
|
@ -394,7 +394,7 @@ oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) {
|
||||||
// Forward-to-self failed. Either someone else managed to allocate
|
// Forward-to-self failed. Either someone else managed to allocate
|
||||||
// space for this object (old != forward_ptr) or they beat us in
|
// space for this object (old != forward_ptr) or they beat us in
|
||||||
// self-forwarding it (old == forward_ptr).
|
// self-forwarding it (old == forward_ptr).
|
||||||
assert(old == forward_ptr || !_g1h->obj_in_cs(forward_ptr),
|
assert(old == forward_ptr || !_g1h->is_in_cset(forward_ptr),
|
||||||
"Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
|
"Object " PTR_FORMAT " forwarded to: " PTR_FORMAT " "
|
||||||
"should not be in the CSet",
|
"should not be in the CSet",
|
||||||
p2i(old), p2i(forward_ptr));
|
p2i(old), p2i(forward_ptr));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue