diff --git a/src/hotspot/share/ci/ciCallProfile.hpp b/src/hotspot/share/ci/ciCallProfile.hpp index 48e1a0a1f9d..0cf673293f8 100644 --- a/src/hotspot/share/ci/ciCallProfile.hpp +++ b/src/hotspot/share/ci/ciCallProfile.hpp @@ -28,19 +28,18 @@ #include "ci/ciClassList.hpp" #include "memory/allocation.hpp" -class CallGenerator; // ciCallProfile // // This class is used to determine the frequently called method // at some call site class ciCallProfile : StackObj { +public: + enum { MAX_MORPHISM_LIMIT = 8 }; // Max call site's morphism we care about private: // Fields are initialized directly by ciMethod::call_profile_at_bci. friend class ciMethod; friend class ciMethodHandle; - friend class Compile; - enum { MAX_MORPHISM_LIMIT = 8 }; // Max call site's morphism we care about int _limit; // number of receivers have been determined int _morphism; // determined call site's morphism int _count; // # times has this call been executed diff --git a/src/hotspot/share/opto/doCall.cpp b/src/hotspot/share/opto/doCall.cpp index 1967a660b6e..60e8a7fe437 100644 --- a/src/hotspot/share/opto/doCall.cpp +++ b/src/hotspot/share/opto/doCall.cpp @@ -33,7 +33,6 @@ #include "opto/callGenerator.hpp" #include "opto/castnode.hpp" #include "opto/cfgnode.hpp" -#include "opto/library_call.hpp" #include "opto/mulnode.hpp" #include "opto/parse.hpp" #include "opto/rootnode.hpp" @@ -255,7 +254,7 @@ CallGenerator* Compile::call_generator(ciMethod* callee, int vtable_index, bool if (next_receiver_method != NULL) { next_hit_cg = this->call_generator(next_receiver_method, vtable_index, !call_does_dispatch, jvms, - allow_inline && morphism == 2, prof_factor); + allow_inline && (morphism == 2), prof_factor); if (next_hit_cg != NULL && !next_hit_cg->is_inline() && have_major_receiver && UseOnlyInlinedBimorphic) { // Skip if we can't inline second receiver's method diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp index 8e6303a4366..ca25359f7bb 100644 --- a/src/hotspot/share/runtime/arguments.cpp +++ b/src/hotspot/share/runtime/arguments.cpp @@ -4188,15 +4188,17 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) { PropertyList_add(&_system_properties, new SystemProperty("java.math.BigDecimal.optimization", "true", true)); } - if (PolymorphicInlining) { - FLAG_SET_ERGO_IF_DEFAULT(intx, TypeProfileWidth, 8); - FLAG_SET_ERGO_IF_DEFAULT(uintx, MorphismLimit, 6); + if (!FLAG_IS_DEFAULT(MorphismLimit)) { + PolymorphicInlining = true; + if (MorphismLimit > 8) { + MorphismLimit = 8; + warning("support MorphismLimit up to 8."); + } } - if (MorphismLimit > 8) { - MorphismLimit = 8; - warning("support MorphismLimit up to 8."); - assert(TypeProfileWidth >= MorphismLimit, "sanity"); + if (PolymorphicInlining && FLAG_IS_DEFAULT(MorphismLimit)) { + FLAG_SET_ERGO(intx, TypeProfileWidth, 8); + FLAG_SET_ERGO(uintx, MorphismLimit, 6); } // Set object alignment values.