Skip to content

Commit

Permalink
noinline some functions in debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
kimbarrett committed Sep 17, 2020
1 parent 9a7dcdc commit 25f8ded
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
16 changes: 15 additions & 1 deletion src/hotspot/share/gc/g1/g1ParScanThreadState.cpp
Expand Up @@ -36,6 +36,15 @@
#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.
// Explicit NOINLINE to block ATTRIBUTE_FLATTENing.
#define MAYBE_INLINE_EVACUATION NOT_DEBUG(inline) DEBUG_ONLY(NOINLINE)

G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
G1RedirtyCardsQueueSet* rdcqs,
Expand Down Expand Up @@ -155,7 +164,9 @@ void G1ParScanThreadState::verify_task(ScannerTask task) const {
}
#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.
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);

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

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

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

MAYBE_INLINE_EVACUATION
void G1ParScanThreadState::dispatch_task(ScannerTask task) {
verify_task(task);
if (task.is_narrow_oop_ptr()) {
Expand Down Expand Up @@ -388,6 +401,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.
MAYBE_INLINE_EVACUATION
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);

private:
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

0 comments on commit 25f8ded

Please sign in to comment.