--- old/src/cpu/x86/vm/c1_Runtime1_x86.cpp 2017-03-12 11:11:14.718867850 +0100 +++ new/src/cpu/x86/vm/c1_Runtime1_x86.cpp 2017-03-12 11:11:14.662868094 +0100 @@ -1675,6 +1675,10 @@ case g1_post_barrier_slow_id: { + // avoid touching CardTableModRefBS if not G1 + // FIXME: This looks like an upstream bug. + if (!UseG1GC) break; + StubFrame f(sasm, "g1_post_barrier", dont_gc_arguments); --- old/src/cpu/x86/vm/stubGenerator_x86_32.cpp 2017-03-12 11:11:14.950866837 +0100 +++ new/src/cpu/x86/vm/stubGenerator_x86_32.cpp 2017-03-12 11:11:14.890867098 +0100 @@ -688,6 +688,7 @@ case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: + case BarrierSet::Epsilon: break; default : ShouldNotReachHere(); @@ -740,6 +741,7 @@ } break; case BarrierSet::ModRef: + case BarrierSet::Epsilon: break; default : ShouldNotReachHere(); --- old/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2017-03-12 11:11:15.190865788 +0100 +++ new/src/cpu/x86/vm/stubGenerator_x86_64.cpp 2017-03-12 11:11:15.130866051 +0100 @@ -1220,6 +1220,7 @@ case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: + case BarrierSet::Epsilon: break; default: ShouldNotReachHere(); @@ -1281,6 +1282,9 @@ __ jcc(Assembler::greaterEqual, L_loop); } break; + case BarrierSet::Epsilon: + // TODO: why are we here at all? + break; default: ShouldNotReachHere(); --- old/src/cpu/x86/vm/templateTable_x86.cpp 2017-03-12 11:11:15.438864707 +0100 +++ new/src/cpu/x86/vm/templateTable_x86.cpp 2017-03-12 11:11:15.378864968 +0100 @@ -216,6 +216,7 @@ } break; case BarrierSet::ModRef: + case BarrierSet::Epsilon: if (val == noreg) { __ store_heap_oop_null(obj); } else { --- old/src/share/vm/c1/c1_LIRGenerator.cpp 2017-03-12 11:11:15.678863658 +0100 +++ new/src/share/vm/c1/c1_LIRGenerator.cpp 2017-03-12 11:11:15.618863921 +0100 @@ -1462,6 +1462,7 @@ // No pre barriers break; case BarrierSet::ModRef: + case BarrierSet::Epsilon: // No pre barriers break; default : @@ -1482,6 +1483,7 @@ CardTableModRef_post_barrier(addr, new_val); break; case BarrierSet::ModRef: + case BarrierSet::Epsilon: // No post barriers break; default : --- old/src/share/vm/gc/shared/barrierSet.hpp 2017-03-12 11:11:15.918862611 +0100 +++ new/src/share/vm/gc/shared/barrierSet.hpp 2017-03-12 11:11:15.858862872 +0100 @@ -52,7 +52,8 @@ CardTableForRS, // CardTableModRefBSForCTRS CardTableExtension, // CardTableExtension G1SATBCT, // G1SATBCardTableModRefBS - G1SATBCTLogging // G1SATBCardTableLoggingModRefBS + G1SATBCTLogging, // G1SATBCardTableLoggingModRefBS + Epsilon, // EpsilonBarrierSet }; protected: --- old/src/share/vm/gc/shared/collectedHeap.hpp 2017-03-12 11:11:16.122861721 +0100 +++ new/src/share/vm/gc/shared/collectedHeap.hpp 2017-03-12 11:11:16.062861982 +0100 @@ -191,7 +191,8 @@ enum Name { GenCollectedHeap, ParallelScavengeHeap, - G1CollectedHeap + G1CollectedHeap, + EpsilonCollectedHeap, }; static inline size_t filler_array_max_size() { --- old/src/share/vm/jvmci/jvmciCompilerToVM.cpp 2017-03-12 11:11:16.342860759 +0100 +++ new/src/share/vm/jvmci/jvmciCompilerToVM.cpp 2017-03-12 11:11:16.282861022 +0100 @@ -174,6 +174,7 @@ break; } case BarrierSet::ModRef: + case BarrierSet::Epsilon: cardtable_start_address = 0; cardtable_shift = 0; // No post barriers --- old/src/share/vm/memory/universe.cpp 2017-03-12 11:11:16.586859695 +0100 +++ new/src/share/vm/memory/universe.cpp 2017-03-12 11:11:16.526859956 +0100 @@ -82,6 +82,8 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1CollectorPolicy.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" +#include "gc/epsilon/epsilonCollectedHeap.hpp" +#include "gc/epsilon/epsilonCollectorPolicy.hpp" #include "gc/shared/adaptiveSizePolicy.hpp" #endif // INCLUDE_ALL_GCS #if INCLUDE_CDS @@ -735,6 +737,8 @@ #endif } else if (UseSerialGC) { return Universe::create_heap_with_policy(); + } else if (UseEpsilonGC) { + return Universe::create_heap_with_policy(); } ShouldNotReachHere(); --- old/src/share/vm/opto/graphKit.cpp 2017-03-12 11:11:16.834858612 +0100 +++ new/src/share/vm/opto/graphKit.cpp 2017-03-12 11:11:16.774858873 +0100 @@ -1538,6 +1538,7 @@ case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: + case BarrierSet::Epsilon: break; default : @@ -1555,6 +1556,7 @@ case BarrierSet::CardTableForRS: case BarrierSet::CardTableExtension: case BarrierSet::ModRef: + case BarrierSet::Epsilon: return true; // There is no pre-barrier default : @@ -1584,6 +1586,7 @@ break; case BarrierSet::ModRef: + case BarrierSet::Epsilon: break; default : --- old/src/share/vm/precompiled/precompiled.hpp 2017-03-12 11:11:17.078857546 +0100 +++ new/src/share/vm/precompiled/precompiled.hpp 2017-03-12 11:11:17.018857809 +0100 @@ -299,6 +299,7 @@ # include "gc/cms/parOopClosures.hpp" # include "gc/cms/promotionInfo.hpp" # include "gc/cms/yieldingWorkgroup.hpp" +# include "gc/epsilon/epsilon_globals.hpp" # include "gc/g1/dirtyCardQueue.hpp" # include "gc/g1/g1BlockOffsetTable.hpp" # include "gc/g1/g1OopClosures.hpp" --- old/src/share/vm/runtime/arguments.cpp 2017-03-12 11:11:17.306856551 +0100 +++ new/src/share/vm/runtime/arguments.cpp 2017-03-12 11:11:17.238856847 +0100 @@ -1760,7 +1760,7 @@ bool Arguments::gc_selected() { #if INCLUDE_ALL_GCS - return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC; + return UseSerialGC || UseParallelGC || UseParallelOldGC || UseConcMarkSweepGC || UseG1GC || UseEpsilonGC; #else return UseSerialGC; #endif // INCLUDE_ALL_GCS @@ -1984,6 +1984,20 @@ log_trace(gc)("MarkStackSize: %uk MarkStackSizeMax: %uk", (unsigned int) (MarkStackSize / K), (uint) (MarkStackSizeMax / K)); } +void Arguments::set_epsilon_flags() { + assert(UseEpsilonGC, "Error"); + + // Forcefully exit when OOME is detected. Nothing we can do at that point. + if (FLAG_IS_DEFAULT(ExitOnOutOfMemoryError)) { + FLAG_SET_DEFAULT(ExitOnOutOfMemoryError, true); + } + + if (EpsilonTLABSize < MinTLABSize) { + warning("EpsilonTLABSize < MinTLABSize, adjusting it to " SIZE_FORMAT, MinTLABSize); + EpsilonTLABSize = MinTLABSize; + } +} + void Arguments::set_gc_specific_flags() { #if INCLUDE_ALL_GCS // Set per-collector flags @@ -1993,6 +2007,8 @@ set_cms_and_parnew_gc_flags(); } else if (UseG1GC) { set_g1_gc_flags(); + } else if (UseEpsilonGC) { + set_epsilon_flags(); } if (AssumeMP && !UseSerialGC) { if (FLAG_IS_DEFAULT(ParallelGCThreads) && ParallelGCThreads == 1) { @@ -2356,6 +2372,7 @@ if (UseConcMarkSweepGC) i++; if (UseParallelGC || UseParallelOldGC) i++; if (UseG1GC) i++; + if (UseEpsilonGC) i++; if (i > 1) { jio_fprintf(defaultStream::error_stream(), "Conflicting collector combinations in option list; " --- old/src/share/vm/runtime/arguments.hpp 2017-03-12 11:11:17.594855300 +0100 +++ new/src/share/vm/runtime/arguments.hpp 2017-03-12 11:11:17.530855578 +0100 @@ -468,6 +468,8 @@ static void set_parallel_gc_flags(); // Garbage-First (UseG1GC) static void set_g1_gc_flags(); + // Epsilon + static void set_epsilon_flags(); // GC ergonomics static void set_conservative_max_heap_alignment(); static void set_use_compressed_oops(); --- old/src/share/vm/runtime/commandLineFlagConstraintList.cpp 2017-03-12 11:11:17.822854308 +0100 +++ new/src/share/vm/runtime/commandLineFlagConstraintList.cpp 2017-03-12 11:11:17.762854569 +0100 @@ -297,6 +297,19 @@ IGNORE_RANGE, EMIT_CONSTRAINT_CHECK, IGNORE_WRITEABLE)); + emit_constraint_no(NULL EPSILON_FLAGS(EMIT_CONSTRAINT_DEVELOPER_FLAG, + EMIT_CONSTRAINT_PD_DEVELOPER_FLAG, + EMIT_CONSTRAINT_PRODUCT_FLAG, + EMIT_CONSTRAINT_PD_PRODUCT_FLAG, + EMIT_CONSTRAINT_DIAGNOSTIC_FLAG, + EMIT_CONSTRAINT_PD_DIAGNOSTIC_FLAG, + EMIT_CONSTRAINT_EXPERIMENTAL_FLAG, + EMIT_CONSTRAINT_NOTPRODUCT_FLAG, + EMIT_CONSTRAINT_MANAGEABLE_FLAG, + EMIT_CONSTRAINT_PRODUCT_RW_FLAG, + IGNORE_RANGE, + EMIT_CONSTRAINT_CHECK, + IGNORE_WRITEABLE)); #endif // INCLUDE_ALL_GCS } --- old/src/share/vm/runtime/commandLineFlagRangeList.cpp 2017-03-12 11:11:18.030853423 +0100 +++ new/src/share/vm/runtime/commandLineFlagRangeList.cpp 2017-03-12 11:11:17.970853666 +0100 @@ -376,6 +376,19 @@ EMIT_RANGE_CHECK, IGNORE_CONSTRAINT, IGNORE_WRITEABLE)); + emit_range_no(NULL EPSILON_FLAGS(EMIT_RANGE_DEVELOPER_FLAG, + EMIT_RANGE_PD_DEVELOPER_FLAG, + EMIT_RANGE_PRODUCT_FLAG, + EMIT_RANGE_PD_PRODUCT_FLAG, + EMIT_RANGE_DIAGNOSTIC_FLAG, + EMIT_RANGE_PD_DIAGNOSTIC_FLAG, + EMIT_RANGE_EXPERIMENTAL_FLAG, + EMIT_RANGE_NOTPRODUCT_FLAG, + EMIT_RANGE_MANAGEABLE_FLAG, + EMIT_RANGE_PRODUCT_RW_FLAG, + EMIT_RANGE_CHECK, + IGNORE_CONSTRAINT, + IGNORE_WRITEABLE)); #endif // INCLUDE_ALL_GCS } --- old/src/share/vm/runtime/commandLineFlagWriteableList.cpp 2017-03-12 11:11:18.250852591 +0100 +++ new/src/share/vm/runtime/commandLineFlagWriteableList.cpp 2017-03-12 11:11:18.190852818 +0100 @@ -203,6 +203,19 @@ IGNORE_RANGE, IGNORE_CONSTRAINT, EMIT_WRITEABLE)); + emit_writeable_no(NULL EPSILON_FLAGS(EMIT_WRITEABLE_DEVELOPER_FLAG, + EMIT_WRITEABLE_PD_DEVELOPER_FLAG, + EMIT_WRITEABLE_PRODUCT_FLAG, + EMIT_WRITEABLE_PD_PRODUCT_FLAG, + EMIT_WRITEABLE_DIAGNOSTIC_FLAG, + EMIT_WRITEABLE_PD_DIAGNOSTIC_FLAG, + EMIT_WRITEABLE_EXPERIMENTAL_FLAG, + EMIT_WRITEABLE_NOTPRODUCT_FLAG, + EMIT_WRITEABLE_MANAGEABLE_FLAG, + EMIT_WRITEABLE_PRODUCT_RW_FLAG, + IGNORE_RANGE, + IGNORE_CONSTRAINT, + EMIT_WRITEABLE)); #endif // INCLUDE_ALL_GCS } --- old/src/share/vm/runtime/globals.cpp 2017-03-12 11:11:18.474851745 +0100 +++ new/src/share/vm/runtime/globals.cpp 2017-03-12 11:11:18.414851972 +0100 @@ -39,6 +39,7 @@ #include "utilities/ostream.hpp" #if INCLUDE_ALL_GCS #include "gc/g1/g1_globals.hpp" +#include "gc/epsilon/epsilon_globals.hpp" #endif // INCLUDE_ALL_GCS #ifdef COMPILER1 #include "c1/c1_globals.hpp" @@ -790,6 +791,19 @@ RUNTIME_PD_DEVELOP_FLAG_STRUCT, \ RUNTIME_PRODUCT_FLAG_STRUCT, \ RUNTIME_PD_PRODUCT_FLAG_STRUCT, \ + RUNTIME_DIAGNOSTIC_FLAG_STRUCT, \ + RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT, \ + RUNTIME_EXPERIMENTAL_FLAG_STRUCT, \ + RUNTIME_NOTPRODUCT_FLAG_STRUCT, \ + RUNTIME_MANAGEABLE_FLAG_STRUCT, \ + RUNTIME_PRODUCT_RW_FLAG_STRUCT, \ + IGNORE_RANGE, \ + IGNORE_CONSTRAINT, \ + IGNORE_WRITEABLE) + EPSILON_FLAGS(RUNTIME_DEVELOP_FLAG_STRUCT, \ + RUNTIME_PD_DEVELOP_FLAG_STRUCT, \ + RUNTIME_PRODUCT_FLAG_STRUCT, \ + RUNTIME_PD_PRODUCT_FLAG_STRUCT, \ RUNTIME_DIAGNOSTIC_FLAG_STRUCT, \ RUNTIME_PD_DIAGNOSTIC_FLAG_STRUCT, \ RUNTIME_EXPERIMENTAL_FLAG_STRUCT, \ --- old/src/share/vm/runtime/globals.hpp 2017-03-12 11:11:18.714850841 +0100 +++ new/src/share/vm/runtime/globals.hpp 2017-03-12 11:11:18.646851096 +0100 @@ -1402,6 +1402,9 @@ product(bool, UseParallelOldGC, false, \ "Use the Parallel Old garbage collector") \ \ + experimental(bool, UseEpsilonGC, false, \ + "Use the Epsilon (no-op) garbage collector") \ + \ product(uintx, HeapMaximumCompactionInterval, 20, \ "How often should we maximally compact the heap (not allowing " \ "any dead space)") \ --- old/src/share/vm/runtime/globals_extension.hpp 2017-03-12 11:11:18.966849889 +0100 +++ new/src/share/vm/runtime/globals_extension.hpp 2017-03-12 11:11:18.906850116 +0100 @@ -30,6 +30,7 @@ #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS #include "gc/g1/g1_globals.hpp" +#include "gc/epsilon/epsilon_globals.hpp" #endif #if INCLUDE_JVMCI #include "jvmci/jvmci_globals.hpp" @@ -134,6 +135,19 @@ IGNORE_RANGE, \ IGNORE_CONSTRAINT, \ IGNORE_WRITEABLE) + EPSILON_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER, \ + RUNTIME_PD_DEVELOP_FLAG_MEMBER, \ + RUNTIME_PRODUCT_FLAG_MEMBER, \ + RUNTIME_PD_PRODUCT_FLAG_MEMBER, \ + RUNTIME_DIAGNOSTIC_FLAG_MEMBER, \ + RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER, \ + RUNTIME_EXPERIMENTAL_FLAG_MEMBER, \ + RUNTIME_NOTPRODUCT_FLAG_MEMBER, \ + RUNTIME_MANAGEABLE_FLAG_MEMBER, \ + RUNTIME_PRODUCT_RW_FLAG_MEMBER, \ + IGNORE_RANGE, \ + IGNORE_CONSTRAINT, \ + IGNORE_WRITEABLE) #endif // INCLUDE_ALL_GCS #if INCLUDE_JVMCI JVMCI_FLAGS(JVMCI_DEVELOP_FLAG_MEMBER, \ @@ -268,6 +282,19 @@ RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE, RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE, RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE, + RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE, + RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE, + RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE, + RUNTIME_NOTPRODUCT_FLAG_MEMBER_WITH_TYPE, + RUNTIME_MANAGEABLE_FLAG_MEMBER_WITH_TYPE, + RUNTIME_PRODUCT_RW_FLAG_MEMBER_WITH_TYPE, + IGNORE_RANGE, + IGNORE_CONSTRAINT, + IGNORE_WRITEABLE) + EPSILON_FLAGS(RUNTIME_DEVELOP_FLAG_MEMBER_WITH_TYPE, + RUNTIME_PD_DEVELOP_FLAG_MEMBER_WITH_TYPE, + RUNTIME_PRODUCT_FLAG_MEMBER_WITH_TYPE, + RUNTIME_PD_PRODUCT_FLAG_MEMBER_WITH_TYPE, RUNTIME_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE, RUNTIME_PD_DIAGNOSTIC_FLAG_MEMBER_WITH_TYPE, RUNTIME_EXPERIMENTAL_FLAG_MEMBER_WITH_TYPE, --- old/src/share/vm/services/memoryManager.cpp 2017-03-12 11:11:19.174849106 +0100 +++ new/src/share/vm/services/memoryManager.cpp 2017-03-12 11:11:19.114849331 +0100 @@ -91,6 +91,10 @@ return (GCMemoryManager*) new G1OldGenMemoryManager(); } +GCMemoryManager* MemoryManager::get_epsilon_memory_manager() { + return (GCMemoryManager*) new EpsilonMemoryManager(); +} + instanceOop MemoryManager::get_memory_manager_instance(TRAPS) { // Must do an acquire so as to force ordering of subsequent // loads from anything _memory_mgr_obj points to or implies. --- old/src/share/vm/services/memoryManager.hpp 2017-03-12 11:11:19.386848305 +0100 +++ new/src/share/vm/services/memoryManager.hpp 2017-03-12 11:11:19.322848548 +0100 @@ -83,6 +83,7 @@ static GCMemoryManager* get_psMarkSweep_memory_manager(); static GCMemoryManager* get_g1YoungGen_memory_manager(); static GCMemoryManager* get_g1OldGen_memory_manager(); + static GCMemoryManager* get_epsilon_memory_manager(); }; class CodeCacheMemoryManager : public MemoryManager { @@ -253,4 +254,12 @@ const char* name() { return "G1 Old Generation"; } }; +class EpsilonMemoryManager : public GCMemoryManager { +private: +public: + EpsilonMemoryManager() : GCMemoryManager() {} + + const char* name() { return "Epsilon Generation"; } +}; + #endif // SHARE_VM_SERVICES_MEMORYMANAGER_HPP --- old/src/share/vm/services/memoryService.cpp 2017-03-12 11:11:19.602847492 +0100 +++ new/src/share/vm/services/memoryService.cpp 2017-03-12 11:11:19.542847717 +0100 @@ -99,6 +99,10 @@ add_g1_heap_info(G1CollectedHeap::heap()); break; } + case CollectedHeap::EpsilonCollectedHeap : { + add_epsilon_heap_info(); + break; + } #endif // INCLUDE_ALL_GCS default: { guarantee(false, "Unrecognized kind of heap"); @@ -188,6 +192,18 @@ add_g1YoungGen_memory_pool(g1h, _major_gc_manager, _minor_gc_manager); add_g1OldGen_memory_pool(g1h, _major_gc_manager); } + +void MemoryService::add_epsilon_heap_info() { + assert(UseEpsilonGC, "sanity"); + + _minor_gc_manager = MemoryManager::get_epsilon_memory_manager(); + _major_gc_manager = MemoryManager::get_epsilon_memory_manager(); + _managers_list->append(_minor_gc_manager); + _managers_list->append(_major_gc_manager); +// TODO: fix these? +// add_g1YoungGen_memory_pool(g1h, _major_gc_manager, _minor_gc_manager); +// add_g1OldGen_memory_pool(g1h, _major_gc_manager); +} #endif // INCLUDE_ALL_GCS MemoryPool* MemoryService::add_gen(Generation* gen, --- old/src/share/vm/services/memoryService.hpp 2017-03-12 11:11:19.822846661 +0100 +++ new/src/share/vm/services/memoryService.hpp 2017-03-12 11:11:19.750846934 +0100 @@ -116,6 +116,7 @@ static void add_gen_collected_heap_info(GenCollectedHeap* heap); static void add_parallel_scavenge_heap_info(ParallelScavengeHeap* heap); static void add_g1_heap_info(G1CollectedHeap* g1h); + static void add_epsilon_heap_info(); public: static void set_universe_heap(CollectedHeap* heap); --- old/src/share/vm/utilities/vmError.cpp 2017-03-12 11:11:20.062845757 +0100 +++ new/src/share/vm/utilities/vmError.cpp 2017-03-12 11:11:20.006845967 +0100 @@ -247,6 +247,7 @@ if (UseParallelGC) return "parallel gc"; if (UseConcMarkSweepGC) return "concurrent mark sweep gc"; if (UseSerialGC) return "serial gc"; + if (UseEpsilonGC) return "epsilon gc"; return "ERROR in GC mode"; } --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilonBarrierSet.hpp 2017-03-12 11:11:20.238845093 +0100 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * + * 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 HOTSPOT_EPSILONBARRIERSET_HPP_H +#define HOTSPOT_EPSILONBARRIERSET_HPP_H + +#include "gc/shared/collectorPolicy.hpp" +#include "gc/shared/barrierSet.hpp" + +// Most are no-ops. +class EpsilonBarrierSet: public ModRefBarrierSet { + friend class VMStructs; + +public: + EpsilonBarrierSet() : + ModRefBarrierSet(BarrierSet::FakeRtti(BarrierSet::Epsilon)) {}; + + virtual bool has_write_ref_barrier() { return false; } + virtual bool has_write_ref_pre_barrier() { return false; } + virtual bool has_write_ref_array_opt() { return true; } // TODO: why? + virtual bool has_write_region_opt() { return true; } // TODO: why? + + virtual bool is_aligned(HeapWord *addr) { return true; } // TODO: Safe? + + virtual void resize_covered_region(MemRegion new_region) {} + virtual void print_on(outputStream *st) const {} + +protected: + virtual void write_ref_field_work(void *field, oop new_val, bool release) {} + virtual void write_ref_array_work(MemRegion mr) {} + virtual void write_region_work(MemRegion mr) {} + +public: + virtual void invalidate(MemRegion mr) {} + virtual void clear(MemRegion mr) {} +}; + +template<> +struct BarrierSet::GetName { + static const BarrierSet::Name value = BarrierSet::Epsilon; +}; + +#endif --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilonCollectedHeap.cpp 2017-03-12 11:11:20.430844368 +0100 @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * + * 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. + * + */ + +#include "oops/oop.hpp" +#include "oops/oop.inline.hpp" +#include "utilities/copy.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "epsilonCollectedHeap.hpp" +#include "epsilonBarrierSet.hpp" + +jint EpsilonCollectedHeap::initialize() { + CollectedHeap::pre_initialize(); + + size_t max_byte_size = _policy->max_heap_byte_size(); + size_t align = _policy->heap_alignment(); + + ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size, align); + + _start = (HeapWord *) heap_rs.base(); + _current = _start; + _end = (HeapWord *) (heap_rs.base() + heap_rs.size()); + size_t size = pointer_delta(_end, _start); + + initialize_reserved_region(_start, _end); + os::commit_memory((char*)_start, size*HeapWordSize, align, false); + if (AlwaysPreTouch) { + // TODO: Use shared code instead of this. Also pick up large pages, if available. + os::pretouch_memory(_start, _end); + } + + EpsilonBarrierSet* bs = new EpsilonBarrierSet(); + set_barrier_set(bs); + + log_info(gc)("Initialized with " SIZE_FORMAT "M non-resizable heap.", size*HeapWordSize / M); + if (UseTLAB) { + log_info(gc)("Using " SIZE_FORMAT "K TLABs.", EpsilonTLABSize / K); + } else { + log_info(gc)("Not using TLAB allocation."); + } + + return JNI_OK; +} + +HeapWord* EpsilonCollectedHeap::allocate_work(size_t size) { + do { + HeapWord* obj = (HeapWord *) _current; + if (pointer_delta(_end, obj) >= size) { + HeapWord* new_current = obj + size; + HeapWord* result = (HeapWord*)Atomic::cmpxchg_ptr(new_current, &_current, obj); + if (result != obj) { + continue; + } + assert(is_object_aligned((intptr_t)obj), "object is aligned"); + assert(is_object_aligned((intptr_t)new_current), "current is aligned"); + return obj; + } else { + return NULL; + } + } while (true); +} + +HeapWord* EpsilonCollectedHeap::allocate_new_tlab(size_t size) { + return allocate_work(size); +} + +HeapWord* EpsilonCollectedHeap::mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded) { + *gc_overhead_limit_was_exceeded = false; + return allocate_work(size); +} + +void EpsilonCollectedHeap::collect(GCCause::Cause cause) { + log_warning(gc)("GC was triggered with cause \"%s\". Ignoring.", GCCause::to_string(cause)); +} + +void EpsilonCollectedHeap::do_full_collection(bool clear_all_soft_refs) { + log_warning(gc)("Full GC was triggered. Ignoring."); +} + +void EpsilonCollectedHeap::safe_object_iterate(ObjectClosure *cl) { + HeapWord* mark = _start; + while (mark < _current) { + oop obj = oop(mark); + cl->do_object(obj); + mark += obj->size(); + } +} --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilonCollectedHeap.hpp 2017-03-12 11:11:20.626843628 +0100 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * + * 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. + * + */ + +#include "gc/shared/collectedHeap.hpp" +#include "gc/epsilon/epsilonCollectorPolicy.hpp" +#include "gc/epsilon/epsilonBarrierSet.hpp" +#include "gc/epsilon/epsilon_globals.hpp" + +class EpsilonCollectedHeap : public CollectedHeap { +private: + EpsilonCollectorPolicy* _policy; + HeapWord* _start; + HeapWord* _end; + volatile HeapWord* _current; +public: + EpsilonCollectedHeap(EpsilonCollectorPolicy* p) : _policy(p) {}; + + virtual Name kind() const { + return CollectedHeap::EpsilonCollectedHeap; + } + + virtual const char *name() const { + return "Epsilon GC"; + } + + virtual jint initialize(); + + virtual void post_initialize() {} + + virtual size_t capacity() const { return pointer_delta(_end, _start); } + virtual size_t used() const { return pointer_delta((HeapWord*)_current, _start); } + virtual size_t max_capacity() const { return capacity(); } + + virtual bool is_maximal_no_gc() const { return used() == capacity(); } // TODO: Really? + + virtual bool is_in(const void *p) const { return (_start <= p) && (p < _end); } + + virtual bool is_scavengable(const void *p) { return true; } // TODO: Why? + + virtual HeapWord* mem_allocate(size_t size, bool *gc_overhead_limit_was_exceeded); + virtual HeapWord* allocate_new_tlab(size_t size); + + virtual HeapWord* allocate_work(size_t size); + + // TLAB allocations + virtual bool supports_tlab_allocation() const { return UseTLAB; } + virtual size_t tlab_capacity(Thread *thr) const { return capacity(); } + virtual size_t tlab_used(Thread *thr) const { return used(); } // TODO: Should probably record the TLAB? + virtual size_t unsafe_max_tlab_alloc(Thread *thr) const { + // TODO: hook up in TLAB policy better. + return EpsilonTLABSize; + } + + virtual bool can_elide_tlab_store_barriers() const { + return true; // TODO: Really? + } + + virtual bool can_elide_initializing_store_barrier(oop new_obj) { + return true; // TODO: Really? + } + + virtual bool card_mark_must_follow_store() const { + return false; // TODO: Really? + } + + virtual void collect(GCCause::Cause cause); + virtual void do_full_collection(bool clear_all_soft_refs); + + virtual AdaptiveSizePolicy *size_policy() { + // No such thing for Epsilon + return NULL; + } + + virtual CollectorPolicy *collector_policy() const { + return _policy; + } + + virtual void object_iterate(ObjectClosure *cl) { + safe_object_iterate(cl); + } + + virtual void safe_object_iterate(ObjectClosure *cl); + + virtual HeapWord *block_start(const void *addr) const { + Unimplemented(); + return NULL; + } + + virtual size_t block_size(const HeapWord *addr) const { + Unimplemented(); + return 0; + } + + virtual bool block_is_obj(const HeapWord *addr) const { + Unimplemented(); + return false; + } + + virtual jlong millis_since_last_gc() { + return os::elapsed_counter() / NANOSECS_PER_MILLISEC; // since the VM start + } + + virtual void prepare_for_verify() { + // No heap verification. + } + + virtual void print_on(outputStream *st) const { + // Print nothing. + } + + virtual void print_gc_threads_on(outputStream *st) const { + // No GC threads. + } + + virtual void gc_threads_do(ThreadClosure *tc) const { + // No GC threads. + } + + virtual void print_tracing_info() const { + Log(gc) log; + size_t allocated_kb = pointer_delta((HeapWord*)_current, _start) * HeapWordSize / K; + log.info("Total allocated: " SIZE_FORMAT " KB.", + allocated_kb); + log.info("Average allocation rate: " SIZE_FORMAT " KB/sec", + allocated_kb * NANOSECS_PER_SEC / os::elapsed_counter()); + } + + virtual void verify(VerifyOption option) { + // No heap verification for Epsilon. + } + +}; --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilonCollectorPolicy.hpp 2017-03-12 11:11:20.822842888 +0100 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * + * 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 HOTSPOT_EPSILONCOLLECTORPOLICY_HPP_H +#define HOTSPOT_EPSILONCOLLECTORPOLICY_HPP_H + +#include "gc/shared/collectorPolicy.hpp" + +class EpsilonCollectorPolicy: public CollectorPolicy { +protected: + virtual void initialize_alignments() { + size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size(); + _space_alignment = page_size; + _heap_alignment = page_size; + } + +public: + EpsilonCollectorPolicy() : CollectorPolicy() {}; +}; + +#endif --- old/src/share/vm/gc/g1/g1_globals.cpp 2017-03-12 11:11:21.114841787 +0100 +++ /dev/null 2017-03-08 12:03:25.330745819 +0100 @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001, 2016, 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. - * - */ - -#include "precompiled.hpp" -#include "gc/g1/g1_globals.hpp" - -G1_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \ - MATERIALIZE_PD_DEVELOPER_FLAG, \ - MATERIALIZE_PRODUCT_FLAG, \ - MATERIALIZE_PD_PRODUCT_FLAG, \ - MATERIALIZE_DIAGNOSTIC_FLAG, \ - MATERIALIZE_PD_DIAGNOSTIC_FLAG, \ - MATERIALIZE_EXPERIMENTAL_FLAG, \ - MATERIALIZE_NOTPRODUCT_FLAG, \ - MATERIALIZE_MANAGEABLE_FLAG, \ - MATERIALIZE_PRODUCT_RW_FLAG, \ - IGNORE_RANGE, \ - IGNORE_CONSTRAINT, \ - IGNORE_WRITEABLE) --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilon_globals.cpp 2017-03-12 11:11:21.010842181 +0100 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * 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. + * + */ + +#include "precompiled.hpp" +#include "gc/epsilon/epsilon_globals.hpp" + +EPSILON_FLAGS(MATERIALIZE_DEVELOPER_FLAG, \ + MATERIALIZE_PD_DEVELOPER_FLAG, \ + MATERIALIZE_PRODUCT_FLAG, \ + MATERIALIZE_PD_PRODUCT_FLAG, \ + MATERIALIZE_DIAGNOSTIC_FLAG, \ + MATERIALIZE_PD_DIAGNOSTIC_FLAG, \ + MATERIALIZE_EXPERIMENTAL_FLAG, \ + MATERIALIZE_NOTPRODUCT_FLAG, \ + MATERIALIZE_MANAGEABLE_FLAG, \ + MATERIALIZE_PRODUCT_RW_FLAG, \ + IGNORE_RANGE, \ + IGNORE_CONSTRAINT, \ + IGNORE_WRITEABLE) --- old/src/share/vm/gc/g1/g1_globals.hpp 2017-03-12 11:11:21.374840807 +0100 +++ /dev/null 2017-03-08 12:03:25.330745819 +0100 @@ -1,336 +0,0 @@ -/* - * Copyright (c) 2001, 2016, 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_VM_GC_G1_G1_GLOBALS_HPP -#define SHARE_VM_GC_G1_G1_GLOBALS_HPP - -#include "runtime/globals.hpp" -#include // for DBL_MAX -// -// Defines all globals flags used by the garbage-first compiler. -// - -#define G1_FLAGS(develop, \ - develop_pd, \ - product, \ - product_pd, \ - diagnostic, \ - diagnostic_pd, \ - experimental, \ - notproduct, \ - manageable, \ - product_rw, \ - range, \ - constraint, \ - writeable) \ - \ - product(bool, G1UseAdaptiveIHOP, true, \ - "Adaptively adjust the initiating heap occupancy from the " \ - "initial value of InitiatingHeapOccupancyPercent. The policy " \ - "attempts to start marking in time based on application " \ - "behavior.") \ - \ - experimental(size_t, G1AdaptiveIHOPNumInitialSamples, 3, \ - "How many completed time periods from initial mark to first " \ - "mixed gc are required to use the input values for prediction " \ - "of the optimal occupancy to start marking.") \ - range(1, max_intx) \ - \ - product(uintx, G1ConfidencePercent, 50, \ - "Confidence level for MMU/pause predictions") \ - range(0, 100) \ - \ - develop(intx, G1MarkingOverheadPercent, 0, \ - "Overhead of concurrent marking") \ - range(0, 100) \ - \ - diagnostic(intx, G1SummarizeRSetStatsPeriod, 0, \ - "The period (in number of GCs) at which we will generate " \ - "update buffer processing info " \ - "(0 means do not periodically generate this info); " \ - "it also requires that logging is enabled on the trace" \ - "level for gc+remset") \ - range(0, max_intx) \ - \ - product(double, G1ConcMarkStepDurationMillis, 10.0, \ - "Target duration of individual concurrent marking steps " \ - "in milliseconds.") \ - range(1.0, DBL_MAX) \ - \ - product(intx, G1RefProcDrainInterval, 10, \ - "The number of discovered reference objects to process before " \ - "draining concurrent marking work queues.") \ - range(1, max_intx) \ - \ - experimental(double, G1LastPLABAverageOccupancy, 50.0, \ - "The expected average occupancy of the last PLAB in " \ - "percent.") \ - range(0.001, 100.0) \ - \ - product(size_t, G1SATBBufferSize, 1*K, \ - "Number of entries in an SATB log buffer.") \ - range(1, max_uintx) \ - \ - develop(intx, G1SATBProcessCompletedThreshold, 20, \ - "Number of completed buffers that triggers log processing.") \ - range(0, max_jint) \ - \ - product(uintx, G1SATBBufferEnqueueingThresholdPercent, 60, \ - "Before enqueueing them, each mutator thread tries to do some " \ - "filtering on the SATB buffers it generates. If post-filtering " \ - "the percentage of retained entries is over this threshold " \ - "the buffer will be enqueued for processing. A value of 0 " \ - "specifies that mutator threads should not do such filtering.") \ - range(0, 100) \ - \ - experimental(intx, G1ExpandByPercentOfAvailable, 20, \ - "When expanding, % of uncommitted space to claim.") \ - range(0, 100) \ - \ - develop(bool, G1RSBarrierRegionFilter, true, \ - "If true, generate region filtering code in RS barrier") \ - \ - product(size_t, G1UpdateBufferSize, 256, \ - "Size of an update buffer") \ - range(1, NOT_LP64(32*M) LP64_ONLY(1*G)) \ - \ - product(size_t, G1ConcRefinementYellowZone, 0, \ - "Number of enqueued update buffers that will " \ - "trigger concurrent processing. Will be selected ergonomically " \ - "by default.") \ - range(0, max_intx) \ - \ - product(size_t, G1ConcRefinementRedZone, 0, \ - "Maximum number of enqueued update buffers before mutator " \ - "threads start processing new ones instead of enqueueing them. " \ - "Will be selected ergonomically by default.") \ - range(0, max_intx) \ - \ - product(size_t, G1ConcRefinementGreenZone, 0, \ - "The number of update buffers that are left in the queue by the " \ - "concurrent processing threads. Will be selected ergonomically " \ - "by default.") \ - range(0, max_intx) \ - \ - product(uintx, G1ConcRefinementServiceIntervalMillis, 300, \ - "The last concurrent refinement thread wakes up every " \ - "specified number of milliseconds to do miscellaneous work.") \ - range(0, max_jint) \ - \ - product(size_t, G1ConcRefinementThresholdStep, 2, \ - "Each time the rset update queue increases by this amount " \ - "activate the next refinement thread if available. " \ - "The actual step size will be selected ergonomically by " \ - "default, with this value used to determine a lower bound.") \ - range(1, SIZE_MAX) \ - \ - product(intx, G1RSetUpdatingPauseTimePercent, 10, \ - "A target percentage of time that is allowed to be spend on " \ - "process RS update buffers during the collection pause.") \ - range(0, 100) \ - \ - product(bool, G1UseAdaptiveConcRefinement, true, \ - "Select green, yellow and red zones adaptively to meet the " \ - "the pause requirements.") \ - \ - product(size_t, G1ConcRSLogCacheSize, 10, \ - "Log base 2 of the length of conc RS hot-card cache.") \ - range(0, 27) \ - \ - product(uintx, G1ConcRSHotCardLimit, 4, \ - "The threshold that defines (>=) a hot card.") \ - range(0, max_jubyte) \ - \ - develop(intx, G1RSetRegionEntriesBase, 256, \ - "Max number of regions in a fine-grain table per MB.") \ - range(1, max_jint/wordSize) \ - \ - product(intx, G1RSetRegionEntries, 0, \ - "Max number of regions for which we keep bitmaps." \ - "Will be set ergonomically by default") \ - range(0, max_jint/wordSize) \ - constraint(G1RSetRegionEntriesConstraintFunc,AfterErgo) \ - \ - develop(intx, G1RSetSparseRegionEntriesBase, 4, \ - "Max number of entries per region in a sparse table " \ - "per MB.") \ - range(1, max_jint/wordSize) \ - \ - product(intx, G1RSetSparseRegionEntries, 0, \ - "Max number of entries per region in a sparse table." \ - "Will be set ergonomically by default.") \ - range(0, max_jint/wordSize) \ - constraint(G1RSetSparseRegionEntriesConstraintFunc,AfterErgo) \ - \ - develop(intx, G1MaxVerifyFailures, -1, \ - "The maximum number of verification failures to print. " \ - "-1 means print all.") \ - range(-1, max_jint) \ - \ - develop(bool, G1ScrubRemSets, true, \ - "When true, do RS scrubbing after cleanup.") \ - \ - product(uintx, G1ReservePercent, 10, \ - "It determines the minimum reserve we should have in the heap " \ - "to minimize the probability of promotion failure.") \ - range(0, 50) \ - \ - develop(bool, G1HRRSUseSparseTable, true, \ - "When true, use sparse table to save space.") \ - \ - develop(bool, G1HRRSFlushLogBuffersOnVerify, false, \ - "Forces flushing of log buffers before verification.") \ - \ - product(size_t, G1HeapRegionSize, 0, \ - "Size of the G1 regions.") \ - range(0, 32*M) \ - constraint(G1HeapRegionSizeConstraintFunc,AfterMemoryInit) \ - \ - product(uint, G1ConcRefinementThreads, 0, \ - "The number of parallel rem set update threads. " \ - "Will be set ergonomically by default.") \ - range(0, (max_jint-1)/wordSize) \ - \ - develop(bool, G1VerifyCTCleanup, false, \ - "Verify card table cleanup.") \ - \ - product(size_t, G1RSetScanBlockSize, 64, \ - "Size of a work unit of cards claimed by a worker thread" \ - "during RSet scanning.") \ - range(1, max_uintx) \ - \ - develop(uintx, G1SecondaryFreeListAppendLength, 5, \ - "The number of regions we will add to the secondary free list " \ - "at every append operation") \ - \ - develop(bool, G1StressConcRegionFreeing, false, \ - "It stresses the concurrent region freeing operation") \ - \ - develop(uintx, G1StressConcRegionFreeingDelayMillis, 0, \ - "Artificial delay during concurrent region freeing") \ - \ - develop(uintx, G1DummyRegionsPerGC, 0, \ - "The number of dummy regions G1 will allocate at the end of " \ - "each evacuation pause in order to artificially fill up the " \ - "heap and stress the marking implementation.") \ - \ - develop(bool, G1ExitOnExpansionFailure, false, \ - "Raise a fatal VM exit out of memory failure in the event " \ - " that heap expansion fails due to running out of swap.") \ - \ - experimental(uintx, G1MaxNewSizePercent, 60, \ - "Percentage (0-100) of the heap size to use as default " \ - " maximum young gen size.") \ - range(0, 100) \ - constraint(G1MaxNewSizePercentConstraintFunc,AfterErgo) \ - \ - experimental(uintx, G1NewSizePercent, 5, \ - "Percentage (0-100) of the heap size to use as default " \ - "minimum young gen size.") \ - range(0, 100) \ - constraint(G1NewSizePercentConstraintFunc,AfterErgo) \ - \ - experimental(uintx, G1MixedGCLiveThresholdPercent, 85, \ - "Threshold for regions to be considered for inclusion in the " \ - "collection set of mixed GCs. " \ - "Regions with live bytes exceeding this will not be collected.") \ - range(0, 100) \ - \ - product(uintx, G1HeapWastePercent, 5, \ - "Amount of space, expressed as a percentage of the heap size, " \ - "that G1 is willing not to collect to avoid expensive GCs.") \ - range(0, 100) \ - \ - product(uintx, G1MixedGCCountTarget, 8, \ - "The target number of mixed GCs after a marking cycle.") \ - range(0, max_uintx) \ - \ - experimental(bool, G1PretouchAuxiliaryMemory, false, \ - "Pre-touch large auxiliary data structures used by the GC.") \ - \ - experimental(bool, G1EagerReclaimHumongousObjects, true, \ - "Try to reclaim dead large objects at every young GC.") \ - \ - experimental(bool, G1EagerReclaimHumongousObjectsWithStaleRefs, true, \ - "Try to reclaim dead large objects that have a few stale " \ - "references at every young GC.") \ - \ - experimental(uintx, G1OldCSetRegionThresholdPercent, 10, \ - "An upper bound for the number of old CSet regions expressed " \ - "as a percentage of the heap size.") \ - range(0, 100) \ - \ - notproduct(bool, G1EvacuationFailureALot, false, \ - "Force use of evacuation failure handling during certain " \ - "evacuation pauses") \ - \ - develop(uintx, G1EvacuationFailureALotCount, 1000, \ - "Number of successful evacuations between evacuation failures " \ - "occurring at object copying") \ - \ - develop(uintx, G1EvacuationFailureALotInterval, 5, \ - "Total collections between forced triggering of evacuation " \ - "failures") \ - \ - develop(bool, G1EvacuationFailureALotDuringConcMark, true, \ - "Force use of evacuation failure handling during evacuation " \ - "pauses when marking is in progress") \ - \ - develop(bool, G1EvacuationFailureALotDuringInitialMark, true, \ - "Force use of evacuation failure handling during initial mark " \ - "evacuation pauses") \ - \ - develop(bool, G1EvacuationFailureALotDuringYoungGC, true, \ - "Force use of evacuation failure handling during young " \ - "evacuation pauses") \ - \ - develop(bool, G1EvacuationFailureALotDuringMixedGC, true, \ - "Force use of evacuation failure handling during mixed " \ - "evacuation pauses") \ - \ - diagnostic(bool, G1VerifyRSetsDuringFullGC, false, \ - "If true, perform verification of each heap region's " \ - "remembered set when verifying the heap during a full GC.") \ - \ - diagnostic(bool, G1VerifyHeapRegionCodeRoots, false, \ - "Verify the code root lists attached to each heap region.") \ - \ - develop(bool, G1VerifyBitmaps, false, \ - "Verifies the consistency of the marking bitmaps") - -G1_FLAGS(DECLARE_DEVELOPER_FLAG, \ - DECLARE_PD_DEVELOPER_FLAG, \ - DECLARE_PRODUCT_FLAG, \ - DECLARE_PD_PRODUCT_FLAG, \ - DECLARE_DIAGNOSTIC_FLAG, \ - DECLARE_PD_DIAGNOSTIC_FLAG, \ - DECLARE_EXPERIMENTAL_FLAG, \ - DECLARE_NOTPRODUCT_FLAG, \ - DECLARE_MANAGEABLE_FLAG, \ - DECLARE_PRODUCT_RW_FLAG, \ - IGNORE_RANGE, \ - IGNORE_CONSTRAINT, \ - IGNORE_WRITEABLE) - -#endif // SHARE_VM_GC_G1_G1_GLOBALS_HPP --- /dev/null 2017-03-08 12:03:25.330745819 +0100 +++ new/src/share/vm/gc/epsilon/epsilon_globals.hpp 2017-03-12 11:11:21.262841229 +0100 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * 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_VM_GC_EPSILON_GLOBALS_HPP +#define SHARE_VM_GC_EPSILON_GLOBALS_HPP + +#include "runtime/globals.hpp" +// +// Defines all globals flags used by the Epsilon GC. +// + +#define EPSILON_FLAGS(develop, \ + develop_pd, \ + product, \ + product_pd, \ + diagnostic, \ + diagnostic_pd, \ + experimental, \ + notproduct, \ + manageable, \ + product_rw, \ + range, \ + constraint, \ + writeable) \ + \ + experimental(size_t, EpsilonTLABSize, 4 * M, \ + "Static TLAB size for Epsilon GC.") \ + range(1, max_intx) + +EPSILON_FLAGS(DECLARE_DEVELOPER_FLAG, \ + DECLARE_PD_DEVELOPER_FLAG, \ + DECLARE_PRODUCT_FLAG, \ + DECLARE_PD_PRODUCT_FLAG, \ + DECLARE_DIAGNOSTIC_FLAG, \ + DECLARE_PD_DIAGNOSTIC_FLAG, \ + DECLARE_EXPERIMENTAL_FLAG, \ + DECLARE_NOTPRODUCT_FLAG, \ + DECLARE_MANAGEABLE_FLAG, \ + DECLARE_PRODUCT_RW_FLAG, \ + IGNORE_RANGE, \ + IGNORE_CONSTRAINT, \ + IGNORE_WRITEABLE) + +#endif // SHARE_VM_GC_EPSILON_GLOBALS_HPP