8200729: Conditional compilation of GCs

Reviewed-by: ehelin, coleenp, kvn, ihse
This commit is contained in:
Stefan Karlsson 2018-05-04 11:41:35 +02:00
parent d1cf230fc1
commit 1cb95bd3d1
123 changed files with 661 additions and 447 deletions

View File

@ -25,7 +25,7 @@
# All valid JVM features, regardless of platform # All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \ VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
graal vm-structs jni-check services management all-gcs nmt cds \ graal vm-structs jni-check services management cmsgc g1gc parallelgc serialgc nmt cds \
static-build link-time-opt aot" static-build link-time-opt aot"
# All valid JVM variants # All valid JVM variants
@ -305,12 +305,8 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1']) AC_MSG_ERROR([Specified JVM feature 'jvmci' requires feature 'compiler2' or 'compiler1'])
fi fi
if HOTSPOT_CHECK_JVM_FEATURE(compiler2) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then if HOTSPOT_CHECK_JVM_FEATURE(cmsgc) && ! HOTSPOT_CHECK_JVM_FEATURE(serialgc); then
AC_MSG_ERROR([Specified JVM feature 'compiler2' requires feature 'all-gcs']) AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
fi
if HOTSPOT_CHECK_JVM_FEATURE(vm-structs) && ! HOTSPOT_CHECK_JVM_FEATURE(all-gcs); then
AC_MSG_ERROR([Specified JVM feature 'vm-structs' requires feature 'all-gcs'])
fi fi
# Turn on additional features based on other parts of configure # Turn on additional features based on other parts of configure
@ -395,7 +391,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi fi
# All variants but minimal (and custom) get these features # All variants but minimal (and custom) get these features
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES jvmti vm-structs jni-check services management all-gcs nmt" NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cmsgc g1gc parallelgc serialgc jni-check jvmti management nmt services vm-structs"
if test "x$ENABLE_CDS" = "xtrue"; then if test "x$ENABLE_CDS" = "xtrue"; then
NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds" NON_MINIMAL_FEATURES="$NON_MINIMAL_FEATURES cds"
fi fi
@ -404,7 +400,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal" JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci" JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal $JVM_FEATURES $JVM_FEATURES_link_time_opt" JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES" JVM_FEATURES_zero="zero $NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_custom="$JVM_FEATURES" JVM_FEATURES_custom="$JVM_FEATURES"
@ -442,6 +438,12 @@ AC_DEFUN_ONCE([HOTSPOT_FINALIZE_JVM_FEATURES],
eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"' eval $features_var_name='"'$JVM_FEATURES_FOR_VARIANT'"'
AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"]) AC_MSG_RESULT(["$JVM_FEATURES_FOR_VARIANT"])
# Verify that we have at least one gc selected
GC_FEATURES=`$ECHO $JVM_FEATURES_FOR_VARIANT | $GREP gc`
if test "x$GC_FEATURES" = x; then
AC_MSG_WARN([Invalid JVM features: No gc selected for variant $variant.])
fi
# Validate features (for configure script errors, not user errors) # Validate features (for configure script errors, not user errors)
BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES) BASIC_GET_NON_MATCHING_VALUES(INVALID_FEATURES, $JVM_FEATURES_FOR_VARIANT, $VALID_JVM_FEATURES)
if test "x$INVALID_FEATURES" != x; then if test "x$INVALID_FEATURES" != x; then

View File

@ -77,9 +77,14 @@ ifeq ($(call check-jvm-feature, dtrace), true)
vmGCOperations.o \ vmGCOperations.o \
) )
ifeq ($(call check-jvm-feature, all-gcs), true) ifeq ($(call check-jvm-feature, cmsgc), true)
DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \ DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \
vmCMSOperations.o \ vmCMSOperations.o \
)
endif
ifeq ($(call check-jvm-feature, parallelgc), true)
DTRACE_INSTRUMENTED_OBJS += $(addprefix $(JVM_OUTPUTDIR)/objs/, \
vmPSOperations.o \ vmPSOperations.o \
) )
endif endif

View File

@ -118,19 +118,6 @@ ifneq ($(call check-jvm-feature, cds), true)
# #
endif endif
ifneq ($(call check-jvm-feature, all-gcs), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_ALL_GCS=0
JVM_EXCLUDE_PATTERNS += \
cms/ g1/ parallel/
JVM_EXCLUDE_FILES += \
concurrentGCThread.cpp \
suspendibleThreadSet.cpp \
plab.cpp
JVM_EXCLUDE_FILES += \
g1MemoryPool.cpp \
psMemoryPool.cpp
endif
ifneq ($(call check-jvm-feature, nmt), true) ifneq ($(call check-jvm-feature, nmt), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_NMT=0 JVM_CFLAGS_FEATURES += -DINCLUDE_NMT=0
JVM_EXCLUDE_FILES += \ JVM_EXCLUDE_FILES += \
@ -144,6 +131,28 @@ ifneq ($(call check-jvm-feature, aot), true)
compiledIC_aot_x86_64.cpp compilerRuntime.cpp \ compiledIC_aot_x86_64.cpp compilerRuntime.cpp \
aotCodeHeap.cpp aotCompiledMethod.cpp aotLoader.cpp compiledIC_aot.cpp aotCodeHeap.cpp aotCompiledMethod.cpp aotLoader.cpp compiledIC_aot.cpp
endif endif
ifneq ($(call check-jvm-feature, cmsgc), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_CMSGC=0
JVM_EXCLUDE_PATTERNS += gc/cms
endif
ifneq ($(call check-jvm-feature, g1gc), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_G1GC=0
JVM_EXCLUDE_PATTERNS += gc/g1
endif
ifneq ($(call check-jvm-feature, parallelgc), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_PARALLELGC=0
JVM_EXCLUDE_PATTERNS += gc/parallel
endif
ifneq ($(call check-jvm-feature, serialgc), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_SERIALGC=0
JVM_EXCLUDE_PATTERNS += gc/serial
# If serial is disabled, we cannot use serial as OldGC in parallel
JVM_EXCLUDE_FILES += psMarkSweep.cpp psMarkSweepDecorator.cpp
endif
################################################################################ ################################################################################
ifeq ($(call check-jvm-feature, link-time-opt), true) ifeq ($(call check-jvm-feature, link-time-opt), true)

View File

@ -49,11 +49,6 @@
#include "runtime/jniHandles.inline.hpp" #include "runtime/jniHandles.inline.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/heapRegion.hpp"
#endif
#ifdef PRODUCT #ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */ #define BLOCK_COMMENT(str) /* nothing */

View File

@ -781,23 +781,6 @@ public:
void resolve_jobject(Register value, Register thread, Register tmp); void resolve_jobject(Register value, Register thread, Register tmp);
#if INCLUDE_ALL_GCS
void g1_write_barrier_pre(Register obj,
Register pre_val,
Register thread,
Register tmp,
bool tosca_live,
bool expand_call);
void g1_write_barrier_post(Register store_addr,
Register new_val,
Register thread,
Register tmp,
Register tmp2);
#endif // INCLUDE_ALL_GCS
// oop manipulations // oop manipulations
void load_klass(Register dst, Register src); void load_klass(Register dst, Register src);
void store_klass(Register dst, Register src); void store_klass(Register dst, Register src);

View File

@ -42,10 +42,6 @@
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/hashtable.hpp" #include "utilities/hashtable.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
int AbstractAssembler::code_fill_byte() { int AbstractAssembler::code_fill_byte() {
return 0xff; // illegal instruction 0xffffffff return 0xff; // illegal instruction 0xffffffff

View File

@ -42,10 +42,6 @@
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/hashtable.hpp" #include "utilities/hashtable.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
#ifdef COMPILER2 #ifdef COMPILER2
// Convert the raw encoding form into the form expected by the // Convert the raw encoding form into the form expected by the

View File

@ -42,10 +42,6 @@
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/hashtable.hpp" #include "utilities/hashtable.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
// Returns whether given imm has equal bit fields <0:size-1> and <size:2*size-1>. // Returns whether given imm has equal bit fields <0:size-1> and <size:2*size-1>.
inline bool Assembler::LogicalImmediate::has_equal_subpatterns(uintx imm, int size) { inline bool Assembler::LogicalImmediate::has_equal_subpatterns(uintx imm, int size) {

View File

@ -43,11 +43,6 @@
#include "runtime/frame.inline.hpp" #include "runtime/frame.inline.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
//-------------------------------------------------------------------- //--------------------------------------------------------------------
// Implementation of InterpreterMacroAssembler // Implementation of InterpreterMacroAssembler

View File

@ -37,10 +37,6 @@
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
#ifdef PRODUCT #ifdef PRODUCT
#define BLOCK_COMMENT(str) // nothing #define BLOCK_COMMENT(str) // nothing

View File

@ -38,10 +38,6 @@
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif
// Convention: Use Z_R0 and Z_R1 instead of Z_scratch_* in all // Convention: Use Z_R0 and Z_R1 instead of Z_scratch_* in all
// assembler_s390.* files. // assembler_s390.* files.

View File

@ -36,10 +36,6 @@
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
#ifdef PRODUCT #ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */ #define BLOCK_COMMENT(str) /* nothing */

View File

@ -37,10 +37,6 @@
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp" #include "runtime/stubRoutines.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS
int AbstractAssembler::code_fill_byte() { int AbstractAssembler::code_fill_byte() {
return 0; return 0;

View File

@ -65,7 +65,7 @@ address CppInterpreterGenerator::generate_accessor_entry() {
} }
address CppInterpreterGenerator::generate_Reference_get_entry(void) { address CppInterpreterGenerator::generate_Reference_get_entry(void) {
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
if (UseG1GC) { if (UseG1GC) {
// We need to generate have a routine that generates code to: // We need to generate have a routine that generates code to:
// * load the value in the referent field // * load the value in the referent field
@ -77,7 +77,7 @@ address CppInterpreterGenerator::generate_Reference_get_entry(void) {
// field as live. // field as live.
Unimplemented(); Unimplemented();
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
// If G1 is not enabled then attempt to go through the normal entry point // If G1 is not enabled then attempt to go through the normal entry point
// Reference.get could be instrumented by jvmti // Reference.get could be instrumented by jvmti

View File

@ -23,6 +23,7 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "logging/log.hpp"
#include "runtime/interfaceSupport.inline.hpp" #include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "services/attachListener.hpp" #include "services/attachListener.hpp"

View File

@ -421,9 +421,11 @@ void AOTCodeHeap::link_graal_runtime_symbols() {
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_new_multi_array", address, JVMCIRuntime::new_multi_array); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_new_multi_array", address, JVMCIRuntime::new_multi_array);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_dynamic_new_array", address, JVMCIRuntime::dynamic_new_array); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_dynamic_new_array", address, JVMCIRuntime::dynamic_new_array);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_validate_object", address, JVMCIRuntime::validate_object); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_validate_object", address, JVMCIRuntime::validate_object);
#if INCLUDE_G1GC
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_write_barrier_pre", address, JVMCIRuntime::write_barrier_pre); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_write_barrier_pre", address, JVMCIRuntime::write_barrier_pre);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_identity_hash_code", address, JVMCIRuntime::identity_hash_code);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_write_barrier_post", address, JVMCIRuntime::write_barrier_post); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_write_barrier_post", address, JVMCIRuntime::write_barrier_post);
#endif
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_identity_hash_code", address, JVMCIRuntime::identity_hash_code);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_dynamic_new_instance", address, JVMCIRuntime::dynamic_new_instance); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_dynamic_new_instance", address, JVMCIRuntime::dynamic_new_instance);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_thread_is_interrupted", address, JVMCIRuntime::thread_is_interrupted); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_thread_is_interrupted", address, JVMCIRuntime::thread_is_interrupted);
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_exception_handler_for_pc", address, JVMCIRuntime::exception_handler_for_pc); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_jvmci_runtime_exception_handler_for_pc", address, JVMCIRuntime::exception_handler_for_pc);
@ -552,7 +554,9 @@ void AOTCodeHeap::link_global_lib_symbols() {
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page());
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_klass_base_address", address, Universe::narrow_klass_base()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_klass_base_address", address, Universe::narrow_klass_base());
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_oop_base_address", address, Universe::narrow_oop_base()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_narrow_oop_base_address", address, Universe::narrow_oop_base());
#if INCLUDE_G1GC
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_log_of_heap_region_grain_bytes", int, HeapRegion::LogOfHRGrainBytes); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_log_of_heap_region_grain_bytes", int, HeapRegion::LogOfHRGrainBytes);
#endif
SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_inline_contiguous_allocation_supported", bool, heap->supports_inline_contig_alloc()); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_inline_contiguous_allocation_supported", bool, heap->supports_inline_contig_alloc());
link_shared_runtime_symbols(); link_shared_runtime_symbols();
link_stub_routines_symbols(); link_stub_routines_symbols();

View File

@ -37,8 +37,6 @@
#include "classfile/systemDictionary.hpp" #include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp" #include "classfile/vmSymbols.hpp"
#include "compiler/compileBroker.hpp" #include "compiler/compileBroker.hpp"
#include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/generation.hpp"
#include "interpreter/bytecodeStream.hpp" #include "interpreter/bytecodeStream.hpp"
#include "interpreter/oopMapCache.hpp" #include "interpreter/oopMapCache.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"

View File

@ -44,7 +44,7 @@
#include "services/diagnosticCommand.hpp" #include "services/diagnosticCommand.hpp"
#include "utilities/hashtable.inline.hpp" #include "utilities/hashtable.inline.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedup.hpp"
#endif #endif
@ -260,7 +260,7 @@ oop StringTable::intern(Handle string_or_null, jchar* name,
string = java_lang_String::create_from_unicode(name, len, CHECK_NULL); string = java_lang_String::create_from_unicode(name, len, CHECK_NULL);
} }
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
if (G1StringDedup::is_enabled()) { if (G1StringDedup::is_enabled()) {
// Deduplicate the string before it is interned. Note that we should never // Deduplicate the string before it is interned. Note that we should never
// deduplicate a string after it has been interned. Doing so will counteract // deduplicate a string after it has been interned. Doing so will counteract

View File

@ -29,7 +29,6 @@
#include "classfile/symbolTable.hpp" #include "classfile/symbolTable.hpp"
#include "classfile/systemDictionary.hpp" #include "classfile/systemDictionary.hpp"
#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/gcLocker.hpp"
#include "memory/allocation.inline.hpp" #include "memory/allocation.inline.hpp"
#include "memory/filemap.hpp" #include "memory/filemap.hpp"
#include "memory/metaspaceClosure.hpp" #include "memory/metaspaceClosure.hpp"

View File

@ -21,7 +21,6 @@
// questions. // questions.
// //
#include "precompiled.hpp" #include "precompiled.hpp"
#include "compiler/abstractCompiler.hpp" #include "compiler/abstractCompiler.hpp"
#include "compiler/compileBroker.hpp" #include "compiler/compileBroker.hpp"

View File

@ -69,7 +69,6 @@ class FreeChunk;
class ParNewGeneration; class ParNewGeneration;
class PromotionInfo; class PromotionInfo;
class ScanMarkedObjectsAgainCarefullyClosure; class ScanMarkedObjectsAgainCarefullyClosure;
class TenuredGeneration;
class SerialOldTracer; class SerialOldTracer;
// A generic CMS bit map. It's the basis for both the CMS marking bit map // A generic CMS bit map. It's the basis for both the CMS marking bit map

View File

@ -81,11 +81,9 @@ void G1Arguments::initialize() {
vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL); vm_exit_during_initialization("The flag -XX:+UseG1GC can not be combined with -XX:ParallelGCThreads=0", NULL);
} }
#if INCLUDE_ALL_GCS
if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) { if (FLAG_IS_DEFAULT(G1ConcRefinementThreads)) {
FLAG_SET_ERGO(uint, G1ConcRefinementThreads, ParallelGCThreads); FLAG_SET_ERGO(uint, G1ConcRefinementThreads, ParallelGCThreads);
} }
#endif
// MarkStackSize will be set (if it hasn't been set by the user) // MarkStackSize will be set (if it hasn't been set by the user)
// when concurrent marking is initialized. // when concurrent marking is initialized.

View File

@ -36,6 +36,7 @@
class ConcurrentGCTimer; class ConcurrentGCTimer;
class G1ConcurrentMarkThread; class G1ConcurrentMarkThread;
class G1CollectedHeap; class G1CollectedHeap;
class G1CMOopClosure;
class G1CMTask; class G1CMTask;
class G1ConcurrentMark; class G1ConcurrentMark;
class G1OldTracer; class G1OldTracer;

View File

@ -24,6 +24,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/g1/g1FullGCMarker.inline.hpp" #include "gc/g1/g1FullGCMarker.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) : G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) :
_worker_id(worker_id), _worker_id(worker_id),

View File

@ -26,6 +26,7 @@
#include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1MonitoringSupport.hpp" #include "gc/g1/g1MonitoringSupport.hpp"
#include "gc/g1/g1Policy.hpp" #include "gc/g1/g1Policy.hpp"
#include "gc/shared/collectorCounters.hpp"
#include "gc/shared/hSpaceCounters.hpp" #include "gc/shared/hSpaceCounters.hpp"
#include "memory/metaspaceCounters.hpp" #include "memory/metaspaceCounters.hpp"

View File

@ -38,6 +38,7 @@
#include "gc/g1/g1RootClosures.hpp" #include "gc/g1/g1RootClosures.hpp"
#include "gc/g1/g1RootProcessor.hpp" #include "gc/g1/g1RootProcessor.hpp"
#include "gc/g1/heapRegion.inline.hpp" #include "gc/g1/heapRegion.inline.hpp"
#include "gc/shared/referenceProcessor.hpp"
#include "gc/shared/weakProcessor.hpp" #include "gc/shared/weakProcessor.hpp"
#include "memory/allocation.inline.hpp" #include "memory/allocation.inline.hpp"
#include "runtime/mutex.hpp" #include "runtime/mutex.hpp"

View File

@ -31,7 +31,7 @@
#include "gc/parallel/objectStartArray.inline.hpp" #include "gc/parallel/objectStartArray.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.inline.hpp" #include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp"
#include "gc/parallel/psMarkSweep.hpp" #include "gc/parallel/psMarkSweepProxy.hpp"
#include "gc/parallel/psMemoryPool.hpp" #include "gc/parallel/psMemoryPool.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psPromotionManager.hpp"
@ -48,6 +48,7 @@
#include "runtime/vmThread.hpp" #include "runtime/vmThread.hpp"
#include "services/memoryManager.hpp" #include "services/memoryManager.hpp"
#include "services/memTracker.hpp" #include "services/memTracker.hpp"
#include "utilities/macros.hpp"
#include "utilities/vmError.hpp" #include "utilities/vmError.hpp"
PSYoungGen* ParallelScavengeHeap::_young_gen = NULL; PSYoungGen* ParallelScavengeHeap::_young_gen = NULL;
@ -155,7 +156,7 @@ void ParallelScavengeHeap::post_initialize() {
if (UseParallelOldGC) { if (UseParallelOldGC) {
PSParallelCompact::post_initialize(); PSParallelCompact::post_initialize();
} else { } else {
PSMarkSweep::initialize(); PSMarkSweepProxy::initialize();
} }
PSPromotionManager::initialize(); PSPromotionManager::initialize();
} }
@ -406,7 +407,7 @@ void ParallelScavengeHeap::do_full_collection(bool clear_all_soft_refs) {
bool maximum_compaction = clear_all_soft_refs; bool maximum_compaction = clear_all_soft_refs;
PSParallelCompact::invoke(maximum_compaction); PSParallelCompact::invoke(maximum_compaction);
} else { } else {
PSMarkSweep::invoke(clear_all_soft_refs); PSMarkSweepProxy::invoke(clear_all_soft_refs);
} }
} }
@ -545,7 +546,7 @@ bool ParallelScavengeHeap::block_is_obj(const HeapWord* addr) const {
jlong ParallelScavengeHeap::millis_since_last_gc() { jlong ParallelScavengeHeap::millis_since_last_gc() {
return UseParallelOldGC ? return UseParallelOldGC ?
PSParallelCompact::millis_since_last_gc() : PSParallelCompact::millis_since_last_gc() :
PSMarkSweep::millis_since_last_gc(); PSMarkSweepProxy::millis_since_last_gc();
} }
void ParallelScavengeHeap::prepare_for_verify() { void ParallelScavengeHeap::prepare_for_verify() {
@ -602,7 +603,7 @@ void ParallelScavengeHeap::print_tracing_info() const {
AdaptiveSizePolicyOutput::print(); AdaptiveSizePolicyOutput::print();
log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds()); log_debug(gc, heap, exit)("Accumulated young generation GC time %3.7f secs", PSScavenge::accumulated_time()->seconds());
log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs", log_debug(gc, heap, exit)("Accumulated old generation GC time %3.7f secs",
UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweep::accumulated_time()->seconds()); UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweepProxy::accumulated_time()->seconds());
} }

