mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-20 12:53:29 +00:00
8292692: Move MethodCounters inline functions out of method.hpp
Reviewed-by: iklam, ccheung, kvn
This commit is contained in:
parent
9bf3dee242
commit
683672c0bb
@ -37,8 +37,9 @@
|
||||
#include "interpreter/bytecodeTracer.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedFieldEntry.hpp"
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
#define CPU_ARM_INTERP_MASM_ARM_HPP
|
||||
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "interpreter/invocationCounter.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/frame.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/cpCache.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "gc/shared/barrierSetAssembler.hpp"
|
||||
#include "interp_masm_ppc.hpp"
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/resolvedFieldEntry.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
|
||||
@ -35,8 +35,9 @@
|
||||
#include "interpreter/templateInterpreterGenerator.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include "interpreter/interpreterRuntime.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/markWord.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include "interpreter/templateInterpreterGenerator.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/resolvedIndyEntry.hpp"
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -26,7 +26,6 @@
|
||||
#define CPU_X86_INTERP_MASM_X86_HPP
|
||||
|
||||
#include "asm/macroAssembler.hpp"
|
||||
#include "interpreter/invocationCounter.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "runtime/frame.hpp"
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include "interpreter/templateInterpreterGenerator.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "oops/arrayOop.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#include "interpreter/interp_masm.hpp"
|
||||
#include "interpreter/templateTable.hpp"
|
||||
#include "memory/universe.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -38,6 +38,7 @@
|
||||
#include "gc/shared/barrierSet.hpp"
|
||||
#include "gc/shared/c1/barrierSetC1.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "runtime/sharedRuntime.hpp"
|
||||
#include "runtime/stubRoutines.hpp"
|
||||
#include "runtime/vm_version.hpp"
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/klass.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "runtime/flags/flagSetting.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
#include "precompiled.hpp"
|
||||
#include "code/codeCache.hpp"
|
||||
#include "compiler/compilerDefinitions.inline.hpp"
|
||||
#include "interpreter/invocationCounter.hpp"
|
||||
#include "jvm_io.h"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/continuation.hpp"
|
||||
|
||||
@ -48,6 +48,7 @@
|
||||
#include "oops/instanceKlass.inline.hpp"
|
||||
#include "oops/klass.inline.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "oops/objArrayOop.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
#include "jvmci/jvmciRuntime.hpp"
|
||||
#include "jvmci/vmStructs_jvmci.hpp"
|
||||
#include "oops/klassVtable.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/objArrayKlass.hpp"
|
||||
#include "prims/jvmtiThreadState.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
|
||||
@ -27,10 +27,8 @@
|
||||
|
||||
#include "code/compressedStream.hpp"
|
||||
#include "compiler/compilerDefinitions.hpp"
|
||||
#include "interpreter/invocationCounter.hpp"
|
||||
#include "oops/annotations.hpp"
|
||||
#include "oops/constantPool.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "oops/methodFlags.hpp"
|
||||
#include "oops/instanceKlass.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
@ -216,33 +214,11 @@ class Method : public Metadata {
|
||||
void clear_all_breakpoints();
|
||||
// Tracking number of breakpoints, for fullspeed debugging.
|
||||
// Only mutated by VM thread.
|
||||
u2 number_of_breakpoints() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs == nullptr) {
|
||||
return 0;
|
||||
} else {
|
||||
return mcs->number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
void incr_number_of_breakpoints(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->incr_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
void decr_number_of_breakpoints(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->decr_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
inline u2 number_of_breakpoints() const;
|
||||
inline void incr_number_of_breakpoints(Thread* current);
|
||||
inline void decr_number_of_breakpoints(Thread* current);
|
||||
// Initialization only
|
||||
void clear_number_of_breakpoints() {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->clear_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
inline void clear_number_of_breakpoints();
|
||||
#endif // !INCLUDE_JVMTI
|
||||
|
||||
// index into InstanceKlass methods() array
|
||||
@ -280,22 +256,10 @@ class Method : public Metadata {
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
// Count of times method was exited via exception while interpreting
|
||||
void interpreter_throwout_increment(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->interpreter_throwout_increment();
|
||||
}
|
||||
}
|
||||
inline void interpreter_throwout_increment(Thread* current);
|
||||
#endif
|
||||
|
||||
int interpreter_throwout_count() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs == nullptr) {
|
||||
return 0;
|
||||
} else {
|
||||
return mcs->interpreter_throwout_count();
|
||||
}
|
||||
}
|
||||
inline int interpreter_throwout_count() const;
|
||||
|
||||
u2 size_of_parameters() const { return constMethod()->size_of_parameters(); }
|
||||
|
||||
@ -356,36 +320,12 @@ class Method : public Metadata {
|
||||
|
||||
bool init_method_counters(MethodCounters* counters);
|
||||
|
||||
int prev_event_count() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->prev_event_count();
|
||||
}
|
||||
void set_prev_event_count(int count) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_prev_event_count(count);
|
||||
}
|
||||
}
|
||||
jlong prev_time() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->prev_time();
|
||||
}
|
||||
void set_prev_time(jlong time) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_prev_time(time);
|
||||
}
|
||||
}
|
||||
float rate() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->rate();
|
||||
}
|
||||
void set_rate(float rate) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_rate(rate);
|
||||
}
|
||||
}
|
||||
inline int prev_event_count() const;
|
||||
inline void set_prev_event_count(int count);
|
||||
inline jlong prev_time() const;
|
||||
inline void set_prev_time(jlong time);
|
||||
inline float rate() const;
|
||||
inline void set_rate(float rate);
|
||||
|
||||
int invocation_count() const;
|
||||
int backedge_count() const;
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "oops/method.hpp"
|
||||
|
||||
#include "classfile/vmIntrinsics.hpp"
|
||||
#include "oops/methodCounters.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
|
||||
inline address Method::from_compiled_entry() const {
|
||||
@ -107,4 +108,91 @@ inline bool Method::is_special_native_intrinsic() const {
|
||||
return is_method_handle_intrinsic() || is_continuation_native_intrinsic();
|
||||
}
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
inline u2 Method::number_of_breakpoints() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs == nullptr) {
|
||||
return 0;
|
||||
} else {
|
||||
return mcs->number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
|
||||
inline void Method::incr_number_of_breakpoints(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->incr_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
|
||||
inline void Method::decr_number_of_breakpoints(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->decr_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
|
||||
// Initialization only
|
||||
inline void Method::clear_number_of_breakpoints() {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->clear_number_of_breakpoints();
|
||||
}
|
||||
}
|
||||
#endif // INCLUDE_JVMTI
|
||||
|
||||
#if COMPILER2_OR_JVMCI
|
||||
inline void Method::interpreter_throwout_increment(Thread* current) {
|
||||
MethodCounters* mcs = get_method_counters(current);
|
||||
if (mcs != nullptr) {
|
||||
mcs->interpreter_throwout_increment();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
inline int Method::interpreter_throwout_count() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs == nullptr) {
|
||||
return 0;
|
||||
} else {
|
||||
return mcs->interpreter_throwout_count();
|
||||
}
|
||||
}
|
||||
|
||||
inline int Method::prev_event_count() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->prev_event_count();
|
||||
}
|
||||
|
||||
inline void Method::set_prev_event_count(int count) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_prev_event_count(count);
|
||||
}
|
||||
}
|
||||
|
||||
inline jlong Method::prev_time() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->prev_time();
|
||||
}
|
||||
|
||||
inline void Method::set_prev_time(jlong time) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_prev_time(time);
|
||||
}
|
||||
}
|
||||
|
||||
inline float Method::rate() const {
|
||||
MethodCounters* mcs = method_counters();
|
||||
return mcs == nullptr ? 0 : mcs->rate();
|
||||
}
|
||||
|
||||
inline void Method::set_rate(float rate) {
|
||||
MethodCounters* mcs = method_counters();
|
||||
if (mcs != nullptr) {
|
||||
mcs->set_rate(rate);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // SHARE_OOPS_METHOD_INLINE_HPP
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
#define SHARE_OOPS_METHODDATA_HPP
|
||||
|
||||
#include "interpreter/bytecodes.hpp"
|
||||
#include "interpreter/invocationCounter.hpp"
|
||||
#include "oops/metadata.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
#include "memory/allocation.inline.hpp"
|
||||
#include "memory/resourceArea.hpp"
|
||||
#include "oops/methodData.hpp"
|
||||
#include "oops/method.hpp"
|
||||
#include "oops/method.inline.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "runtime/deoptimization.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user