8253270: Limit fastdebug inlining in G1 evacuation

Reviewed-by: tschatzl, sjohanss, ayang
This commit is contained in:
Kim Barrett 2020-09-18 19:29:18 +00:00
parent 89044200cd
commit f37c34d32e
2 changed files with 22 additions and 7 deletions

View File

@ -36,6 +36,16 @@
#include "oops/access.inline.hpp" #include "oops/access.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/prefetch.inline.hpp" #include "runtime/prefetch.inline.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
// In fastdebug builds the code size can get out of hand, potentially
// tripping over compiler limits (which may be bugs, but nevertheless
// need to be taken into consideration). A side benefit of limiting
// inlining is that we get more call frames that might aid debugging.
// And the fastdebug compile time for this file is much reduced.
// Explicit NOINLINE to block ATTRIBUTE_FLATTENing.
#define MAYBE_INLINE_EVACUATION NOT_DEBUG(inline) DEBUG_ONLY(NOINLINE)
G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h, G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
G1RedirtyCardsQueueSet* rdcqs, G1RedirtyCardsQueueSet* rdcqs,
@ -155,7 +165,9 @@ void G1ParScanThreadState::verify_task(ScannerTask task) const {
} }
#endif // ASSERT #endif // ASSERT
template <class T> void G1ParScanThreadState::do_oop_evac(T* p) { template <class T>
MAYBE_INLINE_EVACUATION
void G1ParScanThreadState::do_oop_evac(T* p) {
// Reference should not be NULL here as such are never pushed to the task queue. // Reference should not be NULL here as such are never pushed to the task queue.
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p); oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
@ -194,6 +206,7 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
} }
} }
MAYBE_INLINE_EVACUATION
void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) { void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
oop from_obj = task.to_source_array(); oop from_obj = task.to_source_array();
@ -243,6 +256,7 @@ void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
to_obj_array->oop_iterate_range(&_scanner, start, end); to_obj_array->oop_iterate_range(&_scanner, start, end);
} }
MAYBE_INLINE_EVACUATION
void G1ParScanThreadState::dispatch_task(ScannerTask task) { void G1ParScanThreadState::dispatch_task(ScannerTask task) {
verify_task(task); verify_task(task);
if (task.is_narrow_oop_ptr()) { if (task.is_narrow_oop_ptr()) {
@ -388,6 +402,7 @@ void G1ParScanThreadState::undo_allocation(G1HeapRegionAttr dest_attr,
// Private inline function, for direct internal use and providing the // Private inline function, for direct internal use and providing the
// implementation of the public not-inline function. // implementation of the public not-inline function.
MAYBE_INLINE_EVACUATION
oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const region_attr, oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const region_attr,
oop const old, oop const old,
markWord const old_mark) { markWord const old_mark) {

View File

@ -156,7 +156,7 @@ public:
size_t flush(size_t* surviving_young_words); size_t flush(size_t* surviving_young_words);
private: private:
inline void do_partial_array(PartialArrayScanTask task); void do_partial_array(PartialArrayScanTask task);
HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr, HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr,
oop old, oop old,
@ -169,14 +169,14 @@ private:
size_t word_sz, size_t word_sz,
uint node_index); uint node_index);
inline oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr, oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
oop obj, oop obj,
markWord old_mark); markWord old_mark);
// This method is applied to the fields of the objects that have just been copied. // This method is applied to the fields of the objects that have just been copied.
template <class T> inline void do_oop_evac(T* p); template <class T> void do_oop_evac(T* p);
inline void dispatch_task(ScannerTask task); void dispatch_task(ScannerTask task);
// Tries to allocate word_sz in the PLAB of the next "generation" after trying to // Tries to allocate word_sz in the PLAB of the next "generation" after trying to
// allocate into dest. Previous_plab_refill_failed indicates whether previous // allocate into dest. Previous_plab_refill_failed indicates whether previous