View File

@ -26,13 +26,13 @@
#define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_INLINE_HPP #define SHARE_VM_GC_PARALLEL_PARALLELSCAVENGEHEAP_INLINE_HPP
#include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psMarkSweep.hpp" #include "gc/parallel/psMarkSweepProxy.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/psScavenge.hpp" #include "gc/parallel/psScavenge.hpp"
inline size_t ParallelScavengeHeap::total_invocations() { inline size_t ParallelScavengeHeap::total_invocations() {
return UseParallelOldGC ? PSParallelCompact::total_invocations() : return UseParallelOldGC ? PSParallelCompact::total_invocations() :
PSMarkSweep::total_invocations(); PSMarkSweepProxy::total_invocations();
} }
inline bool ParallelScavengeHeap::should_alloc_in_eden(const size_t size) const { inline bool ParallelScavengeHeap::should_alloc_in_eden(const size_t size) const {

View File

@ -0,0 +1,53 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#ifndef SHARE_GC_PARALLEL_PSMARKSWEEPPROXY_HPP
#define SHARE_GC_PARALLEL_PSMARKSWEEPPROXY_HPP
#include "utilities/macros.hpp"
#if INCLUDE_SERIALGC
#include "gc/parallel/psMarkSweep.hpp"
#endif
#if INCLUDE_SERIALGC
namespace PSMarkSweepProxy {
inline void initialize() { PSMarkSweep::initialize(); }
inline void invoke(bool maximum_heap_compaction) { PSMarkSweep::invoke(maximum_heap_compaction); }
inline bool invoke_no_policy(bool clear_all_softrefs) { return PSMarkSweep::invoke_no_policy(clear_all_softrefs); }
inline jlong millis_since_last_gc() { return PSMarkSweep::millis_since_last_gc(); }
inline elapsedTimer* accumulated_time() { return PSMarkSweep::accumulated_time(); }
inline uint total_invocations() { return PSMarkSweep::total_invocations(); }
};
#else
namespace PSMarkSweepProxy {
inline void initialize() { fatal("Serial GC excluded from build"); }
inline void invoke(bool) { fatal("Serial GC excluded from build"); }
inline bool invoke_no_policy(bool) { fatal("Serial GC excluded from build"); return false;}
inline jlong millis_since_last_gc() { fatal("Serial GC excluded from build"); return 0L; }
inline elapsedTimer* accumulated_time() { fatal("Serial GC excluded from build"); return NULL; }
inline uint total_invocations() { fatal("Serial GC excluded from build"); return 0u; }
};
#endif
#endif // SHARE_GC_PARALLEL_PSMARKSWEEPPROXY_HPP

View File

@ -139,10 +139,13 @@ void PSOldGen::initialize_work(const char* perf_data_name, int level) {
SpaceDecorator::Clear, SpaceDecorator::Clear,
SpaceDecorator::Mangle); SpaceDecorator::Mangle);
#if INCLUDE_SERIALGC
_object_mark_sweep = new PSMarkSweepDecorator(_object_space, start_array(), MarkSweepDeadRatio); _object_mark_sweep = new PSMarkSweepDecorator(_object_space, start_array(), MarkSweepDeadRatio);
if (_object_mark_sweep == NULL) if (_object_mark_sweep == NULL) {
vm_exit_during_initialization("Could not complete allocation of old generation"); vm_exit_during_initialization("Could not complete allocation of old generation");
}
#endif // INCLUDE_SERIALGC
// Update the start_array // Update the start_array
start_array()->set_covered_region(cmr); start_array()->set_covered_region(cmr);
@ -163,6 +166,8 @@ bool PSOldGen::is_allocated() {
return virtual_space()->reserved_size() != 0; return virtual_space()->reserved_size() != 0;
} }
#if INCLUDE_SERIALGC
void PSOldGen::precompact() { void PSOldGen::precompact() {
ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); ParallelScavengeHeap* heap = ParallelScavengeHeap::heap();
@ -183,6 +188,8 @@ void PSOldGen::compact() {
object_mark_sweep()->compact(ZapUnusedHeapArea); object_mark_sweep()->compact(ZapUnusedHeapArea);
} }
#endif // INCLUDE_SERIALGC
size_t PSOldGen::contiguous_available() const { size_t PSOldGen::contiguous_available() const {
return object_space()->free_in_bytes() + virtual_space()->uncommitted_size(); return object_space()->free_in_bytes() + virtual_space()->uncommitted_size();
} }

View File

@ -45,7 +45,9 @@ class PSOldGen : public CHeapObj<mtGC> {
PSVirtualSpace* _virtual_space; // Controls mapping and unmapping of virtual mem PSVirtualSpace* _virtual_space; // Controls mapping and unmapping of virtual mem
ObjectStartArray _start_array; // Keeps track of where objects start in a 512b block ObjectStartArray _start_array; // Keeps track of where objects start in a 512b block
MutableSpace* _object_space; // Where all the objects live MutableSpace* _object_space; // Where all the objects live
#if INCLUDE_SERIALGC
PSMarkSweepDecorator* _object_mark_sweep; // The mark sweep view of _object_space PSMarkSweepDecorator* _object_mark_sweep; // The mark sweep view of _object_space
#endif
const char* const _name; // Name of this generation. const char* const _name; // Name of this generation.
// Performance Counters // Performance Counters
@ -150,17 +152,21 @@ class PSOldGen : public CHeapObj<mtGC> {
} }
MutableSpace* object_space() const { return _object_space; } MutableSpace* object_space() const { return _object_space; }
#if INCLUDE_SERIALGC
PSMarkSweepDecorator* object_mark_sweep() const { return _object_mark_sweep; } PSMarkSweepDecorator* object_mark_sweep() const { return _object_mark_sweep; }
#endif
ObjectStartArray* start_array() { return &_start_array; } ObjectStartArray* start_array() { return &_start_array; }
PSVirtualSpace* virtual_space() const { return _virtual_space;} PSVirtualSpace* virtual_space() const { return _virtual_space;}
// Has the generation been successfully allocated? // Has the generation been successfully allocated?
bool is_allocated(); bool is_allocated();
#if INCLUDE_SERIALGC
// MarkSweep methods // MarkSweep methods
virtual void precompact(); virtual void precompact();
void adjust_pointers(); void adjust_pointers();
void compact(); void compact();
#endif
// Size info // Size info
size_t capacity_in_bytes() const { return object_space()->capacity_in_bytes(); } size_t capacity_in_bytes() const { return object_space()->capacity_in_bytes(); }

View File

@ -34,8 +34,6 @@
#include "gc/parallel/pcTasks.hpp" #include "gc/parallel/pcTasks.hpp"
#include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp"
#include "gc/parallel/psCompactionManager.inline.hpp" #include "gc/parallel/psCompactionManager.inline.hpp"
#include "gc/parallel/psMarkSweep.hpp"
#include "gc/parallel/psMarkSweepDecorator.hpp"
#include "gc/parallel/psOldGen.hpp" #include "gc/parallel/psOldGen.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/psPromotionManager.inline.hpp" #include "gc/parallel/psPromotionManager.inline.hpp"
@ -72,6 +70,7 @@
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
#include "utilities/events.hpp" #include "utilities/events.hpp"
#include "utilities/formatBuffer.hpp" #include "utilities/formatBuffer.hpp"
#include "utilities/macros.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
#include <math.h> #include <math.h>

View File

@ -28,7 +28,7 @@
#include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/gcTaskManager.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp" #include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psAdaptiveSizePolicy.hpp" #include "gc/parallel/psAdaptiveSizePolicy.hpp"
#include "gc/parallel/psMarkSweep.hpp" #include "gc/parallel/psMarkSweepProxy.hpp"
#include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/parallel/psParallelCompact.inline.hpp"
#include "gc/parallel/psScavenge.inline.hpp" #include "gc/parallel/psScavenge.inline.hpp"
#include "gc/parallel/psTasks.hpp" #include "gc/parallel/psTasks.hpp"
@ -235,7 +235,7 @@ bool PSScavenge::invoke() {
if (UseParallelOldGC) { if (UseParallelOldGC) {
full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs); full_gc_done = PSParallelCompact::invoke_no_policy(clear_all_softrefs);
} else { } else {
full_gc_done = PSMarkSweep::invoke_no_policy(clear_all_softrefs); full_gc_done = PSMarkSweepProxy::invoke_no_policy(clear_all_softrefs);
} }
} }

View File

@ -27,7 +27,6 @@
#include "classfile/systemDictionary.hpp" #include "classfile/systemDictionary.hpp"
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/gcTaskManager.hpp"
#include "gc/parallel/psMarkSweep.hpp"
#include "gc/parallel/psCardTable.hpp" #include "gc/parallel/psCardTable.hpp"
#include "gc/parallel/psPromotionManager.hpp" #include "gc/parallel/psPromotionManager.hpp"
#include "gc/parallel/psPromotionManager.inline.hpp" #include "gc/parallel/psPromotionManager.inline.hpp"

View File

