Skip to content

Commit

Permalink
fix3
Browse files Browse the repository at this point in the history
  • Loading branch information
weixlu committed Jan 9, 2025
1 parent 261b976 commit 54b9b8c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
5 changes: 2 additions & 3 deletions src/hotspot/share/ci/ciCallProfile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/share/opto/doCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 54b9b8c

Please sign in to comment.