Skip to content

Commit 683672c

Browse files
author
Matias Saavedra Silva
committed
8292692: Move MethodCounters inline functions out of method.hpp
Reviewed-by: iklam, ccheung, kvn
1 parent 9bf3dee commit 683672c

25 files changed

+123
-81
lines changed

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@
3737
#include "interpreter/bytecodeTracer.hpp"
3838
#include "memory/resourceArea.hpp"
3939
#include "oops/arrayOop.hpp"
40-
#include "oops/methodData.hpp"
4140
#include "oops/method.hpp"
41+
#include "oops/methodCounters.hpp"
42+
#include "oops/methodData.hpp"
4243
#include "oops/oop.inline.hpp"
4344
#include "oops/resolvedIndyEntry.hpp"
4445
#include "prims/jvmtiExport.hpp"

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#include "interpreter/templateTable.hpp"
3636
#include "memory/universe.hpp"
3737
#include "oops/methodData.hpp"
38-
#include "oops/method.hpp"
38+
#include "oops/method.inline.hpp"
3939
#include "oops/objArrayKlass.hpp"
4040
#include "oops/oop.inline.hpp"
4141
#include "oops/resolvedFieldEntry.hpp"

src/hotspot/cpu/arm/interp_masm_arm.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#define CPU_ARM_INTERP_MASM_ARM_HPP
2727

2828
#include "asm/macroAssembler.hpp"
29-
#include "interpreter/invocationCounter.hpp"
3029
#include "oops/method.hpp"
3130
#include "runtime/frame.hpp"
3231
#include "prims/jvmtiExport.hpp"

src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "interpreter/templateTable.hpp"
3535
#include "oops/arrayOop.hpp"
3636
#include "oops/methodData.hpp"
37-
#include "oops/method.hpp"
37+
#include "oops/method.inline.hpp"
3838
#include "oops/oop.inline.hpp"
3939
#include "oops/resolvedIndyEntry.hpp"
4040
#include "prims/jvmtiExport.hpp"

src/hotspot/cpu/arm/templateTable_arm.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "memory/universe.hpp"
3535
#include "oops/cpCache.hpp"
3636
#include "oops/klass.inline.hpp"
37+
#include "oops/methodCounters.hpp"
3738
#include "oops/methodData.hpp"
3839
#include "oops/objArrayKlass.hpp"
3940
#include "oops/oop.inline.hpp"

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include "gc/shared/barrierSetAssembler.hpp"
3131
#include "interp_masm_ppc.hpp"
3232
#include "interpreter/interpreterRuntime.hpp"
33+
#include "oops/methodCounters.hpp"
3334
#include "oops/methodData.hpp"
3435
#include "oops/resolvedFieldEntry.hpp"
3536
#include "oops/resolvedIndyEntry.hpp"

src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535
#include "interpreter/templateInterpreterGenerator.hpp"
3636
#include "interpreter/templateTable.hpp"
3737
#include "oops/arrayOop.hpp"
38-
#include "oops/methodData.hpp"
3938
#include "oops/method.hpp"
39+
#include "oops/methodCounters.hpp"
40+
#include "oops/methodData.hpp"
4041
#include "oops/oop.inline.hpp"
4142
#include "oops/resolvedIndyEntry.hpp"
4243
#include "prims/jvmtiExport.hpp"

src/hotspot/cpu/ppc/templateTable_ppc_64.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "interpreter/templateTable.hpp"
3636
#include "memory/universe.hpp"
3737
#include "oops/klass.inline.hpp"
38+
#include "oops/methodCounters.hpp"
3839
#include "oops/methodData.hpp"
3940
#include "oops/objArrayKlass.hpp"
4041
#include "oops/oop.inline.hpp"

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "interpreter/templateTable.hpp"
3838
#include "memory/resourceArea.hpp"
3939
#include "oops/arrayOop.hpp"
40-
#include "oops/method.hpp"
40+
#include "oops/method.inline.hpp"
4141
#include "oops/methodData.hpp"
4242
#include "oops/oop.inline.hpp"
4343
#include "oops/resolvedIndyEntry.hpp"