@ -730,6 +730,8 @@ void PSYoungGen::object_iterate(ObjectClosure* blk) {
to_space()->object_iterate(blk); to_space()->object_iterate(blk);
} }
#if INCLUDE_SERIALGC
void PSYoungGen::precompact() { void PSYoungGen::precompact() {
eden_mark_sweep()->precompact(); eden_mark_sweep()->precompact();
from_mark_sweep()->precompact(); from_mark_sweep()->precompact();
@ -749,6 +751,8 @@ void PSYoungGen::compact() {
to_mark_sweep()->compact(false); to_mark_sweep()->compact(false);
} }
#endif // INCLUDE_SERIALGC
void PSYoungGen::print() const { print_on(tty); } void PSYoungGen::print() const { print_on(tty); }
void PSYoungGen::print_on(outputStream* st) const { void PSYoungGen::print_on(outputStream* st) const {
st->print(" %-15s", "PSYoungGen"); st->print(" %-15s", "PSYoungGen");

View File

@ -123,9 +123,11 @@ class PSYoungGen : public CHeapObj<mtGC> {
PSMarkSweepDecorator* from_mark_sweep() const { return _from_mark_sweep; } PSMarkSweepDecorator* from_mark_sweep() const { return _from_mark_sweep; }
PSMarkSweepDecorator* to_mark_sweep() const { return _to_mark_sweep; } PSMarkSweepDecorator* to_mark_sweep() const { return _to_mark_sweep; }
#if INCLUDE_SERIALGC
void precompact(); void precompact();
void adjust_pointers(); void adjust_pointers();
void compact(); void compact();
#endif
// Called during/after GC // Called during/after GC
void swap_spaces(); void swap_spaces();

View File

@ -24,7 +24,6 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/parallel/parallelScavengeHeap.inline.hpp" #include "gc/parallel/parallelScavengeHeap.inline.hpp"
#include "gc/parallel/psMarkSweep.hpp"
#include "gc/parallel/psScavenge.hpp" #include "gc/parallel/psScavenge.hpp"
#include "gc/parallel/vmPSOperations.hpp" #include "gc/parallel/vmPSOperations.hpp"
#include "gc/shared/gcLocker.hpp" #include "gc/shared/gcLocker.hpp"

View File

@ -56,7 +56,7 @@
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/parOopClosures.hpp" #include "gc/cms/parOopClosures.hpp"
#endif #endif
@ -1006,7 +1006,7 @@ HeapWord* DefNewGeneration::allocate(size_t word_size, bool is_tlab) {
// have to use it here, as well. // have to use it here, as well.
HeapWord* result = eden()->par_allocate(word_size); HeapWord* result = eden()->par_allocate(word_size);
if (result != NULL) { if (result != NULL) {
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
if (CMSEdenChunksRecordAlways && _old_gen != NULL) { if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
_old_gen->sample_eden_chunk(); _old_gen->sample_eden_chunk();
} }
@ -1024,7 +1024,7 @@ HeapWord* DefNewGeneration::allocate(size_t word_size, bool is_tlab) {
HeapWord* DefNewGeneration::par_allocate(size_t word_size, HeapWord* DefNewGeneration::par_allocate(size_t word_size,
bool is_tlab) { bool is_tlab) {
HeapWord* res = eden()->par_allocate(word_size); HeapWord* res = eden()->par_allocate(word_size);
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
if (CMSEdenChunksRecordAlways && _old_gen != NULL) { if (CMSEdenChunksRecordAlways && _old_gen != NULL) {
_old_gen->sample_eden_chunk(); _old_gen->sample_eden_chunk();
} }

View File

@ -39,7 +39,7 @@
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/parOopClosures.hpp" #include "gc/cms/parOopClosures.hpp"
#endif #endif

View File

@ -32,7 +32,14 @@
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field) \ static_field) \
nonstatic_field(TenuredGeneration, _min_heap_delta_bytes, size_t) \ nonstatic_field(TenuredGeneration, _min_heap_delta_bytes, size_t) \
nonstatic_field(TenuredGeneration, _the_space, ContiguousSpace*) nonstatic_field(TenuredGeneration, _the_space, ContiguousSpace*) \
\
nonstatic_field(DefNewGeneration, _old_gen, Generation*) \
nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \
nonstatic_field(DefNewGeneration, _age_table, AgeTable) \
nonstatic_field(DefNewGeneration, _eden_space, ContiguousSpace*) \
nonstatic_field(DefNewGeneration, _from_space, ContiguousSpace*) \
nonstatic_field(DefNewGeneration, _to_space, ContiguousSpace*)
#define VM_TYPES_SERIALGC(declare_type, \ #define VM_TYPES_SERIALGC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
@ -41,6 +48,8 @@
declare_type(TenuredGeneration, CardGeneration) \ declare_type(TenuredGeneration, CardGeneration) \
declare_type(TenuredSpace, OffsetTableContigSpace) \ declare_type(TenuredSpace, OffsetTableContigSpace) \
\ \
declare_type(DefNewGeneration, Generation) \
\
declare_toplevel_type(TenuredGeneration*) declare_toplevel_type(TenuredGeneration*)
#define VM_INT_CONSTANTS_SERIALGC(declare_constant, \ #define VM_INT_CONSTANTS_SERIALGC(declare_constant, \

View File

@ -27,17 +27,10 @@
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS
#define FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f) \
f(G1BarrierSet)
#else
#define FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f)
#endif
// Do something for each concrete barrier set part of the build. // Do something for each concrete barrier set part of the build.
#define FOR_EACH_CONCRETE_BARRIER_SET_DO(f) \ #define FOR_EACH_CONCRETE_BARRIER_SET_DO(f) \
f(CardTableBarrierSet) \ f(CardTableBarrierSet) \
FOR_EACH_CONCRETE_INCLUDE_ALL_GC_BARRIER_SET_DO(f) G1GC_ONLY(f(G1BarrierSet))
#define FOR_EACH_ABSTRACT_BARRIER_SET_DO(f) \ #define FOR_EACH_ABSTRACT_BARRIER_SET_DO(f) \
f(ModRef) f(ModRef)

View File

@ -30,7 +30,7 @@
#include "gc/shared/modRefBarrierSet.inline.hpp" #include "gc/shared/modRefBarrierSet.inline.hpp"
#include "gc/shared/cardTableBarrierSet.inline.hpp" #include "gc/shared/cardTableBarrierSet.inline.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1BarrierSet.inline.hpp" // G1 support #include "gc/g1/g1BarrierSet.inline.hpp" // G1 support
#endif #endif

View File

@ -153,14 +153,14 @@ class BlockOffsetSharedArray: public CHeapObj<mtGC> {
void fill_range(size_t start, size_t num_cards, u_char offset) { void fill_range(size_t start, size_t num_cards, u_char offset) {
void* start_ptr = &_offset_array[start]; void* start_ptr = &_offset_array[start];
#if INCLUDE_ALL_GCS
// If collector is concurrent, special handling may be needed. // If collector is concurrent, special handling may be needed.
assert(!UseG1GC, "Shouldn't be here when using G1"); G1GC_ONLY(assert(!UseG1GC, "Shouldn't be here when using G1");)
#if INCLUDE_CMSGC
if (UseConcMarkSweepGC) { if (UseConcMarkSweepGC) {
memset_with_concurrent_readers(start_ptr, offset, num_cards); memset_with_concurrent_readers(start_ptr, offset, num_cards);
return; return;
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_CMSGC
memset(start_ptr, offset, num_cards); memset(start_ptr, offset, num_cards);
} }

View File

@ -208,7 +208,7 @@ void CardGeneration::compute_new_size() {
const size_t free_after_gc = free(); const size_t free_after_gc = free();
const double free_percentage = ((double)free_after_gc) / capacity_after_gc; const double free_percentage = ((double)free_after_gc) / capacity_after_gc;
log_trace(gc, heap)("TenuredGeneration::compute_new_size:"); log_trace(gc, heap)("CardGeneration::compute_new_size:");
log_trace(gc, heap)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f", log_trace(gc, heap)(" minimum_free_percentage: %6.2f maximum_used_percentage: %6.2f",
minimum_free_percentage, minimum_free_percentage,
maximum_used_percentage); maximum_used_percentage);

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
#include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genCollectedHeap.hpp"
#include "gc/shared/genOopClosures.hpp"
#include "gc/shared/generation.hpp" #include "gc/shared/generation.hpp"
#include "gc/shared/space.inline.hpp" #include "gc/shared/space.inline.hpp"
#include "memory/allocation.inline.hpp" #include "memory/allocation.inline.hpp"

View File

@ -45,13 +45,13 @@ void CollectedHeap::post_allocation_setup_common(Klass* klass,
HeapWord* obj_ptr) { HeapWord* obj_ptr) {
post_allocation_setup_no_klass_install(klass, obj_ptr); post_allocation_setup_no_klass_install(klass, obj_ptr);
oop obj = (oop)obj_ptr; oop obj = (oop)obj_ptr;
#if ! INCLUDE_ALL_GCS #if (INCLUDE_G1GC || INCLUDE_CMSGC)
obj->set_klass(klass);
#else
// Need a release store to ensure array/class length, mark word, and // Need a release store to ensure array/class length, mark word, and
// object zeroing are visible before setting the klass non-NULL, for // object zeroing are visible before setting the klass non-NULL, for
// concurrent collectors. // concurrent collectors.
obj->release_set_klass(klass); obj->release_set_klass(klass);
#else
obj->set_klass(klass);
#endif #endif
} }

View File

@ -48,11 +48,8 @@
// Forward declarations. // Forward declarations.
class GenCollectorPolicy; class GenCollectorPolicy;
class AdaptiveSizePolicy; class AdaptiveSizePolicy;
#if INCLUDE_ALL_GCS
class ConcurrentMarkSweepPolicy; class ConcurrentMarkSweepPolicy;
class G1CollectorPolicy; class G1CollectorPolicy;
#endif // INCLUDE_ALL_GCS
class MarkSweepPolicy; class MarkSweepPolicy;
class CollectorPolicy : public CHeapObj<mtGC> { class CollectorPolicy : public CHeapObj<mtGC> {

View File

@ -23,16 +23,23 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/serial/serialArguments.hpp"
#include "gc/shared/gcConfig.hpp" #include "gc/shared/gcConfig.hpp"
#include "runtime/globals_extension.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/parallel/parallelArguments.hpp"
#include "gc/cms/cmsArguments.hpp" #include "gc/cms/cmsArguments.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/g1Arguments.hpp" #include "gc/g1/g1Arguments.hpp"
#endif // INCLUDE_ALL_GCS #endif
#if INCLUDE_PARALLELGC
#include "gc/parallel/parallelArguments.hpp"
#endif
#if INCLUDE_SERIALGC
#include "gc/serial/serialArguments.hpp"
#endif
struct SupportedGC { struct SupportedGC {
bool& _flag; bool& _flag;
@ -44,23 +51,19 @@ struct SupportedGC {
_flag(flag), _name(name), _arguments(arguments), _hs_err_name(hs_err_name) {} _flag(flag), _name(name), _arguments(arguments), _hs_err_name(hs_err_name) {}
}; };
static SerialArguments serialArguments; CMSGC_ONLY(static CMSArguments cmsArguments;)
#if INCLUDE_ALL_GCS G1GC_ONLY(static G1Arguments g1Arguments;)
static ParallelArguments parallelArguments; PARALLELGC_ONLY(static ParallelArguments parallelArguments;)
static CMSArguments cmsArguments; SERIALGC_ONLY(static SerialArguments serialArguments;)
static G1Arguments g1Arguments;
#endif // INCLUDE_ALL_GCS
// Table of supported GCs, for translating between command // Table of supported GCs, for translating between command
// line flag, CollectedHeap::Name and GCArguments instance. // line flag, CollectedHeap::Name and GCArguments instance.
static const SupportedGC SupportedGCs[] = { static const SupportedGC SupportedGCs[] = {
SupportedGC(UseSerialGC, CollectedHeap::Serial, serialArguments, "serial gc"), CMSGC_ONLY_ARG(SupportedGC(UseConcMarkSweepGC, CollectedHeap::CMS, cmsArguments, "concurrent mark sweep gc"))
#if INCLUDE_ALL_GCS G1GC_ONLY_ARG(SupportedGC(UseG1GC, CollectedHeap::G1, g1Arguments, "g1 gc"))
SupportedGC(UseParallelGC, CollectedHeap::Parallel, parallelArguments, "parallel gc"), PARALLELGC_ONLY_ARG(SupportedGC(UseParallelGC, CollectedHeap::Parallel, parallelArguments, "parallel gc"))
SupportedGC(UseParallelOldGC, CollectedHeap::Parallel, parallelArguments, "parallel gc"), PARALLELGC_ONLY_ARG(SupportedGC(UseParallelOldGC, CollectedHeap::Parallel, parallelArguments, "parallel gc"))
SupportedGC(UseConcMarkSweepGC, CollectedHeap::CMS, cmsArguments, "concurrent mark sweep gc"), SERIALGC_ONLY_ARG(SupportedGC(UseSerialGC, CollectedHeap::Serial, serialArguments, "serial gc"))
SupportedGC(UseG1GC, CollectedHeap::G1, g1Arguments, "g1 gc"),
#endif // INCLUDE_ALL_GCS
}; };
#define FOR_EACH_SUPPORTED_GC(var) \ #define FOR_EACH_SUPPORTED_GC(var) \
@ -70,19 +73,25 @@ GCArguments* GCConfig::_arguments = NULL;
bool GCConfig::_gc_selected_ergonomically = false; bool GCConfig::_gc_selected_ergonomically = false;
void GCConfig::select_gc_ergonomically() { void GCConfig::select_gc_ergonomically() {
#if INCLUDE_ALL_GCS
if (os::is_server_class_machine()) { if (os::is_server_class_machine()) {
#if INCLUDE_G1GC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true);
#elif INCLUDE_PARALLELGC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true);
#elif INCLUDE_SERIALGC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
#endif
} else { } else {
#if INCLUDE_SERIALGC
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true);
#endif
} }
#else
UNSUPPORTED_OPTION(UseG1GC); NOT_CMSGC( UNSUPPORTED_OPTION(UseConcMarkSweepGC));
UNSUPPORTED_OPTION(UseParallelGC); NOT_G1GC( UNSUPPORTED_OPTION(UseG1GC);)
UNSUPPORTED_OPTION(UseParallelOldGC); NOT_PARALLELGC(UNSUPPORTED_OPTION(UseParallelGC);)
UNSUPPORTED_OPTION(UseConcMarkSweepGC); NOT_PARALLELGC(UNSUPPORTED_OPTION(UseParallelOldGC));
FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); NOT_SERIALGC( UNSUPPORTED_OPTION(UseSerialGC);)
#endif // INCLUDE_ALL_GCS
} }
bool GCConfig::is_no_gc_selected() { bool GCConfig::is_no_gc_selected() {
@ -128,17 +137,25 @@ GCArguments* GCConfig::select_gc() {
_gc_selected_ergonomically = true; _gc_selected_ergonomically = true;
} }
if (is_exactly_one_gc_selected()) { if (!is_exactly_one_gc_selected()) {
// Exacly one GC selected // More than one GC selected
vm_exit_during_initialization("Multiple garbage collectors selected", NULL);
}
#if INCLUDE_PARALLELGC && !INCLUDE_SERIALGC
if (FLAG_IS_CMDLINE(UseParallelOldGC) && !UseParallelOldGC) {
vm_exit_during_initialization("This JVM build only supports UseParallelOldGC as the full GC");
}
#endif
// Exactly one GC selected
FOR_EACH_SUPPORTED_GC(gc) { FOR_EACH_SUPPORTED_GC(gc) {
if (gc->_flag) { if (gc->_flag) {
return &gc->_arguments; return &gc->_arguments;
} }
} }
}
// More than one GC selected fatal("Should have found the selected GC");
vm_exit_during_initialization("Multiple garbage collectors selected", NULL);
return NULL; return NULL;
} }

View File

@ -36,7 +36,7 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#include "utilities/ticks.inline.hpp" #include "utilities/ticks.inline.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/evacuationInfo.hpp" #include "gc/g1/evacuationInfo.hpp"
#endif #endif
@ -184,7 +184,7 @@ void OldGCTracer::report_concurrent_mode_failure() {
send_concurrent_mode_failure_event(); send_concurrent_mode_failure_event();
} }
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) { void G1MMUTracer::report_mmu(double time_slice_sec, double gc_time_sec, double max_time_sec) {
send_g1_mmu_event(time_slice_sec * MILLIUNITS, send_g1_mmu_event(time_slice_sec * MILLIUNITS,
gc_time_sec * MILLIUNITS, gc_time_sec * MILLIUNITS,
@ -252,4 +252,4 @@ void G1OldTracer::set_gc_cause(GCCause::Cause cause) {
_shared_gc_info.set_cause(cause); _shared_gc_info.set_cause(cause);
} }
#endif #endif // INCLUDE_G1GC

View File

@ -34,7 +34,7 @@
#include "memory/referenceType.hpp" #include "memory/referenceType.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#include "utilities/ticks.hpp" #include "utilities/ticks.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1YCTypes.hpp" #include "gc/g1/g1YCTypes.hpp"
#endif #endif
@ -97,7 +97,7 @@ class ParallelOldGCInfo {
void* dense_prefix() const { return _dense_prefix; } void* dense_prefix() const { return _dense_prefix; }
}; };
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
class G1YoungGCInfo { class G1YoungGCInfo {
G1YCType _type; G1YCType _type;
@ -109,7 +109,7 @@ class G1YoungGCInfo {
G1YCType type() const { return _type; } G1YCType type() const { return _type; }
}; };
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
class GCTracer : public ResourceObj { class GCTracer : public ResourceObj {
protected: protected:
@ -232,7 +232,7 @@ class ParNewTracer : public YoungGCTracer {
ParNewTracer() : YoungGCTracer(ParNew) {} ParNewTracer() : YoungGCTracer(ParNew) {}
}; };
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
class G1MMUTracer : public AllStatic { class G1MMUTracer : public AllStatic {
static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms); static void send_g1_mmu_event(double time_slice_ms, double gc_time_ms, double max_time_ms);
@ -294,7 +294,7 @@ class G1FullGCTracer : public OldGCTracer {
G1FullGCTracer() : OldGCTracer(G1Full) {} G1FullGCTracer() : OldGCTracer(G1Full) {}
}; };
#endif #endif // INCLUDE_G1GC
class CMSTracer : public OldGCTracer { class CMSTracer : public OldGCTracer {
public: public:

View File

@ -31,11 +31,11 @@
#include "runtime/os.hpp" #include "runtime/os.hpp"
#include "trace/traceBackend.hpp" #include "trace/traceBackend.hpp"
#include "trace/tracing.hpp" #include "trace/tracing.hpp"
#include "tracefiles/traceEventClasses.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/evacuationInfo.hpp" #include "gc/g1/evacuationInfo.hpp"
#include "gc/g1/g1YCTypes.hpp" #include "gc/g1/g1YCTypes.hpp"
#include "tracefiles/traceEventClasses.hpp"
#endif #endif
// All GC dependencies against the trace framework is contained within this file. // All GC dependencies against the trace framework is contained within this file.
@ -188,7 +188,7 @@ void OldGCTracer::send_concurrent_mode_failure_event() {
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
void G1NewTracer::send_g1_young_gc_event() { void G1NewTracer::send_g1_young_gc_event() {
EventG1GarbageCollection e(UNTIMED); EventG1GarbageCollection e(UNTIMED);
if (e.should_commit()) { if (e.should_commit()) {
@ -311,7 +311,7 @@ void G1NewTracer::send_adaptive_ihop_statistics(size_t threshold,
} }
} }
#endif #endif // INCLUDE_G1GC
static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) { static TraceStructVirtualSpace to_trace_struct(const VirtualSpaceSummary& summary) {
TraceStructVirtualSpace space; TraceStructVirtualSpace space;

View File

@ -25,13 +25,19 @@
#ifndef SHARE_GC_SHARED_GC_GLOBALS_HPP #ifndef SHARE_GC_SHARED_GC_GLOBALS_HPP
#define SHARE_GC_SHARED_GC_GLOBALS_HPP #define SHARE_GC_SHARED_GC_GLOBALS_HPP
#include "gc/serial/serial_globals.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/cms_globals.hpp" #include "gc/cms/cms_globals.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/g1_globals.hpp" #include "gc/g1/g1_globals.hpp"
#endif
#if INCLUDE_PARALLELGC
#include "gc/parallel/parallel_globals.hpp" #include "gc/parallel/parallel_globals.hpp"
#endif #endif
#if INCLUDE_SERIALGC
#include "gc/serial/serial_globals.hpp"
#endif
#define GC_FLAGS(develop, \ #define GC_FLAGS(develop, \
develop_pd, \ develop_pd, \
@ -48,7 +54,7 @@
constraint, \ constraint, \
writeable) \ writeable) \
\ \
ALL_GCS_ONLY(GC_CMS_FLAGS( \ CMSGC_ONLY(GC_CMS_FLAGS( \
develop, \ develop, \
develop_pd, \ develop_pd, \
product, \ product, \
@ -64,7 +70,7 @@
constraint, \ constraint, \
writeable)) \ writeable)) \
\ \
ALL_GCS_ONLY(GC_G1_FLAGS( \ G1GC_ONLY(GC_G1_FLAGS( \
develop, \ develop, \
develop_pd, \ develop_pd, \
product, \ product, \
@ -80,7 +86,7 @@
constraint, \ constraint, \
writeable)) \ writeable)) \
\ \
ALL_GCS_ONLY(GC_PARALLEL_FLAGS( \ PARALLELGC_ONLY(GC_PARALLEL_FLAGS( \
develop, \ develop, \
develop_pd, \ develop_pd, \
product, \ product, \
@ -96,7 +102,7 @@
constraint, \ constraint, \
writeable)) \ writeable)) \
\ \
GC_SERIAL_FLAGS( \ SERIALGC_ONLY(GC_SERIAL_FLAGS( \
develop, \ develop, \
develop_pd, \ develop_pd, \
product, \ product, \
@ -110,7 +116,7 @@
lp64_product, \ lp64_product, \
range, \ range, \
constraint, \ constraint, \
writeable) \ writeable)) \
\ \
/* gc */ \ /* gc */ \
\ \

View File

@ -30,6 +30,7 @@
#include "classfile/vmSymbols.hpp" #include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "code/icBuffer.hpp" #include "code/icBuffer.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/shared/adaptiveSizePolicy.hpp" #include "gc/shared/adaptiveSizePolicy.hpp"
#include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
@ -1250,12 +1251,14 @@ GenCollectedHeap* GenCollectedHeap::heap() {
return (GenCollectedHeap*) heap; return (GenCollectedHeap*) heap;
} }
#if INCLUDE_SERIALGC
void GenCollectedHeap::prepare_for_compaction() { void GenCollectedHeap::prepare_for_compaction() {
// Start by compacting into same gen. // Start by compacting into same gen.
CompactPoint cp(_old_gen); CompactPoint cp(_old_gen);
_old_gen->prepare_for_compaction(&cp); _old_gen->prepare_for_compaction(&cp);
_young_gen->prepare_for_compaction(&cp); _young_gen->prepare_for_compaction(&cp);
} }
#endif // INCLUDE_SERIALGC
void GenCollectedHeap::verify(VerifyOption option /* ignored */) { void GenCollectedHeap::verify(VerifyOption option /* ignored */) {
log_debug(gc, verify)("%s", _old_gen->name()); log_debug(gc, verify)("%s", _old_gen->name());

View File

@ -502,10 +502,12 @@ private:
void check_for_non_bad_heap_word_value(HeapWord* addr, void check_for_non_bad_heap_word_value(HeapWord* addr,
size_t size) PRODUCT_RETURN; size_t size) PRODUCT_RETURN;
#if INCLUDE_SERIALGC
// For use by mark-sweep. As implemented, mark-sweep-compact is global // For use by mark-sweep. As implemented, mark-sweep-compact is global
// in an essential way: compaction is performed across generations, by // in an essential way: compaction is performed across generations, by
// iterating over spaces. // iterating over spaces.
void prepare_for_compaction(); void prepare_for_compaction();
#endif
// Perform a full collection of the generations up to and including max_generation. // Perform a full collection of the generations up to and including max_generation.
// This is the low level interface used by the public versions of // This is the low level interface used by the public versions of

View File

@ -23,10 +23,12 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/shared/generation.hpp" #include "gc/shared/generation.hpp"
#include "gc/shared/genMemoryPools.hpp" #include "gc/shared/genMemoryPools.hpp"
#include "gc/shared/space.hpp" #include "gc/shared/space.hpp"
#if INCLUDE_SERIALGC
#include "gc/serial/defNewGeneration.hpp"
#endif
ContiguousSpacePool::ContiguousSpacePool(ContiguousSpace* space, ContiguousSpacePool::ContiguousSpacePool(ContiguousSpace* space,
const char* name, const char* name,
@ -48,6 +50,8 @@ MemoryUsage ContiguousSpacePool::get_memory_usage() {
return MemoryUsage(initial_size(), used, committed, maxSize); return MemoryUsage(initial_size(), used, committed, maxSize);
} }
#if INCLUDE_SERIALGC
SurvivorContiguousSpacePool::SurvivorContiguousSpacePool(DefNewGeneration* young_gen, SurvivorContiguousSpacePool::SurvivorContiguousSpacePool(DefNewGeneration* young_gen,
const char* name, const char* name,
size_t max_size, size_t max_size,
@ -72,6 +76,8 @@ MemoryUsage SurvivorContiguousSpacePool::get_memory_usage() {
return MemoryUsage(initial_size(), used, committed, maxSize); return MemoryUsage(initial_size(), used, committed, maxSize);
} }
#endif // INCLUDE_SERIALGC
GenerationPool::GenerationPool(Generation* gen, GenerationPool::GenerationPool(Generation* gen,
const char* name, const char* name,
bool support_usage_threshold) : bool support_usage_threshold) :

View File

@ -22,12 +22,16 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/serial/serial_specialized_oop_closures.hpp"
#include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/genOopClosures.inline.hpp"
#include "memory/iterator.inline.hpp" #include "memory/iterator.inline.hpp"
#if INCLUDE_SERIALGC
#include "gc/serial/serial_specialized_oop_closures.hpp"
#endif
void FilteringClosure::do_oop(oop* p) { do_oop_nv(p); } void FilteringClosure::do_oop(oop* p) { do_oop_nv(p); }
void FilteringClosure::do_oop(narrowOop* p) { do_oop_nv(p); } void FilteringClosure::do_oop(narrowOop* p) { do_oop_nv(p); }
#if INCLUDE_SERIALGC
// Generate Serial GC specialized oop_oop_iterate functions. // Generate Serial GC specialized oop_oop_iterate functions.
SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(ALL_KLASS_OOP_OOP_ITERATE_DEFN) SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(ALL_KLASS_OOP_OOP_ITERATE_DEFN)
#endif

View File

@ -94,6 +94,7 @@ class OopsInClassLoaderDataOrGenClosure: public OopsInGenClosure {
void do_cld_barrier(); void do_cld_barrier();
}; };
#if INCLUDE_SERIALGC
// Closure for scanning DefNewGeneration. // Closure for scanning DefNewGeneration.
// //
@ -132,6 +133,8 @@ class FastScanClosure: public OopsInClassLoaderDataOrGenClosure {
inline void do_oop_nv(narrowOop* p); inline void do_oop_nv(narrowOop* p);
}; };
#endif // INCLUDE_SERIALGC
class CLDScanClosure: public CLDClosure { class CLDScanClosure: public CLDClosure {
OopsInClassLoaderDataOrGenClosure* _scavenge_closure; OopsInClassLoaderDataOrGenClosure* _scavenge_closure;
// true if the the modified oops state should be saved. // true if the the modified oops state should be saved.
@ -161,6 +164,8 @@ class FilteringClosure: public ExtendedOopClosure {
inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; } inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; }
}; };
#if INCLUDE_SERIALGC
// Closure for scanning DefNewGeneration's weak references. // Closure for scanning DefNewGeneration's weak references.
// NOTE: very much like ScanClosure but not derived from // NOTE: very much like ScanClosure but not derived from
// OopsInGenClosure -- weak references are processed all // OopsInGenClosure -- weak references are processed all
@ -178,4 +183,6 @@ class ScanWeakRefClosure: public OopClosure {
inline void do_oop_nv(narrowOop* p); inline void do_oop_nv(narrowOop* p);
}; };
#endif // INCLUDE_SERIALGC
#endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_HPP

View File

@ -25,7 +25,6 @@
#ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP #ifndef SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
#define SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP #define SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP
#include "gc/serial/defNewGeneration.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
#include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genCollectedHeap.hpp"
#include "gc/shared/genOopClosures.hpp" #include "gc/shared/genOopClosures.hpp"
@ -34,6 +33,9 @@
#include "oops/access.inline.hpp" #include "oops/access.inline.hpp"
#include "oops/compressedOops.inline.hpp" #include "oops/compressedOops.inline.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#if INCLUDE_SERIALGC
#include "gc/serial/defNewGeneration.inline.hpp"
#endif
inline OopsInGenClosure::OopsInGenClosure(Generation* gen) : inline OopsInGenClosure::OopsInGenClosure(Generation* gen) :
ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) { ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) {
@ -78,6 +80,8 @@ inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() {
} }
} }
#if INCLUDE_SERIALGC
// NOTE! Any changes made here should also be made // NOTE! Any changes made here should also be made
// in FastScanClosure::do_oop_work() // in FastScanClosure::do_oop_work()
template <class T> inline void ScanClosure::do_oop_work(T* p) { template <class T> inline void ScanClosure::do_oop_work(T* p) {
@ -129,6 +133,8 @@ template <class T> inline void FastScanClosure::do_oop_work(T* p) {
inline void FastScanClosure::do_oop_nv(oop* p) { FastScanClosure::do_oop_work(p); } inline void FastScanClosure::do_oop_nv(oop* p) { FastScanClosure::do_oop_work(p); }
inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); } inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); }
#endif // INCLUDE_SERIALGC
template <class T> void FilteringClosure::do_oop_work(T* p) { template <class T> void FilteringClosure::do_oop_work(T* p) {
T heap_oop = RawAccess<>::oop_load(p); T heap_oop = RawAccess<>::oop_load(p);
if (!CompressedOops::is_null(heap_oop)) { if (!CompressedOops::is_null(heap_oop)) {
@ -142,6 +148,8 @@ template <class T> void FilteringClosure::do_oop_work(T* p) {
void FilteringClosure::do_oop_nv(oop* p) { FilteringClosure::do_oop_work(p); } void FilteringClosure::do_oop_nv(oop* p) { FilteringClosure::do_oop_work(p); }
void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); } void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); }
#if INCLUDE_SERIALGC
// Note similarity to ScanClosure; the difference is that // Note similarity to ScanClosure; the difference is that
// the barrier set is taken care of outside this closure. // the barrier set is taken care of outside this closure.
template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) { template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
@ -158,4 +166,6 @@ template <class T> inline void ScanWeakRefClosure::do_oop_work(T* p) {
inline void ScanWeakRefClosure::do_oop_nv(oop* p) { ScanWeakRefClosure::do_oop_work(p); } inline void ScanWeakRefClosure::do_oop_nv(oop* p) { ScanWeakRefClosure::do_oop_work(p); }
inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); } inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); }
#endif // INCLUDE_SERIALGC
#endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP #endif // SHARE_VM_GC_SHARED_GENOOPCLOSURES_INLINE_HPP

View File

@ -23,7 +23,6 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/serial/genMarkSweep.hpp"
#include "gc/shared/blockOffsetTable.inline.hpp" #include "gc/shared/blockOffsetTable.inline.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp"
@ -304,6 +303,8 @@ void Generation::safe_object_iterate(ObjectClosure* cl) {
space_iterate(&blk); space_iterate(&blk);
} }
#if INCLUDE_SERIALGC
void Generation::prepare_for_compaction(CompactPoint* cp) { void Generation::prepare_for_compaction(CompactPoint* cp) {
// Generic implementation, can be specialized // Generic implementation, can be specialized
CompactibleSpace* space = first_compaction_space(); CompactibleSpace* space = first_compaction_space();
@ -334,3 +335,5 @@ void Generation::compact() {
sp = sp->next_compaction_space(); sp = sp->next_compaction_space();
} }
} }
#endif // INCLUDE_SERIALGC

View File

@ -401,6 +401,7 @@ class Generation: public CHeapObj<mtGC> {
GCStats* gc_stats() const { return _gc_stats; } GCStats* gc_stats() const { return _gc_stats; }
virtual void update_gc_stats(Generation* current_generation, bool full) {} virtual void update_gc_stats(Generation* current_generation, bool full) {}
#if INCLUDE_SERIALGC
// Mark sweep support phase2 // Mark sweep support phase2
virtual void prepare_for_compaction(CompactPoint* cp); virtual void prepare_for_compaction(CompactPoint* cp);
// Mark sweep support phase3 // Mark sweep support phase3
@ -408,6 +409,7 @@ class Generation: public CHeapObj<mtGC> {
// Mark sweep support phase4 // Mark sweep support phase4
virtual void compact(); virtual void compact();
virtual void post_compact() { ShouldNotReachHere(); } virtual void post_compact() { ShouldNotReachHere(); }
#endif
// Support for CMS's rescan. In this general form we return a pointer // Support for CMS's rescan. In this general form we return a pointer
// to an abstract object that can be used, based on specific previously // to an abstract object that can be used, based on specific previously

View File

@ -23,28 +23,32 @@
*/ */
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/tenuredGeneration.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
#include "gc/shared/generationSpec.hpp" #include "gc/shared/generationSpec.hpp"
#include "memory/binaryTreeDictionary.hpp" #include "memory/binaryTreeDictionary.hpp"
#include "memory/filemap.hpp" #include "memory/filemap.hpp"
#include "runtime/java.hpp" #include "runtime/java.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/concurrentMarkSweepGeneration.hpp" #include "gc/cms/concurrentMarkSweepGeneration.hpp"
#include "gc/cms/parNewGeneration.hpp" #include "gc/cms/parNewGeneration.hpp"
#endif // INCLUDE_ALL_GCS #endif
#if INCLUDE_SERIALGC
#include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/tenuredGeneration.hpp"
#endif
Generation* GenerationSpec::init(ReservedSpace rs, CardTableRS* remset) { Generation* GenerationSpec::init(ReservedSpace rs, CardTableRS* remset) {
switch (name()) { switch (name()) {
#if INCLUDE_SERIALGC
case Generation::DefNew: case Generation::DefNew:
return new DefNewGeneration(rs, init_size()); return new DefNewGeneration(rs, init_size());
case Generation::MarkSweepCompact: case Generation::MarkSweepCompact:
return new TenuredGeneration(rs, init_size(), remset); return new TenuredGeneration(rs, init_size(), remset);
#endif
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
case Generation::ParNew: case Generation::ParNew:
return new ParNewGeneration(rs, init_size()); return new ParNewGeneration(rs, init_size());
@ -64,7 +68,7 @@ Generation* GenerationSpec::init(ReservedSpace rs, CardTableRS* remset) {
return g; return g;
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_CMSGC
default: default:
guarantee(false, "unrecognized GenerationName"); guarantee(false, "unrecognized GenerationName");

View File

@ -25,6 +25,7 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.hpp"
#include "gc/shared/collectorPolicy.hpp" #include "gc/shared/collectorPolicy.hpp"
#include "gc/shared/gcConfig.hpp"
#include "gc/shared/jvmFlagConstraintsGC.hpp" #include "gc/shared/jvmFlagConstraintsGC.hpp"
#include "gc/shared/plab.hpp" #include "gc/shared/plab.hpp"
#include "gc/shared/threadLocalAllocBuffer.hpp" #include "gc/shared/threadLocalAllocBuffer.hpp"
@ -36,9 +37,13 @@
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/defaultStream.hpp" #include "utilities/defaultStream.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/jvmFlagConstraintsCMS.hpp" #include "gc/cms/jvmFlagConstraintsCMS.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/jvmFlagConstraintsG1.hpp" #include "gc/g1/jvmFlagConstraintsG1.hpp"
#endif
#if INCLUDE_PARALLELGC
#include "gc/parallel/jvmFlagConstraintsParallel.hpp" #include "gc/parallel/jvmFlagConstraintsParallel.hpp"
#endif #endif
#ifdef COMPILER1 #ifdef COMPILER1
@ -60,12 +65,14 @@
JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose) { JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose) {
JVMFlag::Error status = JVMFlag::SUCCESS; JVMFlag::Error status = JVMFlag::SUCCESS;
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
status = ParallelGCThreadsConstraintFuncParallel(value, verbose); status = ParallelGCThreadsConstraintFuncParallel(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
} }
#endif
#if INCLUDE_CMSGC
status = ParallelGCThreadsConstraintFuncCMS(value, verbose); status = ParallelGCThreadsConstraintFuncCMS(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
@ -78,42 +85,44 @@ JVMFlag::Error ParallelGCThreadsConstraintFunc(uint value, bool verbose) {
// As ConcGCThreads should be smaller than ParallelGCThreads, // As ConcGCThreads should be smaller than ParallelGCThreads,
// we need constraint function. // we need constraint function.
JVMFlag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose) { JVMFlag::Error ConcGCThreadsConstraintFunc(uint value, bool verbose) {
#if INCLUDE_ALL_GCS
// CMS and G1 GCs use ConcGCThreads. // CMS and G1 GCs use ConcGCThreads.
if ((UseConcMarkSweepGC || UseG1GC) && (value > ParallelGCThreads)) { if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
GCConfig::is_gc_selected(CollectedHeap::G1)) && (value > ParallelGCThreads)) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"ConcGCThreads (" UINT32_FORMAT ") must be " "ConcGCThreads (" UINT32_FORMAT ") must be "
"less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n", "less than or equal to ParallelGCThreads (" UINT32_FORMAT ")\n",
value, ParallelGCThreads); value, ParallelGCThreads);
return JVMFlag::VIOLATES_CONSTRAINT; return JVMFlag::VIOLATES_CONSTRAINT;
} }
#endif
return JVMFlag::SUCCESS; return JVMFlag::SUCCESS;
} }
static JVMFlag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) { static JVMFlag::Error MinPLABSizeBounds(const char* name, size_t value, bool verbose) {
#if INCLUDE_ALL_GCS if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value < PLAB::min_size())) { GCConfig::is_gc_selected(CollectedHeap::G1) ||
GCConfig::is_gc_selected(CollectedHeap::Parallel)) && (value < PLAB::min_size())) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"%s (" SIZE_FORMAT ") must be " "%s (" SIZE_FORMAT ") must be "
"greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n", "greater than or equal to ergonomic PLAB minimum size (" SIZE_FORMAT ")\n",
name, value, PLAB::min_size()); name, value, PLAB::min_size());
return JVMFlag::VIOLATES_CONSTRAINT; return JVMFlag::VIOLATES_CONSTRAINT;
} }
#endif // INCLUDE_ALL_GCS
return JVMFlag::SUCCESS; return JVMFlag::SUCCESS;
} }
JVMFlag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) { JVMFlag::Error MaxPLABSizeBounds(const char* name, size_t value, bool verbose) {
#if INCLUDE_ALL_GCS if ((GCConfig::is_gc_selected(CollectedHeap::CMS) ||
if ((UseConcMarkSweepGC || UseG1GC || UseParallelGC) && (value > PLAB::max_size())) { GCConfig::is_gc_selected(CollectedHeap::G1) ||
GCConfig::is_gc_selected(CollectedHeap::Parallel)) && (value > PLAB::max_size())) {
CommandLineError::print(verbose, CommandLineError::print(verbose,
"%s (" SIZE_FORMAT ") must be " "%s (" SIZE_FORMAT ") must be "
"less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n", "less than or equal to ergonomic PLAB maximum size (" SIZE_FORMAT ")\n",
name, value, PLAB::max_size()); name, value, PLAB::max_size());
return JVMFlag::VIOLATES_CONSTRAINT; return JVMFlag::VIOLATES_CONSTRAINT;
} }
#endif // INCLUDE_ALL_GCS
return JVMFlag::SUCCESS; return JVMFlag::SUCCESS;
} }
@ -133,13 +142,15 @@ JVMFlag::Error YoungPLABSizeConstraintFunc(size_t value, bool verbose) {
JVMFlag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose) { JVMFlag::Error OldPLABSizeConstraintFunc(size_t value, bool verbose) {
JVMFlag::Error status = JVMFlag::SUCCESS; JVMFlag::Error status = JVMFlag::SUCCESS;
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
if (UseConcMarkSweepGC) { if (UseConcMarkSweepGC) {
return OldPLABSizeConstraintFuncCMS(value, verbose); return OldPLABSizeConstraintFuncCMS(value, verbose);
} else { } else
#endif
{
status = MinMaxPLABSizeBounds("OldPLABSize", value, verbose); status = MinMaxPLABSizeBounds("OldPLABSize", value, verbose);
} }
#endif
return status; return status;
} }
@ -221,7 +232,7 @@ JVMFlag::Error MaxMetaspaceFreeRatioConstraintFunc(uintx value, bool verbose) {
} }
JVMFlag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose) { JVMFlag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose) {
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
JVMFlag::Error status = InitialTenuringThresholdConstraintFuncParallel(value, verbose); JVMFlag::Error status = InitialTenuringThresholdConstraintFuncParallel(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
@ -232,7 +243,7 @@ JVMFlag::Error InitialTenuringThresholdConstraintFunc(uintx value, bool verbose)
} }
JVMFlag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose) { JVMFlag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose) {
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
JVMFlag::Error status = MaxTenuringThresholdConstraintFuncParallel(value, verbose); JVMFlag::Error status = MaxTenuringThresholdConstraintFuncParallel(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
@ -253,7 +264,7 @@ JVMFlag::Error MaxTenuringThresholdConstraintFunc(uintx value, bool verbose) {
} }
JVMFlag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose) { JVMFlag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose) {
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
JVMFlag::Error status = MaxGCPauseMillisConstraintFuncG1(value, verbose); JVMFlag::Error status = MaxGCPauseMillisConstraintFuncG1(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
@ -264,7 +275,7 @@ JVMFlag::Error MaxGCPauseMillisConstraintFunc(uintx value, bool verbose) {
} }
JVMFlag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose) { JVMFlag::Error GCPauseIntervalMillisConstraintFunc(uintx value, bool verbose) {
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
JVMFlag::Error status = GCPauseIntervalMillisConstraintFuncG1(value, verbose); JVMFlag::Error status = GCPauseIntervalMillisConstraintFuncG1(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;
@ -302,7 +313,7 @@ static JVMFlag::Error MaxSizeForAlignment(const char* name, size_t value, size_t
static JVMFlag::Error MaxSizeForHeapAlignment(const char* name, size_t value, bool verbose) { static JVMFlag::Error MaxSizeForHeapAlignment(const char* name, size_t value, bool verbose) {
size_t heap_alignment; size_t heap_alignment;
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
if (UseG1GC) { if (UseG1GC) {
// For G1 GC, we don't know until G1CollectorPolicy is created. // For G1 GC, we don't know until G1CollectorPolicy is created.
heap_alignment = MaxSizeForHeapAlignmentG1(); heap_alignment = MaxSizeForHeapAlignmentG1();
@ -343,7 +354,7 @@ JVMFlag::Error HeapBaseMinAddressConstraintFunc(size_t value, bool verbose) {
} }
JVMFlag::Error NewSizeConstraintFunc(size_t value, bool verbose) { JVMFlag::Error NewSizeConstraintFunc(size_t value, bool verbose) {
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
JVMFlag::Error status = NewSizeConstraintFuncG1(value, verbose); JVMFlag::Error status = NewSizeConstraintFuncG1(value, verbose);
if (status != JVMFlag::SUCCESS) { if (status != JVMFlag::SUCCESS) {
return status; return status;

View File

@ -27,9 +27,13 @@
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/jvmFlagConstraintsCMS.hpp" #include "gc/cms/jvmFlagConstraintsCMS.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/jvmFlagConstraintsG1.hpp" #include "gc/g1/jvmFlagConstraintsG1.hpp"
#endif
#if INCLUDE_PARALLELGC
#include "gc/parallel/jvmFlagConstraintsParallel.hpp" #include "gc/parallel/jvmFlagConstraintsParallel.hpp"
#endif #endif

View File

@ -26,6 +26,7 @@
#define SHARE_VM_GC_SHARED_PRESERVEDMARKS_INLINE_HPP #define SHARE_VM_GC_SHARED_PRESERVEDMARKS_INLINE_HPP
#include "gc/shared/preservedMarks.hpp" #include "gc/shared/preservedMarks.hpp"
#include "logging/log.hpp"
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "utilities/stack.inline.hpp" #include "utilities/stack.inline.hpp"

View File

@ -25,7 +25,6 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "classfile/systemDictionary.hpp" #include "classfile/systemDictionary.hpp"
#include "classfile/vmSymbols.hpp" #include "classfile/vmSymbols.hpp"
#include "gc/serial/defNewGeneration.hpp"
#include "gc/shared/blockOffsetTable.inline.hpp" #include "gc/shared/blockOffsetTable.inline.hpp"
#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/genCollectedHeap.hpp" #include "gc/shared/genCollectedHeap.hpp"
@ -44,6 +43,9 @@
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#include "utilities/globalDefinitions.hpp" #include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_SERIALGC
#include "gc/serial/defNewGeneration.hpp"
#endif
HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top, HeapWord* DirtyCardToOopClosure::get_actual_top(HeapWord* top,
HeapWord* top_obj) { HeapWord* top_obj) {
@ -412,6 +414,8 @@ HeapWord* CompactibleSpace::forward(oop q, size_t size,
return compact_top; return compact_top;
} }
#if INCLUDE_SERIALGC
void ContiguousSpace::prepare_for_compaction(CompactPoint* cp) { void ContiguousSpace::prepare_for_compaction(CompactPoint* cp) {
scan_and_forward(this, cp); scan_and_forward(this, cp);
} }
@ -429,6 +433,8 @@ void CompactibleSpace::compact() {
scan_and_compact(this); scan_and_compact(this);
} }
#endif // INCLUDE_SERIALGC
void Space::print_short() const { print_short_on(tty); } void Space::print_short() const { print_short_on(tty); }
void Space::print_short_on(outputStream* st) const { void Space::print_short_on(outputStream* st) const {
@ -484,7 +490,7 @@ bool Space::obj_is_alive(const HeapWord* p) const {
return true; return true;
} }
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#define ContigSpace_PAR_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ #define ContigSpace_PAR_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\ \
void ContiguousSpace::par_oop_iterate(MemRegion mr, OopClosureType* blk) {\ void ContiguousSpace::par_oop_iterate(MemRegion mr, OopClosureType* blk) {\
@ -499,7 +505,7 @@ bool Space::obj_is_alive(const HeapWord* p) const {
ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DEFN) ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DEFN)
#undef ContigSpace_PAR_OOP_ITERATE_DEFN #undef ContigSpace_PAR_OOP_ITERATE_DEFN
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_CMSGC
void ContiguousSpace::oop_iterate(ExtendedOopClosure* blk) { void ContiguousSpace::oop_iterate(ExtendedOopClosure* blk) {
if (is_empty()) return; if (is_empty()) return;

View File

@ -220,9 +220,11 @@ class Space: public CHeapObj<mtGC> {
// Allocation (return NULL if full). Enforces mutual exclusion internally. // Allocation (return NULL if full). Enforces mutual exclusion internally.
virtual HeapWord* par_allocate(size_t word_size) = 0; virtual HeapWord* par_allocate(size_t word_size) = 0;
#if INCLUDE_SERIALGC
// Mark-sweep-compact support: all spaces can update pointers to objects // Mark-sweep-compact support: all spaces can update pointers to objects
// moving as a part of compaction. // moving as a part of compaction.
virtual void adjust_pointers() = 0; virtual void adjust_pointers() = 0;
#endif
virtual void print() const; virtual void print() const;
virtual void print_on(outputStream* st) const; virtual void print_on(outputStream* st) const;
@ -405,6 +407,7 @@ public:
_next_compaction_space = csp; _next_compaction_space = csp;
} }
#if INCLUDE_SERIALGC
// MarkSweep support phase2 // MarkSweep support phase2
// Start the process of compaction of the current space: compute // Start the process of compaction of the current space: compute
@ -420,6 +423,7 @@ public:
virtual void adjust_pointers(); virtual void adjust_pointers();
// MarkSweep support phase4 // MarkSweep support phase4
virtual void compact(); virtual void compact();
#endif // INCLUDE_SERIALGC
// The maximum percentage of objects that can be dead in the compacted // The maximum percentage of objects that can be dead in the compacted
// live part of a compacted space ("deadwood" support.) // live part of a compacted space ("deadwood" support.)
@ -474,9 +478,11 @@ protected:
// and possibly also overriding obj_size(), and adjust_obj_size(). // and possibly also overriding obj_size(), and adjust_obj_size().
// These functions should avoid virtual calls whenever possible. // These functions should avoid virtual calls whenever possible.
#if INCLUDE_SERIALGC
// Frequently calls adjust_obj_size(). // Frequently calls adjust_obj_size().
template <class SpaceType> template <class SpaceType>
static inline void scan_and_adjust_pointers(SpaceType* space); static inline void scan_and_adjust_pointers(SpaceType* space);
#endif
// Frequently calls obj_size(). // Frequently calls obj_size().
template <class SpaceType> template <class SpaceType>
@ -603,14 +609,14 @@ class ContiguousSpace: public CompactibleSpace {
} }
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
// In support of parallel oop_iterate. // In support of parallel oop_iterate.
#define ContigSpace_PAR_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ #define ContigSpace_PAR_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \
void par_oop_iterate(MemRegion mr, OopClosureType* blk); void par_oop_iterate(MemRegion mr, OopClosureType* blk);
ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DECL) ALL_PAR_OOP_ITERATE_CLOSURES(ContigSpace_PAR_OOP_ITERATE_DECL)
#undef ContigSpace_PAR_OOP_ITERATE_DECL #undef ContigSpace_PAR_OOP_ITERATE_DECL
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_CMSGC
// Compaction support // Compaction support
virtual void reset_after_compaction() { virtual void reset_after_compaction() {
@ -654,8 +660,10 @@ class ContiguousSpace: public CompactibleSpace {
HeapWord** top_addr() { return &_top; } HeapWord** top_addr() { return &_top; }
HeapWord** end_addr() { return &_end; } HeapWord** end_addr() { return &_end; }
#if INCLUDE_SERIALGC
// Overrides for more efficient compaction support. // Overrides for more efficient compaction support.
void prepare_for_compaction(CompactPoint* cp); void prepare_for_compaction(CompactPoint* cp);
#endif
virtual void print_on(outputStream* st) const; virtual void print_on(outputStream* st) const;

View File

@ -25,7 +25,6 @@
#ifndef SHARE_VM_GC_SHARED_SPACE_INLINE_HPP #ifndef SHARE_VM_GC_SHARED_SPACE_INLINE_HPP
#define SHARE_VM_GC_SHARED_SPACE_INLINE_HPP #define SHARE_VM_GC_SHARED_SPACE_INLINE_HPP
#include "gc/serial/markSweep.inline.hpp"
#include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.hpp"
#include "gc/shared/generation.hpp" #include "gc/shared/generation.hpp"
#include "gc/shared/space.hpp" #include "gc/shared/space.hpp"
@ -35,6 +34,9 @@
#include "oops/oop.inline.hpp" #include "oops/oop.inline.hpp"
#include "runtime/prefetch.inline.hpp" #include "runtime/prefetch.inline.hpp"
#include "runtime/safepoint.hpp" #include "runtime/safepoint.hpp"
#if INCLUDE_SERIALGC
#include "gc/serial/markSweep.inline.hpp"
#endif
inline HeapWord* Space::block_start(const void* p) { inline HeapWord* Space::block_start(const void* p) {
return block_start_const(p); return block_start_const(p);
@ -77,6 +79,8 @@ size_t CompactibleSpace::obj_size(const HeapWord* addr) const {
return oop(addr)->size(); return oop(addr)->size();
} }
#if INCLUDE_SERIALGC
class DeadSpacer : StackObj { class DeadSpacer : StackObj {
size_t _allowed_deadspace_words; size_t _allowed_deadspace_words;
bool _active; bool _active;
@ -347,6 +351,8 @@ inline void CompactibleSpace::scan_and_compact(SpaceType* space) {
clear_empty_region(space); clear_empty_region(space);
} }
#endif // INCLUDE_SERIALGC
size_t ContiguousSpace::scanned_block_size(const HeapWord* addr) const { size_t ContiguousSpace::scanned_block_size(const HeapWord* addr) const {
return oop(addr)->size(); return oop(addr)->size();
} }

View File

@ -25,12 +25,16 @@
#ifndef SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP #ifndef SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP
#define SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP #define SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP
#include "gc/serial/serial_specialized_oop_closures.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
#include "gc/cms/cms_specialized_oop_closures.hpp" #include "gc/cms/cms_specialized_oop_closures.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/g1_specialized_oop_closures.hpp" #include "gc/g1/g1_specialized_oop_closures.hpp"
#endif // INCLUDE_ALL_GCS #endif
#if INCLUDE_SERIALGC
#include "gc/serial/serial_specialized_oop_closures.hpp"
#endif
// The following OopClosure types get specialized versions of // The following OopClosure types get specialized versions of
// "oop_oop_iterate" that invoke the closures' do_oop methods // "oop_oop_iterate" that invoke the closures' do_oop methods
@ -56,14 +60,14 @@ class OopsInGenClosure;
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f) \ #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f) \
f(NoHeaderExtendedOopClosure,_nv) \ f(NoHeaderExtendedOopClosure,_nv) \
SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f) \ SERIALGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)) \
ALL_GCS_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)) CMSGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f))
#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) \ #define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) \
SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f) \ SERIALGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f)) \
ALL_GCS_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)) \ CMSGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)) \
ALL_GCS_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)) \ G1GC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)) \
ALL_GCS_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(f)) G1GC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(f))
// We separate these out, because sometime the general one has // We separate these out, because sometime the general one has
// a different definition from the specialized ones, and sometimes it // a different definition from the specialized ones, and sometimes it
@ -85,7 +89,7 @@ class OopsInGenClosure;
#define ALL_PAR_OOP_ITERATE_CLOSURES(f) \ #define ALL_PAR_OOP_ITERATE_CLOSURES(f) \
f(ExtendedOopClosure,_v) \ f(ExtendedOopClosure,_v) \
ALL_GCS_ONLY(SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f)) CMSGC_ONLY(SPECIALIZED_PAR_OOP_ITERATE_CLOSURES(f))
// This macro applies an argument macro to all OopClosures for which we // This macro applies an argument macro to all OopClosures for which we
// want specialized bodies of a family of methods related to // want specialized bodies of a family of methods related to
@ -94,8 +98,8 @@ class OopsInGenClosure;
// "OopClosure" in some applications and "OopsInGenClosure" in others. // "OopClosure" in some applications and "OopsInGenClosure" in others.
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f) \ #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f) \
SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f) \ SERIALGC_ONLY(SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_S(f)) \
ALL_GCS_ONLY(SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f)) CMSGC_ONLY(SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG_P(f))
#define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \ #define SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES(f) \
SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f) SPECIALIZED_SINCE_SAVE_MARKS_CLOSURES_YOUNG(f)

