提交 d996d848 编写于 作者: I iveresov

8058184: Move _highest_comp_level and _highest_osr_comp_level from MethodData to MethodCounters

Summary: Tiered policy requires highest compilation levels always available
Reviewed-by: kvn, vlivanov
上级 92485f3c
...@@ -1636,34 +1636,34 @@ int Method::backedge_count() { ...@@ -1636,34 +1636,34 @@ int Method::backedge_count() {
} }
int Method::highest_comp_level() const { int Method::highest_comp_level() const {
const MethodData* mdo = method_data(); const MethodCounters* mcs = method_counters();
if (mdo != NULL) { if (mcs != NULL) {
return mdo->highest_comp_level(); return mcs->highest_comp_level();
} else { } else {
return CompLevel_none; return CompLevel_none;
} }
} }
int Method::highest_osr_comp_level() const { int Method::highest_osr_comp_level() const {
const MethodData* mdo = method_data(); const MethodCounters* mcs = method_counters();
if (mdo != NULL) { if (mcs != NULL) {
return mdo->highest_osr_comp_level(); return mcs->highest_osr_comp_level();
} else { } else {
return CompLevel_none; return CompLevel_none;
} }
} }
void Method::set_highest_comp_level(int level) { void Method::set_highest_comp_level(int level) {
MethodData* mdo = method_data(); MethodCounters* mcs = method_counters();
if (mdo != NULL) { if (mcs != NULL) {
mdo->set_highest_comp_level(level); mcs->set_highest_comp_level(level);
} }
} }
void Method::set_highest_osr_comp_level(int level) { void Method::set_highest_osr_comp_level(int level) {
MethodData* mdo = method_data(); MethodCounters* mcs = method_counters();
if (mdo != NULL) { if (mcs != NULL) {
mdo->set_highest_osr_comp_level(level); mcs->set_highest_osr_comp_level(level);
} }
} }
......
...@@ -34,4 +34,40 @@ void MethodCounters::clear_counters() { ...@@ -34,4 +34,40 @@ void MethodCounters::clear_counters() {
backedge_counter()->reset(); backedge_counter()->reset();
set_interpreter_throwout_count(0); set_interpreter_throwout_count(0);
set_interpreter_invocation_count(0); set_interpreter_invocation_count(0);
#ifdef TIERED
set_prev_time(0);
set_rate(0);
set_highest_comp_level(0);
set_highest_osr_comp_level(0);
#endif
} }
int MethodCounters::highest_comp_level() const {
#ifdef TIERED
return _highest_comp_level;
#else
return CompLevel_none;
#endif
}
void MethodCounters::set_highest_comp_level(int level) {
#ifdef TIERED
_highest_comp_level = level;
#endif
}
int MethodCounters::highest_osr_comp_level() const {
#ifdef TIERED
return _highest_osr_comp_level;
#else
return CompLevel_none;
#endif
}
void MethodCounters::set_highest_osr_comp_level(int level) {
#ifdef TIERED
_highest_osr_comp_level = level;
#endif
}
...@@ -39,6 +39,8 @@ class MethodCounters: public MetaspaceObj { ...@@ -39,6 +39,8 @@ class MethodCounters: public MetaspaceObj {
#ifdef TIERED #ifdef TIERED
float _rate; // Events (invocation and backedge counter increments) per millisecond float _rate; // Events (invocation and backedge counter increments) per millisecond
u1 _highest_comp_level; // Highest compile level this method has ever seen.
u1 _highest_osr_comp_level; // Same for OSR level
jlong _prev_time; // Previous time the rate was acquired jlong _prev_time; // Previous time the rate was acquired
#endif #endif
...@@ -47,6 +49,8 @@ class MethodCounters: public MetaspaceObj { ...@@ -47,6 +49,8 @@ class MethodCounters: public MetaspaceObj {
_number_of_breakpoints(0) _number_of_breakpoints(0)
#ifdef TIERED #ifdef TIERED
, _rate(0), , _rate(0),
_highest_comp_level(0),
_highest_osr_comp_level(0),
_prev_time(0) _prev_time(0)
#endif #endif
{ {
...@@ -100,6 +104,11 @@ class MethodCounters: public MetaspaceObj { ...@@ -100,6 +104,11 @@ class MethodCounters: public MetaspaceObj {
void set_rate(float rate) { _rate = rate; } void set_rate(float rate) { _rate = rate; }
#endif #endif
int highest_comp_level() const;
void set_highest_comp_level(int level);
int highest_osr_comp_level() const;
void set_highest_osr_comp_level(int level);
// invocation counter // invocation counter
InvocationCounter* invocation_counter() { return &_invocation_counter; } InvocationCounter* invocation_counter() { return &_invocation_counter; }
InvocationCounter* backedge_counter() { return &_backedge_counter; } InvocationCounter* backedge_counter() { return &_backedge_counter; }
......
...@@ -1153,8 +1153,6 @@ void MethodData::init() { ...@@ -1153,8 +1153,6 @@ void MethodData::init() {
_backedge_counter_start = 0; _backedge_counter_start = 0;
_num_loops = 0; _num_loops = 0;
_num_blocks = 0; _num_blocks = 0;
_highest_comp_level = 0;
_highest_osr_comp_level = 0;
_would_profile = true; _would_profile = true;
#if INCLUDE_RTM_OPT #if INCLUDE_RTM_OPT
......
...@@ -2098,10 +2098,6 @@ private: ...@@ -2098,10 +2098,6 @@ private:
// time with C1. It is used to determine if method is trivial. // time with C1. It is used to determine if method is trivial.
short _num_loops; short _num_loops;
short _num_blocks; short _num_blocks;
// Highest compile level this method has ever seen.
u1 _highest_comp_level;
// Same for OSR level
u1 _highest_osr_comp_level;
// Does this method contain anything worth profiling? // Does this method contain anything worth profiling?
bool _would_profile; bool _would_profile;
...@@ -2275,11 +2271,6 @@ public: ...@@ -2275,11 +2271,6 @@ public:
void set_would_profile(bool p) { _would_profile = p; } void set_would_profile(bool p) { _would_profile = p; }
bool would_profile() const { return _would_profile; } bool would_profile() const { return _would_profile; }
int highest_comp_level() const { return _highest_comp_level; }
void set_highest_comp_level(int level) { _highest_comp_level = level; }
int highest_osr_comp_level() const { return _highest_osr_comp_level; }
void set_highest_osr_comp_level(int level) { _highest_osr_comp_level = level; }
int num_loops() const { return _num_loops; } int num_loops() const { return _num_loops; }
void set_num_loops(int n) { _num_loops = n; } void set_num_loops(int n) { _num_loops = n; }
int num_blocks() const { return _num_blocks; } int num_blocks() const { return _num_blocks; }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册