Skip to content
Permalink
Browse files
8254015: copy_to_survivor_space should use in-hand klass for scanning
Reviewed-by: tschatzl, sjohanss, ayang
  • Loading branch information
Kim Barrett committed Oct 8, 2020
1 parent 76a5852 commit 66f27b5fcae0c3739ddd2719cf65757a860f8dca
Showing with 11 additions and 2 deletions.
  1. +1 −1 src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
  2. +3 −0 src/hotspot/share/oops/oop.hpp
  3. +7 −1 src/hotspot/share/oops/oop.inline.hpp
@@ -524,7 +524,7 @@ oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const regio
}

G1ScanInYoungSetter x(&_scanner, dest_attr.is_young());
obj->oop_iterate_backwards(&_scanner);
obj->oop_iterate_backwards(&_scanner, klass);
return obj;

} else {
@@ -277,6 +277,9 @@ class oopDesc {
template <typename OopClosureType>
inline void oop_iterate_backwards(OopClosureType* cl);

template <typename OopClosureType>
inline void oop_iterate_backwards(OopClosureType* cl, Klass* klass);

inline static bool is_instanceof_or_null(oop obj, Klass* klass);

// identity hash; returns the identity hash key (computes it if necessary)
@@ -357,7 +357,13 @@ int oopDesc::oop_iterate_size(OopClosureType* cl, MemRegion mr) {

template <typename OopClosureType>
void oopDesc::oop_iterate_backwards(OopClosureType* cl) {
OopIteratorClosureDispatch::oop_oop_iterate_backwards(cl, this, klass());
oop_iterate_backwards(cl, klass());
}

template <typename OopClosureType>
void oopDesc::oop_iterate_backwards(OopClosureType* cl, Klass* k) {
assert(k == klass(), "wrong klass");
OopIteratorClosureDispatch::oop_oop_iterate_backwards(cl, this, k);
}

bool oopDesc::is_instanceof_or_null(oop obj, Klass* klass) {

1 comment on commit 66f27b5

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 66f27b5 Oct 8, 2020

Please sign in to comment.