View File

@ -38,10 +38,10 @@
#include "utilities/dtrace.hpp" #include "utilities/dtrace.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#include "utilities/preserveException.hpp" #include "utilities/preserveException.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1Policy.hpp" #include "gc/g1/g1Policy.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
VM_GC_Operation::~VM_GC_Operation() { VM_GC_Operation::~VM_GC_Operation() {
CollectedHeap* ch = Universe::heap(); CollectedHeap* ch = Universe::heap();
@ -193,12 +193,14 @@ VM_CollectForMetadataAllocation::VM_CollectForMetadataAllocation(ClassLoaderData
// Returns true iff concurrent GCs unloads metadata. // Returns true iff concurrent GCs unloads metadata.
bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() { bool VM_CollectForMetadataAllocation::initiate_concurrent_GC() {
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) { if (UseConcMarkSweepGC && CMSClassUnloadingEnabled) {
MetaspaceGC::set_should_concurrent_collect(true); MetaspaceGC::set_should_concurrent_collect(true);
return true; return true;
} }
#endif
#if INCLUDE_G1GC
if (UseG1GC && ClassUnloadingWithConcurrentMark) { if (UseG1GC && ClassUnloadingWithConcurrentMark) {
G1CollectedHeap* g1h = G1CollectedHeap::heap(); G1CollectedHeap* g1h = G1CollectedHeap::heap();
g1h->g1_policy()->collector_state()->set_initiate_conc_mark_if_possible(true); g1h->g1_policy()->collector_state()->set_initiate_conc_mark_if_possible(true);

View File

@ -25,6 +25,7 @@
#ifndef SHARE_GC_SHARED_VMSTRUCTS_GC_HPP #ifndef SHARE_GC_SHARED_VMSTRUCTS_GC_HPP
#define SHARE_GC_SHARED_VMSTRUCTS_GC_HPP #define SHARE_GC_SHARED_VMSTRUCTS_GC_HPP
#include "gc/shared/ageTable.hpp"
#include "gc/shared/cardGeneration.hpp" #include "gc/shared/cardGeneration.hpp"
#include "gc/shared/cardTableRS.hpp" #include "gc/shared/cardTableRS.hpp"
#include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.hpp"
@ -33,30 +34,36 @@
#include "gc/shared/generationSpec.hpp" #include "gc/shared/generationSpec.hpp"
#include "gc/shared/oopStorage.hpp" #include "gc/shared/oopStorage.hpp"
#include "gc/shared/space.hpp" #include "gc/shared/space.hpp"
#if INCLUDE_CMSGC
#include "gc/cms/vmStructs_cms.hpp"
#endif
#if INCLUDE_G1GC
#include "gc/g1/vmStructs_g1.hpp"
#endif
#if INCLUDE_PARALLELGC
#include "gc/parallel/vmStructs_parallelgc.hpp"
#endif
#if INCLUDE_SERIALGC
#include "gc/serial/defNewGeneration.hpp" #include "gc/serial/defNewGeneration.hpp"
#include "gc/serial/vmStructs_serial.hpp" #include "gc/serial/vmStructs_serial.hpp"
#if INCLUDE_ALL_GCS
#include "gc/cms/vmStructs_cms.hpp"
#include "gc/g1/vmStructs_g1.hpp"
#include "gc/parallel/vmStructs_parallelgc.hpp"
#endif #endif
#define VM_STRUCTS_GC(nonstatic_field, \ #define VM_STRUCTS_GC(nonstatic_field, \
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field, \ static_field, \
unchecked_nonstatic_field) \ unchecked_nonstatic_field) \
ALL_GCS_ONLY(VM_STRUCTS_CMSGC(nonstatic_field, \ CMSGC_ONLY(VM_STRUCTS_CMSGC(nonstatic_field, \
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field)) \ static_field)) \
ALL_GCS_ONLY(VM_STRUCTS_G1GC(nonstatic_field, \ G1GC_ONLY(VM_STRUCTS_G1GC(nonstatic_field, \
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field)) \ static_field)) \
ALL_GCS_ONLY(VM_STRUCTS_PARALLELGC(nonstatic_field, \ PARALLELGC_ONLY(VM_STRUCTS_PARALLELGC(nonstatic_field, \
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field)) \ static_field)) \
VM_STRUCTS_SERIALGC(nonstatic_field, \ SERIALGC_ONLY(VM_STRUCTS_SERIALGC(nonstatic_field, \
volatile_nonstatic_field, \ volatile_nonstatic_field, \
static_field) \ static_field)) \
/**********************************************************************************/ \ /**********************************************************************************/ \
/* Generation and Space hierarchies */ \ /* Generation and Space hierarchies */ \
/**********************************************************************************/ \ /**********************************************************************************/ \
@ -114,13 +121,6 @@
nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \ nonstatic_field(ContiguousSpace, _concurrent_iteration_safe_limit, HeapWord*) \
nonstatic_field(ContiguousSpace, _saved_mark_word, HeapWord*) \ nonstatic_field(ContiguousSpace, _saved_mark_word, HeapWord*) \
\ \
nonstatic_field(DefNewGeneration, _old_gen, Generation*) \
nonstatic_field(DefNewGeneration, _tenuring_threshold, uint) \
nonstatic_field(DefNewGeneration, _age_table, AgeTable) \
nonstatic_field(DefNewGeneration, _eden_space, ContiguousSpace*) \
nonstatic_field(DefNewGeneration, _from_space, ContiguousSpace*) \
nonstatic_field(DefNewGeneration, _to_space, ContiguousSpace*) \
\
nonstatic_field(Generation, _reserved, MemRegion) \ nonstatic_field(Generation, _reserved, MemRegion) \
nonstatic_field(Generation, _virtual_space, VirtualSpace) \ nonstatic_field(Generation, _virtual_space, VirtualSpace) \
nonstatic_field(Generation, _stat_record, Generation::StatRecord) \ nonstatic_field(Generation, _stat_record, Generation::StatRecord) \
@ -150,18 +150,18 @@
#define VM_TYPES_GC(declare_type, \ #define VM_TYPES_GC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
declare_integer_type) \ declare_integer_type) \
ALL_GCS_ONLY(VM_TYPES_CMSGC(declare_type, \ CMSGC_ONLY(VM_TYPES_CMSGC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
declare_integer_type)) \ declare_integer_type)) \
ALL_GCS_ONLY(VM_TYPES_G1GC(declare_type, \ G1GC_ONLY(VM_TYPES_G1GC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
declare_integer_type)) \ declare_integer_type)) \
ALL_GCS_ONLY(VM_TYPES_PARALLELGC(declare_type, \ PARALLELGC_ONLY(VM_TYPES_PARALLELGC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
declare_integer_type)) \ declare_integer_type)) \
VM_TYPES_SERIALGC(declare_type, \ SERIALGC_ONLY(VM_TYPES_SERIALGC(declare_type, \
declare_toplevel_type, \ declare_toplevel_type, \
declare_integer_type) \ declare_integer_type)) \
/******************************************/ \ /******************************************/ \
/* Generation and space hierarchies */ \ /* Generation and space hierarchies */ \
/* (needed for run-time type information) */ \ /* (needed for run-time type information) */ \
@ -170,7 +170,6 @@
declare_toplevel_type(CollectedHeap) \ declare_toplevel_type(CollectedHeap) \
declare_type(GenCollectedHeap, CollectedHeap) \ declare_type(GenCollectedHeap, CollectedHeap) \
declare_toplevel_type(Generation) \ declare_toplevel_type(Generation) \
declare_type(DefNewGeneration, Generation) \
declare_type(CardGeneration, Generation) \ declare_type(CardGeneration, Generation) \
declare_toplevel_type(Space) \ declare_toplevel_type(Space) \
declare_type(CompactibleSpace, Space) \ declare_type(CompactibleSpace, Space) \
@ -224,14 +223,14 @@
#define VM_INT_CONSTANTS_GC(declare_constant, \ #define VM_INT_CONSTANTS_GC(declare_constant, \
declare_constant_with_value) \ declare_constant_with_value) \
ALL_GCS_ONLY(VM_INT_CONSTANTS_CMSGC(declare_constant, \ CMSGC_ONLY(VM_INT_CONSTANTS_CMSGC(declare_constant, \
declare_constant_with_value)) \ declare_constant_with_value)) \
ALL_GCS_ONLY(VM_INT_CONSTANTS_G1GC(declare_constant, \ G1GC_ONLY(VM_INT_CONSTANTS_G1GC(declare_constant, \
declare_constant_with_value)) \ declare_constant_with_value)) \
ALL_GCS_ONLY(VM_INT_CONSTANTS_PARALLELGC(declare_constant, \ PARALLELGC_ONLY(VM_INT_CONSTANTS_PARALLELGC(declare_constant, \
declare_constant_with_value)) \
SERIALGC_ONLY(VM_INT_CONSTANTS_SERIALGC(declare_constant, \
declare_constant_with_value)) \ declare_constant_with_value)) \
VM_INT_CONSTANTS_SERIALGC(declare_constant, \
declare_constant_with_value) \
\ \
/********************************************/ \ /********************************************/ \
/* Generation and Space Hierarchy Constants */ \ /* Generation and Space Hierarchy Constants */ \

