Skip to content

Commit f37c34d

Browse files
author
Kim Barrett
committedSep 18, 2020
8253270: Limit fastdebug inlining in G1 evacuation
Reviewed-by: tschatzl, sjohanss, ayang
1 parent 8904420 commit f37c34d

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed
 

‎src/hotspot/share/gc/g1/g1ParScanThreadState.cpp

+16-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
#include "oops/access.inline.hpp"
3737
#include "oops/oop.inline.hpp"
3838
#include "runtime/prefetch.inline.hpp"
39+
#include "utilities/globalDefinitions.hpp"
40+
#include "utilities/macros.hpp"
41+
42+
// In fastdebug builds the code size can get out of hand, potentially
43+
// tripping over compiler limits (which may be bugs, but nevertheless
44+
// need to be taken into consideration). A side benefit of limiting
45+
// inlining is that we get more call frames that might aid debugging.
46+
// And the fastdebug compile time for this file is much reduced.
47+
// Explicit NOINLINE to block ATTRIBUTE_FLATTENing.
48+
#define MAYBE_INLINE_EVACUATION NOT_DEBUG(inline) DEBUG_ONLY(NOINLINE)
3949

4050
G1ParScanThreadState::G1ParScanThreadState(G1CollectedHeap* g1h,
4151
G1RedirtyCardsQueueSet* rdcqs,
@@ -155,7 +165,9 @@ void G1ParScanThreadState::verify_task(ScannerTask task) const {
155165
}
156166
#endif // ASSERT
157167

158-
template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
168+
template <class T>
169+
MAYBE_INLINE_EVACUATION
170+
void G1ParScanThreadState::do_oop_evac(T* p) {
159171
// Reference should not be NULL here as such are never pushed to the task queue.
160172
oop obj = RawAccess<IS_NOT_NULL>::oop_load(p);
161173

@@ -194,6 +206,7 @@ template <class T> void G1ParScanThreadState::do_oop_evac(T* p) {
194206
}
195207
}
196208

209+
MAYBE_INLINE_EVACUATION
197210
void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
198211
oop from_obj = task.to_source_array();
199212

@@ -243,6 +256,7 @@ void G1ParScanThreadState::do_partial_array(PartialArrayScanTask task) {
243256
to_obj_array->oop_iterate_range(&_scanner, start, end);
244257
}
245258

259+
MAYBE_INLINE_EVACUATION
246260
void G1ParScanThreadState::dispatch_task(ScannerTask task) {
247261
verify_task(task);
248262
if (task.is_narrow_oop_ptr()) {
@@ -388,6 +402,7 @@ void G1ParScanThreadState::undo_allocation(G1HeapRegionAttr dest_attr,
388402

389403
// Private inline function, for direct internal use and providing the
390404
// implementation of the public not-inline function.
405+
MAYBE_INLINE_EVACUATION
391406
oop G1ParScanThreadState::do_copy_to_survivor_space(G1HeapRegionAttr const region_attr,
392407
oop const old,
393408
markWord const old_mark) {

‎src/hotspot/share/gc/g1/g1ParScanThreadState.hpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class G1ParScanThreadState : public CHeapObj<mtGC> {
156156
size_t flush(size_t* surviving_young_words);
157157

158158
private:
159-
inline void do_partial_array(PartialArrayScanTask task);
159+
void do_partial_array(PartialArrayScanTask task);
160160

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

172-
inline oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
173-
oop obj,
174-
markWord old_mark);
172+
oop do_copy_to_survivor_space(G1HeapRegionAttr region_attr,
173+
oop obj,
174+
markWord old_mark);
175175

176176
// This method is applied to the fields of the objects that have just been copied.
177-
template <class T> inline void do_oop_evac(T* p);
177+
template <class T> void do_oop_evac(T* p);
178178

179-
inline void dispatch_task(ScannerTask task);
179+
void dispatch_task(ScannerTask task);
180180

181181
// Tries to allocate word_sz in the PLAB of the next "generation" after trying to
182182
// allocate into dest. Previous_plab_refill_failed indicates whether previous

0 commit comments

Comments
 (0)
Please sign in to comment.