Skip to content

Commit b1afed7

Browse files
author
Vladimir Ivanov
committed
8257919: [JVMCI] profiling info didn't change after reprofile
Reviewed-by: kvn, redestad
1 parent b7ac32d commit b1afed7

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

src/hotspot/share/ci/ciMethodData.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ciMethodData::ciMethodData(MethodData* md)
4747
_saw_free_extra_data(false),
4848
// Initialize the escape information (to "don't know.");
4949
_eflags(0), _arg_local(0), _arg_stack(0), _arg_returned(0),
50+
_creation_mileage(0),
5051
_current_mileage(0),
5152
_invocation_counter(0),
5253
_backedge_counter(0),
@@ -242,6 +243,7 @@ void ciMethodData::load_data() {
242243
load_remaining_extra_data();
243244

244245
// Note: Extra data are all BitData, and do not need translation.
246+
_creation_mileage = mdo->creation_mileage();
245247
_current_mileage = MethodData::mileage_of(mdo->method());
246248
_invocation_counter = mdo->invocation_count();
247249
_backedge_counter = mdo->backedge_count();

src/hotspot/share/ci/ciMethodData.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,8 @@ class ciMethodData : public ciMetadata {
395395
intx _arg_stack; // bit set of stack-allocatable arguments
396396
intx _arg_returned; // bit set of returned arguments
397397

398+
int _creation_mileage; // method mileage at MDO creation
399+
398400
// Maturity of the oop when the snapshot is taken.
399401
int _current_mileage;
400402

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

478-
int creation_mileage() { return _orig.creation_mileage(); }
480+
int creation_mileage() { return _creation_mileage; }
479481
int current_mileage() { return _current_mileage; }
480482

481483
int invocation_count() { return _invocation_counter; }

src/hotspot/share/oops/methodData.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ void MethodData::post_initialize(BytecodeStream* stream) {
12061206
MethodData::MethodData(const methodHandle& method)
12071207
: _method(method()),
12081208
_extra_data_lock(Mutex::leaf, "MDO extra data lock"),
1209-
_compiler_counters(method()),
1209+
_compiler_counters(),
12101210
_parameters_type_data_di(parameters_uninitialized) {
12111211
initialize();
12121212
}
@@ -1217,6 +1217,7 @@ void MethodData::initialize() {
12171217
ResourceMark rm(thread);
12181218

12191219
init();
1220+
set_creation_mileage(mileage_of(method()));
12201221

12211222
// Go through the bytecodes and allocate and initialize the
12221223
// corresponding data cells.
@@ -1281,6 +1282,7 @@ void MethodData::initialize() {
12811282
}
12821283

12831284
void MethodData::init() {
1285+
_compiler_counters = CompilerCounters(); // reset compiler counters
12841286
_invocation_counter.init();
12851287
_backedge_counter.init();
12861288
_invocation_counter_start = 0;

src/hotspot/share/oops/methodData.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,6 @@ class MethodData : public Metadata {
19741974
friend class VMStructs;
19751975
friend class JVMCIVMStructs;
19761976

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

1986-
CompilerCounters(int current_mileage) : _creation_mileage(current_mileage), _nof_decompiles(0), _nof_overflow_recompiles(0), _nof_overflow_traps(0) {
1985+
public:
1986+
CompilerCounters() : _nof_decompiles(0), _nof_overflow_recompiles(0), _nof_overflow_traps(0) {
19871987
static_assert(sizeof(_trap_hist) % HeapWordSize == 0, "align");
19881988
uint size_in_words = sizeof(_trap_hist) / HeapWordSize;
19891989
Copy::zero_to_words((HeapWord*) &_trap_hist, size_in_words);
19901990
}
1991-
public:
1992-
CompilerCounters(Method* m) : CompilerCounters(MethodData::mileage_of(m)) {}
1993-
CompilerCounters() : CompilerCounters(0) {} // for ciMethodData
1994-
1995-
int creation_mileage() const { return _creation_mileage; }
19961991

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

2042+
int _creation_mileage; // method mileage at MDO creation
2043+
20472044
// How many invocations has this MDO seen?
20482045
// These counters are used to determine the exact age of MDO.
20492046
// We need those because in tiered a method can be concurrently
@@ -2188,7 +2185,8 @@ class MethodData : public Metadata {
21882185
int size_in_bytes() const { return _size; }
21892186
int size() const { return align_metadata_size(align_up(_size, BytesPerWord)/BytesPerWord); }
21902187

2191-
int creation_mileage() const { return _compiler_counters.creation_mileage(); }
2188+
int creation_mileage() const { return _creation_mileage; }
2189+
void set_creation_mileage(int x) { _creation_mileage = x; }
21922190

21932191
int invocation_count() {
21942192
if (invocation_counter()->carry()) {

test/hotspot/jtreg/ProblemList.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ compiler/ciReplay/TestSAServer.java 8029528 generic-all
4444
compiler/codecache/jmx/PoolsIndependenceTest.java 8167015 generic-all
4545
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8225370 generic-all
4646
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
47-
compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java 8257919 generic-all
48-
compiler/jvmci/compilerToVM/ReprofileTest.java 8257919 generic-all
4947
compiler/tiered/LevelTransitionTest.java 8067651 generic-all
5048

5149
compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java 8190680 generic-all

0 commit comments

Comments
 (0)