View File

@ -50,9 +50,9 @@
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
#include "utilities/defaultStream.hpp" #include "utilities/defaultStream.hpp"
#include "utilities/macros.hpp" #include "utilities/macros.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define strtoll _strtoi64 #define strtoll _strtoi64
@ -484,18 +484,18 @@ JRT_LEAF(void, JVMCIRuntime::log_object(JavaThread* thread, oopDesc* obj, bool a
} }
JRT_END JRT_END
#if INCLUDE_G1GC
JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj)) JRT_LEAF(void, JVMCIRuntime::write_barrier_pre(JavaThread* thread, oopDesc* obj))
#if INCLUDE_ALL_GCS
G1ThreadLocalData::satb_mark_queue(thread).enqueue(obj); G1ThreadLocalData::satb_mark_queue(thread).enqueue(obj);
#endif // INCLUDE_ALL_GCS
JRT_END JRT_END
JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr)) JRT_LEAF(void, JVMCIRuntime::write_barrier_post(JavaThread* thread, void* card_addr))
#if INCLUDE_ALL_GCS
G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr); G1ThreadLocalData::dirty_card_queue(thread).enqueue(card_addr);
#endif // INCLUDE_ALL_GCS
JRT_END JRT_END
#endif // INCLUDE_G1GC
JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child)) JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
bool ret = true; bool ret = true;
if(!Universe::heap()->is_in_closed_subset(parent)) { if(!Universe::heap()->is_in_closed_subset(parent)) {

View File

@ -150,8 +150,10 @@ class JVMCIRuntime: public AllStatic {
// printed as a string, otherwise the type of the object is printed // printed as a string, otherwise the type of the object is printed
// followed by its address. // followed by its address.
static void log_object(JavaThread* thread, oopDesc* object, bool as_string, bool newline); static void log_object(JavaThread* thread, oopDesc* object, bool as_string, bool newline);
#if INCLUDE_G1GC
static void write_barrier_pre(JavaThread* thread, oopDesc* obj); static void write_barrier_pre(JavaThread* thread, oopDesc* obj);
static void write_barrier_post(JavaThread* thread, void* card); static void write_barrier_post(JavaThread* thread, void* card);
#endif
static jboolean validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child); static jboolean validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child);
// used to throw exceptions from compiled JVMCI code // used to throw exceptions from compiled JVMCI code

View File

@ -40,8 +40,7 @@
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#include "runtime/thread.hpp" #include "runtime/thread.hpp"
#include "runtime/vm_version.hpp" #include "runtime/vm_version.hpp"
#if INCLUDE_G1GC
#if INCLUDE_ALL_GCS
#include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CardTable.hpp" #include "gc/g1/g1CardTable.hpp"
#include "gc/g1/heapRegion.hpp" #include "gc/g1/heapRegion.hpp"
@ -636,14 +635,14 @@
declare_function(JVMCIRuntime::log_printf) \ declare_function(JVMCIRuntime::log_printf) \
declare_function(JVMCIRuntime::vm_error) \ declare_function(JVMCIRuntime::vm_error) \
declare_function(JVMCIRuntime::load_and_clear_exception) \ declare_function(JVMCIRuntime::load_and_clear_exception) \
ALL_GCS_ONLY(declare_function(JVMCIRuntime::write_barrier_pre)) \ G1GC_ONLY(declare_function(JVMCIRuntime::write_barrier_pre)) \
ALL_GCS_ONLY(declare_function(JVMCIRuntime::write_barrier_post)) \ G1GC_ONLY(declare_function(JVMCIRuntime::write_barrier_post)) \
declare_function(JVMCIRuntime::validate_object) \ declare_function(JVMCIRuntime::validate_object) \
\ \
declare_function(JVMCIRuntime::test_deoptimize_call_int) declare_function(JVMCIRuntime::test_deoptimize_call_int)
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#define VM_STRUCTS_JVMCI_G1GC(nonstatic_field, static_field) \ #define VM_STRUCTS_JVMCI_G1GC(nonstatic_field, static_field) \
static_field(HeapRegion, LogOfHRGrainBytes, int) static_field(HeapRegion, LogOfHRGrainBytes, int)
@ -656,7 +655,7 @@
declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_index_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())) \ declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_index_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_index_offset())) \
declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_buffer_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset())) declare_constant_with_value("G1ThreadLocalData::dirty_card_queue_buffer_offset", in_bytes(G1ThreadLocalData::dirty_card_queue_buffer_offset()))
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
#ifdef LINUX #ifdef LINUX
@ -872,7 +871,7 @@ VMStructEntry JVMCIVMStructs::localHotSpotVMStructs[] = {
GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY, GENERATE_C1_UNCHECKED_STATIC_VM_STRUCT_ENTRY,
GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY) GENERATE_C2_UNCHECKED_STATIC_VM_STRUCT_ENTRY)
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, VM_STRUCTS_JVMCI_G1GC(GENERATE_NONSTATIC_VM_STRUCT_ENTRY,
GENERATE_STATIC_VM_STRUCT_ENTRY) GENERATE_STATIC_VM_STRUCT_ENTRY)
#endif #endif
@ -924,7 +923,7 @@ VMIntConstantEntry JVMCIVMStructs::localHotSpotVMIntConstants[] = {
GENERATE_C2_VM_INT_CONSTANT_ENTRY, GENERATE_C2_VM_INT_CONSTANT_ENTRY,
GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) GENERATE_C2_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
VM_INT_CONSTANTS_JVMCI_G1GC(GENERATE_VM_INT_CONSTANT_ENTRY, VM_INT_CONSTANTS_JVMCI_G1GC(GENERATE_VM_INT_CONSTANT_ENTRY,
GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY, GENERATE_VM_INT_CONSTANT_WITH_VALUE_ENTRY,
GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY) GENERATE_PREPROCESSOR_VM_INT_CONSTANT_ENTRY)

