Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

Commit

Permalink
8257919: [JVMCI] profiling info didn't change after reprofile
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, redestad
  • Loading branch information
Vladimir Ivanov committed Dec 11, 2020
1 parent b7ac32d commit b1afed7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/ci/ciMethodData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ ciMethodData::ciMethodData(MethodData* md)
_saw_free_extra_data(false),
// Initialize the escape information (to "don't know.");
_eflags(0), _arg_local(0), _arg_stack(0), _arg_returned(0),
_creation_mileage(0),
_current_mileage(0),
_invocation_counter(0),
_backedge_counter(0),
Expand Down Expand Up @@ -242,6 +243,7 @@ void ciMethodData::load_data() {
load_remaining_extra_data();

// Note: Extra data are all BitData, and do not need translation.
_creation_mileage = mdo->creation_mileage();
_current_mileage = MethodData::mileage_of(mdo->method());
_invocation_counter = mdo->invocation_count();
_backedge_counter = mdo->backedge_count();
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/ci/ciMethodData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ class ciMethodData : public ciMetadata {
intx _arg_stack; // bit set of stack-allocatable arguments
intx _arg_returned; // bit set of returned arguments

int _creation_mileage; // method mileage at MDO creation

// Maturity of the oop when the snapshot is taken.
int _current_mileage;

Expand Down Expand Up @@ -475,7 +477,7 @@ class ciMethodData : public ciMetadata {
bool is_empty() { return _state == empty_state; }
bool is_mature() { return _state == mature_state; }

int creation_mileage() { return _orig.creation_mileage(); }
int creation_mileage() { return _creation_mileage; }
int current_mileage() { return _current_mileage; }

int invocation_count() { return _invocation_counter; }
Expand Down
4 changes: 3 additions & 1 deletion src/hotspot/share/oops/methodData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ void MethodData::post_initialize(BytecodeStream* stream) {
MethodData::MethodData(const methodHandle& method)
: _method(method()),
_extra_data_lock(Mutex::leaf, "MDO extra data lock"),
_compiler_counters(method()),
_compiler_counters(),
_parameters_type_data_di(parameters_uninitialized) {
initialize();
}
Expand All @@ -1217,6 +1217,7 @@ void MethodData::initialize() {
ResourceMark rm(thread);

init();
set_creation_mileage(mileage_of(method()));

// Go through the bytecodes and allocate and initialize the
// corresponding data cells.
Expand Down Expand Up @@ -1281,6 +1282,7 @@ void MethodData::initialize() {
}

void MethodData::init() {
_compiler_counters = CompilerCounters(); // reset compiler counters
_invocation_counter.init();
_backedge_counter.init();
_invocation_counter_start = 0;
Expand Down
14 changes: 6 additions & 8 deletions src/hotspot/share/oops/methodData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1974,7 +1974,6 @@ class MethodData : public Metadata {
friend class VMStructs;
friend class JVMCIVMStructs;

int _creation_mileage; // method mileage at MDO creation
uint _nof_decompiles; // count of all nmethod removals
uint _nof_overflow_recompiles; // recompile count, excluding recomp. bits
uint _nof_overflow_traps; // trap count, excluding _trap_hist
Expand All @@ -1983,16 +1982,12 @@ class MethodData : public Metadata {
u1 _array[JVMCI_ONLY(2 *) MethodData::_trap_hist_limit];
} _trap_hist;

CompilerCounters(int current_mileage) : _creation_mileage(current_mileage), _nof_decompiles(0), _nof_overflow_recompiles(0), _nof_overflow_traps(0) {
public:
CompilerCounters() : _nof_decompiles(0), _nof_overflow_recompiles(0), _nof_overflow_traps(0) {
static_assert(sizeof(_trap_hist) % HeapWordSize == 0, "align");
uint size_in_words = sizeof(_trap_hist) / HeapWordSize;
Copy::zero_to_words((HeapWord*) &_trap_hist, size_in_words);
}
public:
CompilerCounters(Method* m) : CompilerCounters(MethodData::mileage_of(m)) {}
CompilerCounters() : CompilerCounters(0) {} // for ciMethodData

int creation_mileage() const { return _creation_mileage; }

// Return (uint)-1 for overflow.
uint trap_count(int reason) const {
Expand Down Expand Up @@ -2044,6 +2039,8 @@ class MethodData : public Metadata {
intx _arg_stack; // bit set of stack-allocatable arguments
intx _arg_returned; // bit set of returned arguments

int _creation_mileage; // method mileage at MDO creation

// How many invocations has this MDO seen?
// These counters are used to determine the exact age of MDO.
// We need those because in tiered a method can be concurrently
Expand Down Expand Up @@ -2188,7 +2185,8 @@ class MethodData : public Metadata {
int size_in_bytes() const { return _size; }
int size() const { return align_metadata_size(align_up(_size, BytesPerWord)/BytesPerWord); }

int creation_mileage() const { return _compiler_counters.creation_mileage(); }
int creation_mileage() const { return _creation_mileage; }
void set_creation_mileage(int x) { _creation_mileage = x; }

int invocation_count() {
if (invocation_counter()->carry()) {
Expand Down
2 changes: 0 additions & 2 deletions test/hotspot/jtreg/ProblemList.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ compiler/ciReplay/TestSAServer.java 8029528 generic-all
compiler/codecache/jmx/PoolsIndependenceTest.java 8167015 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java 8257919 generic-all
compiler/jvmci/compilerToVM/ReprofileTest.java 8257919 generic-all
compiler/tiered/LevelTransitionTest.java 8067651 generic-all

compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all
Expand Down

1 comment on commit b1afed7

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.