src/hotspot/cpu/riscv/templateTable_riscv.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "interpreter/interpreterRuntime.hpp"
3535
#include "interpreter/templateTable.hpp"
3636
#include "memory/universe.hpp"
37-
#include "oops/method.hpp"
37+
#include "oops/method.inline.hpp"
3838
#include "oops/methodData.hpp"
3939
#include "oops/objArrayKlass.hpp"
4040
#include "oops/oop.inline.hpp"

src/hotspot/cpu/s390/interp_masm_s390.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "interpreter/interpreterRuntime.hpp"
3535
#include "oops/arrayOop.hpp"
3636
#include "oops/markWord.hpp"
37+
#include "oops/methodCounters.hpp"
3738
#include "oops/methodData.hpp"
3839
#include "oops/resolvedIndyEntry.hpp"
3940
#include "prims/jvmtiExport.hpp"

src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "interpreter/templateInterpreterGenerator.hpp"
3737
#include "interpreter/templateTable.hpp"
3838
#include "oops/arrayOop.hpp"
39+
#include "oops/methodCounters.hpp"
3940
#include "oops/methodData.hpp"
4041
#include "oops/oop.inline.hpp"
4142
#include "oops/resolvedIndyEntry.hpp"

src/hotspot/cpu/s390/templateTable_s390.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "interpreter/templateTable.hpp"
3535
#include "memory/universe.hpp"
3636
#include "oops/klass.inline.hpp"
37+
#include "oops/methodCounters.hpp"
3738
#include "oops/methodData.hpp"
3839
#include "oops/objArrayKlass.hpp"
3940
#include "oops/oop.inline.hpp"

src/hotspot/cpu/x86/interp_masm_x86.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#define CPU_X86_INTERP_MASM_X86_HPP
2727

2828
#include "asm/macroAssembler.hpp"
29-
#include "interpreter/invocationCounter.hpp"
3029
#include "oops/method.hpp"
3130
#include "runtime/frame.hpp"
3231

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "interpreter/templateInterpreterGenerator.hpp"
3636
#include "interpreter/templateTable.hpp"
3737
#include "oops/arrayOop.hpp"
38+
#include "oops/methodCounters.hpp"
3839
#include "oops/methodData.hpp"
3940
#include "oops/method.hpp"
4041
#include "oops/oop.inline.hpp"

src/hotspot/cpu/x86/templateTable_x86.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "interpreter/interp_masm.hpp"
3434
#include "interpreter/templateTable.hpp"
3535
#include "memory/universe.hpp"
36+
#include "oops/methodCounters.hpp"
3637
#include "oops/methodData.hpp"
3738
#include "oops/objArrayKlass.hpp"
3839
#include "oops/oop.inline.hpp"

src/hotspot/share/c1/c1_LIRGenerator.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "gc/shared/barrierSet.hpp"
3939
#include "gc/shared/c1/barrierSetC1.hpp"
4040
#include "oops/klass.inline.hpp"
41+
#include "oops/methodCounters.hpp"
4142
#include "runtime/sharedRuntime.hpp"
4243
#include "runtime/stubRoutines.hpp"
4344
#include "runtime/vm_version.hpp"

src/hotspot/share/code/dependencies.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "memory/resourceArea.hpp"
3737
#include "oops/klass.hpp"
3838
#include "oops/oop.inline.hpp"
39+
#include "oops/method.inline.hpp"
3940
#include "oops/objArrayKlass.hpp"
4041
#include "runtime/flags/flagSetting.hpp"
4142
#include "runtime/handles.hpp"

src/hotspot/share/compiler/compilerDefinitions.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "precompiled.hpp"
2626
#include "code/codeCache.hpp"
2727
#include "compiler/compilerDefinitions.inline.hpp"
28+
#include "interpreter/invocationCounter.hpp"
2829
#include "jvm_io.h"
2930
#include "runtime/arguments.hpp"
3031
#include "runtime/continuation.hpp"

src/hotspot/share/interpreter/interpreterRuntime.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
#include "oops/instanceKlass.inline.hpp"
4949
#include "oops/klass.inline.hpp"
5050
#include "oops/methodData.hpp"
51+
#include "oops/method.inline.hpp"
5152
#include "oops/objArrayKlass.hpp"
5253
#include "oops/objArrayOop.inline.hpp"
5354
#include "oops/oop.inline.hpp"