View File

@ -49,7 +49,7 @@
#include "services/memTracker.hpp" #include "services/memTracker.hpp"
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/defaultStream.hpp" #include "utilities/defaultStream.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1CollectedHeap.hpp"
#endif #endif

View File

@ -63,7 +63,7 @@
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/defaultStream.hpp" #include "utilities/defaultStream.hpp"
#include "utilities/hashtable.inline.hpp" #include "utilities/hashtable.inline.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1Allocator.inline.hpp" #include "gc/g1/g1Allocator.inline.hpp"
#include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1CollectedHeap.hpp"
#endif #endif

View File

@ -32,14 +32,10 @@
#include "classfile/vmSymbols.hpp" #include "classfile/vmSymbols.hpp"
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "code/dependencies.hpp" #include "code/dependencies.hpp"
#include "gc/shared/cardTableBarrierSet.hpp"
#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/gcArguments.hpp" #include "gc/shared/gcArguments.hpp"
#include "gc/shared/gcConfig.hpp" #include "gc/shared/gcConfig.hpp"
#include "gc/shared/gcLocker.hpp"
#include "gc/shared/generation.hpp"
#include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcTraceTime.inline.hpp"
#include "gc/shared/space.hpp"
#include "interpreter/interpreter.hpp" #include "interpreter/interpreter.hpp"
#include "logging/log.hpp" #include "logging/log.hpp"
#include "logging/logStream.hpp" #include "logging/logStream.hpp"

