Skip to content


Browse files Browse the repository at this point in the history
8253270: Limit fastdebug inlining in G1 evacuation
Reviewed-by: tschatzl, sjohanss, ayang
  • Loading branch information
Kim Barrett committed Sep 18, 2020
1 parent 8904420 commit f37c34d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
17 changes: 16 additions & 1 deletion src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
Expand Up @@ -36,6 +36,16 @@
#include "oops/access.inline.hpp"
#include "oops/oop.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.

G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
G1RedirtyCardsQueueSet* rdcqs,
Expand Down Expand Up @@ -155,7 +165,9 @@ void G1ParScanThreadState::verify_task(ScannerTask task) const {
#endif // ASSERT

template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
template <class T>
void G1ParScanThreadState::do_oop_evac(T* p) {
// Reference should not be NULL here as such are never pushed to the task queue.
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);

Expand Down Expand Up @@ -194,6 +206,7 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {

void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
oop from_obj = task.to_source_array();

Expand Down Expand Up @@ -243,6 +256,7 @@ void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
to_obj_array->oop_iterate_range(&_scanner, start, end);

void G1ParScanThreadState::dispatch_task(ScannerTask task) {
if (task.is_narrow_oop_ptr()) {
Expand Down Expand Up @@ -388,6 +402,7 @@ void G1ParScanThreadState::undo_allocation(G1HeapRegionAttr dest_attr,

// Private inline function, for direct internal use and providing the
// implementation of the public not-inline function.
oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const region_attr,
oop const old,
markWord const old_mark) {
Expand Down
12 changes: 6 additions & 6 deletions src/hotspot/share/gc/g1/g1ParScanThreadState.hpp
Expand Up @@ -156,7 +156,7 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
size_t flush(size_t* surviving_young_words);

inline void do_partial_array(PartialArrayScanTask task);
void do_partial_array(PartialArrayScanTask task);

HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr,
oop old,
Expand All @@ -169,14 +169,14 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
size_t word_sz,
uint node_index);

inline oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
oop obj,
markWord old_mark);
oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
oop obj,
markWord old_mark);

// 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
// allocate into dest. Previous_plab_refill_failed indicates whether previous
Expand Down

1 comment on commit f37c34d

Copy link

@bridgekeeper bridgekeeper bot commented on f37c34d Sep 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.