src/hotspot/share/jvmci/vmStructs_jvmci.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "jvmci/jvmciRuntime.hpp"
3232
#include "jvmci/vmStructs_jvmci.hpp"
3333
#include "oops/klassVtable.hpp"
34+
#include "oops/methodCounters.hpp"
3435
#include "oops/objArrayKlass.hpp"
3536
#include "prims/jvmtiThreadState.hpp"
3637
#include "runtime/deoptimization.hpp"

src/hotspot/share/oops/method.hpp

+12-72
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,8 @@
2727

2828
#include "code/compressedStream.hpp"
2929
#include "compiler/compilerDefinitions.hpp"
30-
#include "interpreter/invocationCounter.hpp"
3130
#include "oops/annotations.hpp"
3231
#include "oops/constantPool.hpp"
33-
#include "oops/methodCounters.hpp"
3432
#include "oops/methodFlags.hpp"
3533
#include "oops/instanceKlass.hpp"
3634
#include "oops/oop.hpp"
@@ -216,33 +214,11 @@ class Method : public Metadata {
216214
void clear_all_breakpoints();
217215
// Tracking number of breakpoints, for fullspeed debugging.
218216
// Only mutated by VM thread.
219-
u2 number_of_breakpoints() const {
220-
MethodCounters* mcs = method_counters();
221-
if (mcs == nullptr) {
222-
return 0;
223-
} else {
224-
return mcs->number_of_breakpoints();
225-
}
226-
}
227-
void incr_number_of_breakpoints(Thread* current) {
228-
MethodCounters* mcs = get_method_counters(current);
229-
if (mcs != nullptr) {
230-
mcs->incr_number_of_breakpoints();
231-
}
232-
}
233-
void decr_number_of_breakpoints(Thread* current) {
234-
MethodCounters* mcs = get_method_counters(current);
235-
if (mcs != nullptr) {
236-
mcs->decr_number_of_breakpoints();
237-
}
238-
}
217+
inline u2 number_of_breakpoints() const;
218+
inline void incr_number_of_breakpoints(Thread* current);
219+
inline void decr_number_of_breakpoints(Thread* current);
239220
// Initialization only
240-
void clear_number_of_breakpoints() {
241-
MethodCounters* mcs = method_counters();
242-
if (mcs != nullptr) {
243-
mcs->clear_number_of_breakpoints();
244-
}
245-
}
221+
inline void clear_number_of_breakpoints();
246222
#endif // !INCLUDE_JVMTI
247223

248224
// index into InstanceKlass methods() array
@@ -280,22 +256,10 @@ class Method : public Metadata {
280256

281257
#if COMPILER2_OR_JVMCI
282258
// Count of times method was exited via exception while interpreting
283-
void interpreter_throwout_increment(Thread* current) {
284-
MethodCounters* mcs = get_method_counters(current);
285-
if (mcs != nullptr) {
286-
mcs->interpreter_throwout_increment();
287-
}
288-
}
259+
inline void interpreter_throwout_increment(Thread* current);
289260
#endif
290261

291-
int interpreter_throwout_count() const {
292-
MethodCounters* mcs = method_counters();
293-
if (mcs == nullptr) {
294-
return 0;
295-
} else {
296-
return mcs->interpreter_throwout_count();
297-
}
298-
}
262+
inline int interpreter_throwout_count() const;
299263

300264
u2 size_of_parameters() const { return constMethod()->size_of_parameters(); }
301265

@@ -356,36 +320,12 @@ class Method : public Metadata {
356320

357321
bool init_method_counters(MethodCounters* counters);
358322

359-
int prev_event_count() const {
360-
MethodCounters* mcs = method_counters();
361-
return mcs == nullptr ? 0 : mcs->prev_event_count();
362-
}
363-
void set_prev_event_count(int count) {
364-
MethodCounters* mcs = method_counters();
365-
if (mcs != nullptr) {
366-
mcs->set_prev_event_count(count);
367-
}
368-
}
369-
jlong prev_time() const {
370-
MethodCounters* mcs = method_counters();
371-
return mcs == nullptr ? 0 : mcs->prev_time();
372-
}
373-
void set_prev_time(jlong time) {
374-
MethodCounters* mcs = method_counters();
375-
if (mcs != nullptr) {
376-
mcs->set_prev_time(time);
377-
}
378-
}
379-
float rate() const {
380-
MethodCounters* mcs = method_counters();
381-
return mcs == nullptr ? 0 : mcs->rate();
382-
}
383-
void set_rate(float rate) {
384-
MethodCounters* mcs = method_counters();
385-
if (mcs != nullptr) {
386-
mcs->set_rate(rate);
387-
}
388-
}
323+
inline int prev_event_count() const;
324+
inline void set_prev_event_count(int count);
325+
inline jlong prev_time() const;
326+
inline void set_prev_time(jlong time);
327+
inline float rate() const;
328+
inline void set_rate(float rate);
389329

390330
int invocation_count() const;
391331
int backedge_count() const;

src/hotspot/share/oops/method.inline.hpp

+88
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "oops/method.hpp"
2929

3030
#include "classfile/vmIntrinsics.hpp"
31+
#include "oops/methodCounters.hpp"
3132
#include "runtime/atomic.hpp"
3233

3334
inline address Method::from_compiled_entry() const {
@@ -107,4 +108,91 @@ inline bool Method::is_special_native_intrinsic() const {
107108
return is_method_handle_intrinsic() || is_continuation_native_intrinsic();
108109
}
109110

111+
#if INCLUDE_JVMTI
112+
inline u2 Method::number_of_breakpoints() const {
113+
MethodCounters* mcs = method_counters();
114+
if (mcs == nullptr) {
115+
return 0;
116+
} else {
117+
return mcs->number_of_breakpoints();
118+
}
119+
}
120+
121+
inline void Method::incr_number_of_breakpoints(Thread* current) {
122+
MethodCounters* mcs = get_method_counters(current);
123+
if (mcs != nullptr) {
124+
mcs->incr_number_of_breakpoints();
125+
}
126+
}
127+
128+
inline void Method::decr_number_of_breakpoints(Thread* current) {
129+
MethodCounters* mcs = get_method_counters(current);
130+
if (mcs != nullptr) {
131+
mcs->decr_number_of_breakpoints();
132+
}
133+
}
134+
135+
// Initialization only
136+
inline void Method::clear_number_of_breakpoints() {
137+
MethodCounters* mcs = method_counters();
138+
if (mcs != nullptr) {
139+
mcs->clear_number_of_breakpoints();
140+
}
141+
}
142+
#endif // INCLUDE_JVMTI
143+
144+
#if COMPILER2_OR_JVMCI
145+
inline void Method::interpreter_throwout_increment(Thread* current) {
146+
MethodCounters* mcs = get_method_counters(current);
147+
if (mcs != nullptr) {
148+
mcs->interpreter_throwout_increment();
149+
}
150+
}
151+
#endif
152+
153+
inline int Method::interpreter_throwout_count() const {
154+
MethodCounters* mcs = method_counters();
155+
if (mcs == nullptr) {
156+
return 0;
157+
} else {
158+
return mcs->interpreter_throwout_count();
159+
}
160+
}
161+
162+
inline int Method::prev_event_count() const {
163+
MethodCounters* mcs = method_counters();
164+
return mcs == nullptr ? 0 : mcs->prev_event_count();
165+
}
166+
167+
inline void Method::set_prev_event_count(int count) {
168+
MethodCounters* mcs = method_counters();
169+
if (mcs != nullptr) {
170+
mcs->set_prev_event_count(count);
171+
}
172+
}
173+
174+
inline jlong Method::prev_time() const {
175+
MethodCounters* mcs = method_counters();
176+
return mcs == nullptr ? 0 : mcs->prev_time();
177+
}
178+
179+
inline void Method::set_prev_time(jlong time) {
180+
MethodCounters* mcs = method_counters();
181+
if (mcs != nullptr) {
182+
mcs->set_prev_time(time);
183+
}
184+
}
185+
186+
inline float Method::rate() const {
187+
MethodCounters* mcs = method_counters();
188+
return mcs == nullptr ? 0 : mcs->rate();
189+
}
190+
191+
inline void Method::set_rate(float rate) {
192+
MethodCounters* mcs = method_counters();
193+
if (mcs != nullptr) {
194+
mcs->set_rate(rate);
195+
}
196+
}
197+
110198
#endif // SHARE_OOPS_METHOD_INLINE_HPP

0 commit comments

Comments
 (0)