View File

@ -152,11 +152,11 @@ class ArrayKlass: public Klass {
#define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix) \ #define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix) \
void oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end); void oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end);
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
// Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below. // Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below.
#define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix) \ #define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix) \
void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
#endif // INCLUDE_ALL_GCS #endif
// Array oop iteration macros for definitions. // Array oop iteration macros for definitions.
@ -168,7 +168,7 @@ void KlassType::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closur
oop_oop_iterate_range<nvs_to_bool(nv_suffix)>(obj, closure, start, end); \ oop_oop_iterate_range<nvs_to_bool(nv_suffix)>(obj, closure, start, end); \
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) \ #define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) \
void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
/* No reverse implementation ATM. */ \ /* No reverse implementation ATM. */ \

View File

@ -48,7 +48,7 @@ public:
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -68,7 +68,7 @@ public:
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
inline void oop_oop_iterate(oop obj, OopClosureType* closure); inline void oop_oop_iterate(oop obj, OopClosureType* closure);
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
// Reverse iteration // Reverse iteration
// Iterate over the oop fields and metadata. // Iterate over the oop fields and metadata.
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
@ -85,10 +85,10 @@ public:
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
}; };

View File

@ -47,7 +47,7 @@ inline void InstanceClassLoaderKlass::oop_oop_iterate(oop obj, OopClosureType* c
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
inline void InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { inline void InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure); InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure);
@ -55,7 +55,7 @@ inline void InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosur
assert(!Devirtualizer<nv>::do_metadata(closure), assert(!Devirtualizer<nv>::do_metadata(closure),
"Code to handle metadata is not implemented"); "Code to handle metadata is not implemented");
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>

View File

@ -1180,7 +1180,7 @@ public:
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -1217,7 +1217,7 @@ public:
// Reverse iteration // Reverse iteration
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
public: public:
// Iterate over all oop fields in the oop maps. // Iterate over all oop fields in the oop maps.
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
@ -1237,7 +1237,7 @@ public:
// Iterate over all oop fields in one oop map. // Iterate over all oop fields in one oop map.
template <bool nv, typename T, class OopClosureType> template <bool nv, typename T, class OopClosureType>
inline void oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure); inline void oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure);
#endif #endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS
// Bounded range iteration // Bounded range iteration
@ -1267,10 +1267,10 @@ public:
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
u2 idnum_allocated_count() const { return _idnum_allocated_count; } u2 idnum_allocated_count() const { return _idnum_allocated_count; }

View File

@ -64,7 +64,7 @@ ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map(OopMapBlock* map, oop o
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, typename T, class OopClosureType> template <bool nv, typename T, class OopClosureType>
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) { ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) {
T* const start = (T*)obj->obj_field_addr_raw<T>(map->offset()); T* const start = (T*)obj->obj_field_addr_raw<T>(map->offset());
@ -110,7 +110,7 @@ ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized(oop obj, O
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, typename T, class OopClosureType> template <bool nv, typename T, class OopClosureType>
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure) { ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure) {
OopMapBlock* const start_map = start_of_nonstatic_oop_maps(); OopMapBlock* const start_map = start_of_nonstatic_oop_maps();
@ -142,7 +142,7 @@ ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureTyp
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) { ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) {
if (UseCompressedOops) { if (UseCompressedOops) {
@ -173,7 +173,7 @@ ALWAYSINLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure
return size_helper(); return size_helper();
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
ALWAYSINLINE int InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { ALWAYSINLINE int InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
assert(!Devirtualizer<nv>::do_metadata(closure), assert(!Devirtualizer<nv>::do_metadata(closure),

View File

@ -89,7 +89,7 @@ class InstanceMirrorKlass: public InstanceKlass {
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -121,7 +121,7 @@ class InstanceMirrorKlass: public InstanceKlass {
// Reverse iteration // Reverse iteration
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
// Iterate over the oop fields and metadata. // Iterate over the oop fields and metadata.
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);
@ -148,10 +148,10 @@ class InstanceMirrorKlass: public InstanceKlass {
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
}; };
#endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP #endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP

View File

@ -86,14 +86,14 @@ void InstanceMirrorKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {
oop_oop_iterate_statics<nv>(obj, closure); oop_oop_iterate_statics<nv>(obj, closure);
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
void InstanceMirrorKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { void InstanceMirrorKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure); InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure);
InstanceMirrorKlass::oop_oop_iterate_statics<nv>(obj, closure); InstanceMirrorKlass::oop_oop_iterate_statics<nv>(obj, closure);
} }
#endif #endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, typename T, class OopClosureType> template <bool nv, typename T, class OopClosureType>
void InstanceMirrorKlass::oop_oop_iterate_statics_specialized_bounded(oop obj, void InstanceMirrorKlass::oop_oop_iterate_statics_specialized_bounded(oop obj,

View File

@ -58,7 +58,7 @@ class InstanceRefKlass: public InstanceKlass {
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -80,11 +80,11 @@ private:
inline void oop_oop_iterate(oop obj, OopClosureType* closure); inline void oop_oop_iterate(oop obj, OopClosureType* closure);
// Reverse iteration // Reverse iteration
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
// Iterate over all oop fields and metadata. // Iterate over all oop fields and metadata.
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure);
#endif // INCLUDE_ALL_GCS #endif
// Bounded range iteration // Bounded range iteration
// Iterate over all oop fields and metadata. // Iterate over all oop fields and metadata.
@ -141,10 +141,10 @@ private:
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
// Update non-static oop maps so 'referent', 'nextPending' and // Update non-static oop maps so 'referent', 'nextPending' and
// 'discovered' will look like non-oops // 'discovered' will look like non-oops

View File

@ -171,14 +171,14 @@ void InstanceRefKlass::oop_oop_iterate(oop obj, OopClosureType* closure) {
oop_oop_iterate_ref_processing<nv>(obj, closure); oop_oop_iterate_ref_processing<nv>(obj, closure);
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>
void InstanceRefKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { void InstanceRefKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) {
InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure); InstanceKlass::oop_oop_iterate_reverse<nv>(obj, closure);
oop_oop_iterate_ref_processing<nv>(obj, closure); oop_oop_iterate_ref_processing<nv>(obj, closure);
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS
template <bool nv, class OopClosureType> template <bool nv, class OopClosureType>

View File

@ -645,7 +645,7 @@ protected:
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
virtual void oop_ps_push_contents( oop obj, PSPromotionManager* pm) = 0; virtual void oop_ps_push_contents( oop obj, PSPromotionManager* pm) = 0;
// Parallel Compact // Parallel Compact
@ -663,13 +663,13 @@ protected:
ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define Klass_OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \ #define Klass_OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \
virtual void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) = 0; virtual void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) = 0;
ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
virtual void array_klasses_do(void f(Klass* k)) {} virtual void array_klasses_do(void f(Klass* k)) {}
@ -730,10 +730,10 @@ protected:
void oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \ void oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \
void oop_oop_iterate_bounded##nv_suffix(oop obj, OopClosureType* closure, MemRegion mr); void oop_oop_iterate_bounded##nv_suffix(oop obj, OopClosureType* closure, MemRegion mr);
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \ #define OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \
void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure);
#endif // INCLUDE_ALL_GCS #endif
// Oop iteration macros for definitions. // Oop iteration macros for definitions.
@ -744,7 +744,7 @@ void KlassType::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) {
oop_oop_iterate<nvs_to_bool(nv_suffix)>(obj, closure); \ oop_oop_iterate<nvs_to_bool(nv_suffix)>(obj, closure); \
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define OOP_OOP_ITERATE_DEFN_BACKWARDS(KlassType, OopClosureType, nv_suffix) \ #define OOP_OOP_ITERATE_DEFN_BACKWARDS(KlassType, OopClosureType, nv_suffix) \
void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \
oop_oop_iterate_reverse<nvs_to_bool(nv_suffix)>(obj, closure); \ oop_oop_iterate_reverse<nvs_to_bool(nv_suffix)>(obj, closure); \

View File

@ -28,7 +28,6 @@
#include "code/codeCache.hpp" #include "code/codeCache.hpp"
#include "code/debugInfoRec.hpp" #include "code/debugInfoRec.hpp"
#include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp"
#include "gc/shared/generation.hpp"
#include "interpreter/bytecodeStream.hpp" #include "interpreter/bytecodeStream.hpp"
#include "interpreter/bytecodeTracer.hpp" #include "interpreter/bytecodeTracer.hpp"
#include "interpreter/bytecodes.hpp" #include "interpreter/bytecodes.hpp"

View File

@ -117,7 +117,7 @@ class ObjArrayKlass : public ArrayKlass {
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -178,10 +178,10 @@ class ObjArrayKlass : public ArrayKlass {
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
// JVM support // JVM support
jint compute_modifier_flags(TRAPS) const; jint compute_modifier_flags(TRAPS) const;

View File

@ -32,7 +32,7 @@
#include "runtime/handles.inline.hpp" #include "runtime/handles.inline.hpp"
#include "runtime/thread.inline.hpp" #include "runtime/thread.inline.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1Allocator.inline.hpp" #include "gc/g1/g1Allocator.inline.hpp"
#endif #endif

View File

@ -259,13 +259,11 @@ class oopDesc {
inline void forward_to(oop p); inline void forward_to(oop p);
inline bool cas_forward_to(oop p, markOop compare); inline bool cas_forward_to(oop p, markOop compare);
#if INCLUDE_ALL_GCS
// Like "forward_to", but inserts the forwarding pointer atomically. // Like "forward_to", but inserts the forwarding pointer atomically.
// Exactly one thread succeeds in inserting the forwarding pointer, and // Exactly one thread succeeds in inserting the forwarding pointer, and
// this call returns "NULL" for that thread; any other thread has the // this call returns "NULL" for that thread; any other thread has the
// value of the forwarding pointer returned and does not modify "this". // value of the forwarding pointer returned and does not modify "this".
inline oop forward_to_atomic(oop p); inline oop forward_to_atomic(oop p);
#endif // INCLUDE_ALL_GCS
inline oop forwardee() const; inline oop forwardee() const;
@ -278,7 +276,7 @@ class oopDesc {
// Garbage Collection support // Garbage Collection support
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Compact // Parallel Compact
inline void pc_follow_contents(ParCompactionManager* cm); inline void pc_follow_contents(ParCompactionManager* cm);
inline void pc_update_contents(ParCompactionManager* cm); inline void pc_update_contents(ParCompactionManager* cm);
@ -303,7 +301,7 @@ class oopDesc {
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ #define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \
inline void oop_iterate_backwards(OopClosureType* blk); inline void oop_iterate_backwards(OopClosureType* blk);
@ -311,7 +309,7 @@ class oopDesc {
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL)
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS
inline int oop_iterate_no_header(OopClosure* bk); inline int oop_iterate_no_header(OopClosure* bk);
inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr); inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr);

View File

@ -25,9 +25,7 @@
#ifndef SHARE_VM_OOPS_OOP_INLINE_HPP #ifndef SHARE_VM_OOPS_OOP_INLINE_HPP
#define SHARE_VM_OOPS_OOP_INLINE_HPP #define SHARE_VM_OOPS_OOP_INLINE_HPP
#include "gc/shared/ageTable.hpp"
#include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.hpp"
#include "gc/shared/generation.hpp"
#include "oops/access.inline.hpp" #include "oops/access.inline.hpp"
#include "oops/arrayKlass.hpp" #include "oops/arrayKlass.hpp"
#include "oops/arrayOop.hpp" #include "oops/arrayOop.hpp"
@ -350,7 +348,6 @@ bool oopDesc::cas_forward_to(oop p, markOop compare) {
return cas_set_mark_raw(m, compare) == compare; return cas_set_mark_raw(m, compare) == compare;
} }
#if INCLUDE_ALL_GCS
oop oopDesc::forward_to_atomic(oop p) { oop oopDesc::forward_to_atomic(oop p) {
markOop oldMark = mark_raw(); markOop oldMark = mark_raw();
markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p);
@ -372,7 +369,6 @@ oop oopDesc::forward_to_atomic(oop p) {
} }
return forwardee(); return forwardee();
} }
#endif
// Note that the forwardee is not the same thing as the displaced_mark. // Note that the forwardee is not the same thing as the displaced_mark.
// The forwardee is used when copying during scavenge and mark-sweep. // The forwardee is used when copying during scavenge and mark-sweep.
@ -400,7 +396,7 @@ void oopDesc::incr_age() {
} }
} }
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
void oopDesc::pc_follow_contents(ParCompactionManager* cm) { void oopDesc::pc_follow_contents(ParCompactionManager* cm) {
klass()->oop_pc_follow_contents(this, cm); klass()->oop_pc_follow_contents(this, cm);
} }
@ -422,7 +418,7 @@ void oopDesc::ps_push_contents(PSPromotionManager* pm) {
} }
// Else skip it. The TypeArrayKlass in the header never needs scavenging. // Else skip it. The TypeArrayKlass in the header never needs scavenging.
} }
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_PARALLELGC
#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ #define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \
\ \
@ -462,7 +458,7 @@ int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) {
return oop_iterate_size(&cl, mr); return oop_iterate_size(&cl, mr);
} }
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \
\ \
inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
@ -470,7 +466,7 @@ inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \
} }
#else #else
#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) #define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix)
#endif // INCLUDE_ALL_GCS #endif
#define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \ #define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \
OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \

