From 83b6d2abb5108385691abf8606ee0bea0332e697 Mon Sep 17 00:00:00 2001 From: "maoliang.ml" Date: Fri, 20 Sep 2019 18:17:45 +0800 Subject: [PATCH] [MISC] Fix build issues on Windows/Mac from G1ElasticHeap Summary: Fix build issues on Windows/Mac from G1ElasticHeap Test Plan: test/elastic_heap/ Reviewers: shiyuexw, sanhong Issue: https://github.com/alibaba/dragonwell8/issues/54 CR: --- make/bsd/makefiles/mapfile-vers-debug | 9 +++++++++ make/bsd/makefiles/mapfile-vers-product | 9 +++++++++ make/linux/makefiles/mapfile-vers-product | 18 +++++++++--------- .../vm/gc_implementation/g1/elasticHeap.cpp | 3 +++ .../vm/gc_implementation/g1/elasticHeap.hpp | 4 ++-- src/share/vm/services/attachListener.cpp | 2 +- 6 files changed, 33 insertions(+), 12 deletions(-) diff --git a/make/bsd/makefiles/mapfile-vers-debug b/make/bsd/makefiles/mapfile-vers-debug index d6f7c0907..28532cb8c 100644 --- a/make/bsd/makefiles/mapfile-vers-debug +++ b/make/bsd/makefiles/mapfile-vers-debug @@ -82,6 +82,15 @@ _JVM_DumpAllStacks _JVM_DumpThreads _JVM_EnableCompiler + _JVM_ElasticHeapGetEvaluationMode + _JVM_ElasticHeapSetYoungGenCommitPercent + _JVM_ElasticHeapGetYoungGenCommitPercent + _JVM_ElasticHeapSetUncommitIHOP + _JVM_ElasticHeapGetUncommitIHOP + _JVM_ElasticHeapGetTotalYoungUncommittedBytes + _JVM_ElasticHeapSetSoftmxPercent + _JVM_ElasticHeapGetSoftmxPercent + _JVM_ElasticHeapGetTotalUncommittedBytes _JVM_Exit _JVM_FillInStackTrace _JVM_FindClassFromCaller diff --git a/make/bsd/makefiles/mapfile-vers-product b/make/bsd/makefiles/mapfile-vers-product index 240e9d297..64f05334d 100644 --- a/make/bsd/makefiles/mapfile-vers-product +++ b/make/bsd/makefiles/mapfile-vers-product @@ -82,6 +82,15 @@ _JVM_DumpAllStacks _JVM_DumpThreads _JVM_EnableCompiler + _JVM_ElasticHeapGetEvaluationMode + _JVM_ElasticHeapSetYoungGenCommitPercent + _JVM_ElasticHeapGetYoungGenCommitPercent + _JVM_ElasticHeapSetUncommitIHOP + _JVM_ElasticHeapGetUncommitIHOP + _JVM_ElasticHeapGetTotalYoungUncommittedBytes + _JVM_ElasticHeapSetSoftmxPercent + _JVM_ElasticHeapGetSoftmxPercent + _JVM_ElasticHeapGetTotalUncommittedBytes _JVM_Exit _JVM_FillInStackTrace _JVM_FindClassFromCaller diff --git a/make/linux/makefiles/mapfile-vers-product b/make/linux/makefiles/mapfile-vers-product index 3da9896bc..08ff896ca 100644 --- a/make/linux/makefiles/mapfile-vers-product +++ b/make/linux/makefiles/mapfile-vers-product @@ -69,15 +69,6 @@ SUNWprivate_1.1 { JVM_CurrentClassLoader; JVM_CurrentLoadedClass; JVM_CurrentThread; - JVM_ElasticHeapGetEvaluationMode; - JVM_ElasticHeapSetYoungGenCommitPercent; - JVM_ElasticHeapGetYoungGenCommitPercent; - JVM_ElasticHeapSetUncommitIHOP; - JVM_ElasticHeapGetUncommitIHOP; - JVM_ElasticHeapGetTotalYoungUncommittedBytes; - JVM_ElasticHeapSetSoftmxPercent; - JVM_ElasticHeapGetSoftmxPercent; - JVM_ElasticHeapGetTotalUncommittedBytes; JVM_CurrentTimeMillis; JVM_DefineClass; JVM_DefineClassWithSource; @@ -93,6 +84,15 @@ SUNWprivate_1.1 { JVM_DumpAllStacks; JVM_DumpThreads; JVM_EnableCompiler; + JVM_ElasticHeapGetEvaluationMode; + JVM_ElasticHeapSetYoungGenCommitPercent; + JVM_ElasticHeapGetYoungGenCommitPercent; + JVM_ElasticHeapSetUncommitIHOP; + JVM_ElasticHeapGetUncommitIHOP; + JVM_ElasticHeapGetTotalYoungUncommittedBytes; + JVM_ElasticHeapSetSoftmxPercent; + JVM_ElasticHeapGetSoftmxPercent; + JVM_ElasticHeapGetTotalUncommittedBytes; JVM_Exit; JVM_FillInStackTrace; JVM_FindClassFromCaller; diff --git a/src/share/vm/gc_implementation/g1/elasticHeap.cpp b/src/share/vm/gc_implementation/g1/elasticHeap.cpp index cff689401..940f818fd 100644 --- a/src/share/vm/gc_implementation/g1/elasticHeap.cpp +++ b/src/share/vm/gc_implementation/g1/elasticHeap.cpp @@ -19,6 +19,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "precompiled.hpp" #include "gc_implementation/g1/g1CollectedHeap.hpp" #include "gc_implementation/g1/g1CollectorPolicy.hpp" #include "gc_implementation/g1/elasticHeap.hpp" @@ -41,6 +42,7 @@ public: } else { _elastic_heap->uncommit_region_memory(hr); } + return false; } }; @@ -502,6 +504,7 @@ ElasticHeap::EvaluationMode ElasticHeapSetting::target_evaluation_mode(uint youn return ElasticHeap::SoftmxMode; } else { ShouldNotReachHere(); + return ElasticHeap::InactiveMode; } } diff --git a/src/share/vm/gc_implementation/g1/elasticHeap.hpp b/src/share/vm/gc_implementation/g1/elasticHeap.hpp index 77564c22a..55a3b8437 100644 --- a/src/share/vm/gc_implementation/g1/elasticHeap.hpp +++ b/src/share/vm/gc_implementation/g1/elasticHeap.hpp @@ -144,7 +144,7 @@ public: virtual void evaluate_old() { ShouldNotReachHere(); } virtual void evaluate_old_common(); - virtual bool ready_to_initial_mark() { ShouldNotReachHere(); } + virtual bool ready_to_initial_mark() { ShouldNotReachHere(); return false; } }; class RecoverEvaluator : public ElasticHeapEvaluator { @@ -447,7 +447,7 @@ public: uint young_percent() const { return _young_percent; } - uint set_young_percent(uint p) { + void set_young_percent(uint p) { _young_percent = p; } // Whether a jcmd/mxbean command set the uncommit ihop diff --git a/src/share/vm/services/attachListener.cpp b/src/share/vm/services/attachListener.cpp index 801b1ced5..8037e79bb 100644 --- a/src/share/vm/services/attachListener.cpp +++ b/src/share/vm/services/attachListener.cpp @@ -259,7 +259,7 @@ static jint set_bool_flag(const char* name, AttachOperation* op, outputStream* o } value = (tmp != 0); } - if (strcmp(name, "ElasticHeapPeriodicUncommit") == 0 & value) { + if ((strcmp(name, "ElasticHeapPeriodicUncommit") == 0) && value) { if (G1ElasticHeap && !G1CollectedHeap::heap()->elastic_heap()->can_turn_on_periodic_uncommit()) { out->print_cr("cannot be set because of illegal state."); -- GitLab