Skip to content

Commit 8257596

Browse files
committed
s1-prims
1 parent 014c95a commit 8257596

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hotspot/share/prims/whitebox.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
#include "gc/shared/gcConfig.hpp"
4848
#include "gc/shared/gcLocker.inline.hpp"
4949
#include "gc/shared/genArguments.hpp"
50-
#include "gc/shared/genCollectedHeap.hpp"
5150
#include "jvmtifiles/jvmtiEnv.hpp"
5251
#include "logging/log.hpp"
5352
#include "memory/iterator.hpp"
@@ -111,6 +110,9 @@
111110
#if INCLUDE_PARALLELGC
112111
#include "gc/parallel/parallelScavengeHeap.inline.hpp"
113112
#endif // INCLUDE_PARALLELGC
113+
#if INCLUDE_SERIALGC
114+
#include "gc/serial/serialHeap.hpp"
115+
#endif // INCLUDE_SERIALGC
114116
#if INCLUDE_ZGC
115117
#include "gc/z/zAddress.inline.hpp"
116118
#endif // INCLUDE_ZGC
@@ -422,8 +424,12 @@ WB_ENTRY(jboolean, WB_isObjectInOldGen(JNIEnv* env, jobject o, jobject obj))
422424
return Universe::heap()->is_in(p);
423425
}
424426
#endif
425-
GenCollectedHeap* gch = GenCollectedHeap::heap();
426-
return !gch->is_in_young(p);
427+
#if INCLUDE_SERIALGC
428+
if (UseSerialGC) {
429+
return !SerialHeap::heap()->is_in_young(p);
430+
}
431+
#endif
432+
ShouldNotReachHere();
427433
WB_END
428434

429435
WB_ENTRY(jlong, WB_GetObjectSize(JNIEnv* env, jobject o, jobject obj))

0 commit comments

Comments
 (0)