View File

@ -74,7 +74,7 @@ class TypeArrayKlass : public ArrayKlass {
// GC specific object visitors // GC specific object visitors
// //
#if INCLUDE_ALL_GCS #if INCLUDE_PARALLELGC
// Parallel Scavenge // Parallel Scavenge
void oop_ps_push_contents( oop obj, PSPromotionManager* pm); void oop_ps_push_contents( oop obj, PSPromotionManager* pm);
// Parallel Compact // Parallel Compact
@ -104,10 +104,10 @@ class TypeArrayKlass : public ArrayKlass {
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE)
#if INCLUDE_ALL_GCS #if INCLUDE_OOP_OOP_ITERATE_BACKWARDS
ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS)
#endif // INCLUDE_ALL_GCS #endif
protected: protected:

View File

@ -644,6 +644,7 @@ bool ArrayCopyNode::may_modify_helper(const TypeOopPtr *t_oop, Node* n, PhaseTra
} }
static Node* step_over_gc_barrier(Node* c) { static Node* step_over_gc_barrier(Node* c) {
#if INCLUDE_G1GC
if (UseG1GC && !GraphKit::use_ReduceInitialCardMarks() && if (UseG1GC && !GraphKit::use_ReduceInitialCardMarks() &&
c != NULL && c->is_Region() && c->req() == 3) { c != NULL && c->is_Region() && c->req() == 3) {
for (uint i = 1; i < c->req(); i++) { for (uint i = 1; i < c->req(); i++) {
@ -675,6 +676,7 @@ static Node* step_over_gc_barrier(Node* c) {
} }
} }
} }
#endif // INCLUDE_G1GC
return c; return c;
} }

View File

@ -73,9 +73,9 @@
#include "runtime/timer.hpp" #include "runtime/timer.hpp"
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/copy.hpp" #include "utilities/copy.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
// -------------------- Compile::mach_constant_base_node ----------------------- // -------------------- Compile::mach_constant_base_node -----------------------
@ -3753,6 +3753,7 @@ void Compile::verify_graph_edges(bool no_dead_code) {
// Currently supported: // Currently supported:
// - G1 pre-barriers (see GraphKit::g1_write_barrier_pre()) // - G1 pre-barriers (see GraphKit::g1_write_barrier_pre())
void Compile::verify_barriers() { void Compile::verify_barriers() {
#if INCLUDE_G1GC
if (UseG1GC) { if (UseG1GC) {
// Verify G1 pre-barriers // Verify G1 pre-barriers
const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset()); const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
@ -3812,6 +3813,7 @@ void Compile::verify_barriers() {
} }
} }
} }
#endif
} }
#endif #endif

View File

@ -37,9 +37,9 @@
#include "opto/phaseX.hpp" #include "opto/phaseX.hpp"
#include "opto/movenode.hpp" #include "opto/movenode.hpp"
#include "opto/rootnode.hpp" #include "opto/rootnode.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) : ConnectionGraph::ConnectionGraph(Compile * C, PhaseIterGVN *igvn) :
_nodes(C->comp_arena(), C->unique(), C->unique(), NULL), _nodes(C->comp_arena(), C->unique(), C->unique(), NULL),
@ -538,6 +538,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node *n, Unique_Node_List *de
// Pointer stores in G1 barriers looks like unsafe access. // Pointer stores in G1 barriers looks like unsafe access.
// Ignore such stores to be able scalar replace non-escaping // Ignore such stores to be able scalar replace non-escaping
// allocations. // allocations.
#if INCLUDE_G1GC
if (UseG1GC && adr->is_AddP()) { if (UseG1GC && adr->is_AddP()) {
Node* base = get_addp_base(adr); Node* base = get_addp_base(adr);
if (base->Opcode() == Op_LoadP && if (base->Opcode() == Op_LoadP &&
@ -555,6 +556,7 @@ void ConnectionGraph::add_node_to_connection_graph(Node *n, Unique_Node_List *de
} }
} }
} }
#endif
delayed_worklist->push(n); // Process unsafe access later. delayed_worklist->push(n); // Process unsafe access later.
break; break;
} }

View File

@ -25,9 +25,6 @@
#include "precompiled.hpp" #include "precompiled.hpp"
#include "ci/ciUtilities.hpp" #include "ci/ciUtilities.hpp"
#include "compiler/compileLog.hpp" #include "compiler/compileLog.hpp"
#include "gc/g1/g1BarrierSet.hpp"
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/shared/barrierSet.hpp" #include "gc/shared/barrierSet.hpp"
#include "gc/shared/cardTable.hpp" #include "gc/shared/cardTable.hpp"
#include "gc/shared/cardTableBarrierSet.hpp" #include "gc/shared/cardTableBarrierSet.hpp"
@ -48,8 +45,10 @@
#include "opto/runtime.hpp" #include "opto/runtime.hpp"
#include "runtime/deoptimization.hpp" #include "runtime/deoptimization.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1CardTable.hpp"
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#include "gc/g1/heapRegion.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_ALL_GCS
//----------------------------GraphKit----------------------------------------- //----------------------------GraphKit-----------------------------------------
@ -1565,9 +1564,12 @@ void GraphKit::pre_barrier(bool do_load,
BarrierSet* bs = BarrierSet::barrier_set(); BarrierSet* bs = BarrierSet::barrier_set();
set_control(ctl); set_control(ctl);
switch (bs->kind()) { switch (bs->kind()) {
#if INCLUDE_G1GC
case BarrierSet::G1BarrierSet: case BarrierSet::G1BarrierSet:
g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
break; break;
#endif
case BarrierSet::CardTableBarrierSet: case BarrierSet::CardTableBarrierSet:
break; break;
@ -1581,8 +1583,11 @@ void GraphKit::pre_barrier(bool do_load,
bool GraphKit::can_move_pre_barrier() const { bool GraphKit::can_move_pre_barrier() const {
BarrierSet* bs = BarrierSet::barrier_set(); BarrierSet* bs = BarrierSet::barrier_set();
switch (bs->kind()) { switch (bs->kind()) {
#if INCLUDE_G1GC
case BarrierSet::G1BarrierSet: case BarrierSet::G1BarrierSet:
return true; // Can move it if no safepoint return true; // Can move it if no safepoint
#endif
case BarrierSet::CardTableBarrierSet: case BarrierSet::CardTableBarrierSet:
return true; // There is no pre-barrier return true; // There is no pre-barrier
@ -1604,9 +1609,11 @@ void GraphKit::post_barrier(Node* ctl,
BarrierSet* bs = BarrierSet::barrier_set(); BarrierSet* bs = BarrierSet::barrier_set();
set_control(ctl); set_control(ctl);
switch (bs->kind()) { switch (bs->kind()) {
#if INCLUDE_G1GC
case BarrierSet::G1BarrierSet: case BarrierSet::G1BarrierSet:
g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
break; break;
#endif
case BarrierSet::CardTableBarrierSet: case BarrierSet::CardTableBarrierSet:
write_barrier_post(store, obj, adr, adr_idx, val, use_precise); write_barrier_post(store, obj, adr, adr_idx, val, use_precise);
@ -3929,6 +3936,9 @@ void GraphKit::write_barrier_post(Node* oop_store,
// Final sync IdealKit and GraphKit. // Final sync IdealKit and GraphKit.
final_sync(ideal); final_sync(ideal);
} }
#if INCLUDE_G1GC
/* /*
* Determine if the G1 pre-barrier can be removed. The pre-barrier is * Determine if the G1 pre-barrier can be removed. The pre-barrier is
* required by SATB to make sure all objects live at the start of the * required by SATB to make sure all objects live at the start of the
@ -4361,6 +4371,7 @@ void GraphKit::g1_write_barrier_post(Node* oop_store,
} }
#undef __ #undef __
#endif // INCLUDE_G1GC
Node* GraphKit::load_String_length(Node* ctrl, Node* str) { Node* GraphKit::load_String_length(Node* ctrl, Node* str) {
Node* len = load_array_length(load_String_value(ctrl, str)); Node* len = load_array_length(load_String_value(ctrl, str));

View File

@ -768,6 +768,7 @@ class GraphKit : public Phase {
// Used for load_store operations which loads old value. // Used for load_store operations which loads old value.
bool can_move_pre_barrier() const; bool can_move_pre_barrier() const;
#if INCLUDE_G1GC
// G1 pre/post barriers // G1 pre/post barriers
void g1_write_barrier_pre(bool do_load, void g1_write_barrier_pre(bool do_load,
Node* obj, Node* obj,
@ -794,6 +795,7 @@ class GraphKit : public Phase {
bool g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr, BasicType bt, uint adr_idx); bool g1_can_remove_pre_barrier(PhaseTransform* phase, Node* adr, BasicType bt, uint adr_idx);
bool g1_can_remove_post_barrier(PhaseTransform* phase, Node* store, Node* adr); bool g1_can_remove_post_barrier(PhaseTransform* phase, Node* store, Node* adr);
#endif // INCLUDE_G1GC
public: public:
// Helper function to round double arguments before a call // Helper function to round double arguments before a call

View File

@ -47,9 +47,9 @@
#include "opto/subnode.hpp" #include "opto/subnode.hpp"
#include "opto/type.hpp" #include "opto/type.hpp"
#include "runtime/sharedRuntime.hpp" #include "runtime/sharedRuntime.hpp"
#if INCLUDE_ALL_GCS #if INCLUDE_G1GC
#include "gc/g1/g1ThreadLocalData.hpp" #include "gc/g1/g1ThreadLocalData.hpp"
#endif // INCLUDE_ALL_GCS #endif // INCLUDE_G1GC
// //
@ -246,7 +246,9 @@ void PhaseMacroExpand::eliminate_card_mark(Node* p2x) {
assert(mem->is_Store(), "store required"); assert(mem->is_Store(), "store required");
_igvn.replace_node(mem, mem->in(MemNode::Memory)); _igvn.replace_node(mem, mem->in(MemNode::Memory));
} }
} else { }
#if INCLUDE_G1GC
else {
// G1 pre/post barriers // G1 pre/post barriers
assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes"); assert(p2x->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
// It could be only one user, URShift node, in Object.clone() intrinsic // It could be only one user, URShift node, in Object.clone() intrinsic
@ -326,6 +328,7 @@ void PhaseMacroExpand::eliminate_card_mark(Node* p2x) {
assert(p2x->outcnt() == 0 || p2x->unique_out()->Opcode() == Op_URShiftX, ""); assert(p2x->outcnt() == 0 || p2x->unique_out()->Opcode() == Op_URShiftX, "");
_igvn.replace_node(p2x, top()); _igvn.replace_node(p2x, top());
} }
#endif // INCLUDE_G1GC
} }
// Search for a memory operation for the specified memory slice. // Search for a memory operation for the specified memory slice.

View File

@ -141,8 +141,10 @@ bool OptoRuntime::generate(ciEnv* env) {
gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true , false, false); gen(env, _multianewarray4_Java , multianewarray4_Type , multianewarray4_C , 0 , true , false, false);
gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true , false, false); gen(env, _multianewarray5_Java , multianewarray5_Type , multianewarray5_C , 0 , true , false, false);
gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false); gen(env, _multianewarrayN_Java , multianewarrayN_Type , multianewarrayN_C , 0 , true , false, false);
#if INCLUDE_G1GC
gen(env, _g1_wb_pre_Java , g1_wb_pre_Type , SharedRuntime::g1_wb_pre , 0 , false, false, false); gen(env, _g1_wb_pre_Java , g1_wb_pre_Type , SharedRuntime::g1_wb_pre , 0 , false, false, false);
gen(env, _g1_wb_post_Java , g1_wb_post_Type , SharedRuntime::g1_wb_post , 0 , false, false, false); gen(env, _g1_wb_post_Java , g1_wb_post_Type , SharedRuntime::g1_wb_post , 0 , false, false, false);
#endif // INCLUDE_G1GC
gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false, false); gen(env, _complete_monitor_locking_Java , complete_monitor_enter_Type , SharedRuntime::complete_monitor_locking_C, 0, false, false, false);
gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false, false); gen(env, _monitor_notify_Java , monitor_notify_Type , monitor_notify_C , 0 , false, false, false);
gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false, false); gen(env, _monitor_notifyAll_Java , monitor_notify_Type , monitor_notifyAll_C , 0 , false, false, false);

View File

@ -84,8 +84,6 @@
# include "compiler/disassembler.hpp" # include "compiler/disassembler.hpp"
# include "compiler/methodLiveness.hpp" # include "compiler/methodLiveness.hpp"
# include "compiler/oopMap.hpp" # include "compiler/oopMap.hpp"
# include "gc/serial/cSpaceCounters.hpp"
# include "gc/serial/defNewGeneration.hpp"
# include "gc/shared/adaptiveSizePolicy.hpp" # include "gc/shared/adaptiveSizePolicy.hpp"
# include "gc/shared/ageTable.hpp" # include "gc/shared/ageTable.hpp"
# include "gc/shared/barrierSet.hpp" # include "gc/shared/barrierSet.hpp"
@ -294,7 +292,7 @@
#if INCLUDE_JVMCI #if INCLUDE_JVMCI
# include "jvmci/jvmci_globals.hpp" # include "jvmci/jvmci_globals.hpp"
#endif // INCLUDE_JVMCI #endif // INCLUDE_JVMCI
#if INCLUDE_ALL_GCS #if INCLUDE_CMSGC
# include "gc/cms/allocationStats.hpp" # include "gc/cms/allocationStats.hpp"
# include "gc/cms/compactibleFreeListSpace.hpp" # include "gc/cms/compactibleFreeListSpace.hpp"
# include "gc/cms/concurrentMarkSweepGeneration.hpp" # include "gc/cms/concurrentMarkSweepGeneration.hpp"
@ -304,6 +302,8 @@
# include "gc/cms/parOopClosures.hpp" # include "gc/cms/parOopClosures.hpp"
# include "gc/cms/promotionInfo.hpp" # include "gc/cms/promotionInfo.hpp"
# include "gc/cms/yieldingWorkgroup.hpp" # include "gc/cms/yieldingWorkgroup.hpp"
#endif // INCLUDE_CMSGC
#if INCLUDE_G1GC
# include "gc/g1/dirtyCardQueue.hpp" # include "gc/g1/dirtyCardQueue.hpp"
# include "gc/g1/g1BlockOffsetTable.hpp" # include "gc/g1/g1BlockOffsetTable.hpp"
# include "gc/g1/g1OopClosures.hpp" # include "gc/g1/g1OopClosures.hpp"
@ -311,6 +311,8 @@
# include "gc/g1/jvmFlagConstraintsG1.hpp" # include "gc/g1/jvmFlagConstraintsG1.hpp"
# include "gc/g1/ptrQueue.hpp" # include "gc/g1/ptrQueue.hpp"
# include "gc/g1/satbMarkQueue.hpp" # include "gc/g1/satbMarkQueue.hpp"
#endif // INCLUDE_G1GC
#if INCLUDE_PARALLELGC
# include "gc/parallel/gcAdaptivePolicyCounters.hpp" # include "gc/parallel/gcAdaptivePolicyCounters.hpp"
# include "gc/parallel/immutableSpace.hpp" # include "gc/parallel/immutableSpace.hpp"
# include "gc/parallel/jvmFlagConstraintsParallel.hpp" # include "gc/parallel/jvmFlagConstraintsParallel.hpp"
@ -326,8 +328,10 @@
# include "gc/parallel/psVirtualspace.hpp" # include "gc/parallel/psVirtualspace.hpp"
# include "gc/parallel/psYoungGen.hpp" # include "gc/parallel/psYoungGen.hpp"
# include "gc/parallel/spaceCounters.hpp" # include "gc/parallel/spaceCounters.hpp"
# include "gc/shared/gcPolicyCounters.hpp" #endif // INCLUDE_PARALLELGC
# include "gc/shared/plab.hpp" #if INCLUDE_SERIALGC
#endif // INCLUDE_ALL_GCS # include "gc/serial/cSpaceCounters.hpp"
# include "gc/serial/defNewGeneration.hpp"
#endif // INCLUDE_SERIALGC
#endif // !DONT_USE_PRECOMPILED_HEADER #endif // !DONT_USE_PRECOMPILED_HEADER

Some files were not shown because too many files have changed in this diff Show More