Skip to content

Commit e353b57

Browse files
committed
8292890: Remove PrintTouchedMethodsAtExit and LogTouchedMethods
Reviewed-by: iklam, hseigel
1 parent 95a33fe commit e353b57

19 files changed

+14
-364
lines changed

src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
11121112
// native method than the typical interpreter frame setup.
11131113
address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
11141114
// determine code generation flags
1115-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1115+
bool inc_counter = UseCompiler || CountCompiledCalls;
11161116

11171117
// r1: Method*
11181118
// rscratch1: sender sp
@@ -1536,7 +1536,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
15361536
//
15371537
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
15381538
// determine code generation flags
1539-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1539+
bool inc_counter = UseCompiler || CountCompiledCalls;
15401540

15411541
// rscratch1: sender sp
15421542
address entry_point = __ pc();

src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ address TemplateInterpreterGenerator::generate_CRC32C_updateBytes_entry(Abstract
796796

797797
address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
798798
// determine code generation flags
799-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
799+
bool inc_counter = UseCompiler || CountCompiledCalls;
800800

801801
// Incoming registers:
802802
//
@@ -1128,7 +1128,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
11281128
//
11291129
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
11301130
// determine code generation flags
1131-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1131+
bool inc_counter = UseCompiler || CountCompiledCalls;
11321132

11331133
// Rmethod: Method*
11341134
// Rthread: thread

src/hotspot/cpu/ppc/interp_masm_ppc_64.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2210,7 +2210,7 @@ void InterpreterMacroAssembler::get_method_counters(Register method,
22102210
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters,
22112211
Register iv_be_count,
22122212
Register Rtmp_r0) {
2213-
assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
2213+
assert(UseCompiler, "incrementing must be useful");
22142214
Register invocation_count = iv_be_count;
22152215
Register backedge_count = Rtmp_r0;
22162216
int delta = InvocationCounter::count_increment;

src/hotspot/cpu/ppc/templateInterpreterGenerator_ppc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
11901190

11911191
address entry = __ pc();
11921192

1193-
const bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1193+
const bool inc_counter = UseCompiler || CountCompiledCalls;
11941194

11951195
// -----------------------------------------------------------------------------
11961196
// Allocate a new frame that represents the native callee (i2n frame).
@@ -1614,7 +1614,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
16141614
// Generic interpreted method entry to (asm) interpreter.
16151615
//
16161616
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
1617-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1617+
bool inc_counter = UseCompiler || CountCompiledCalls;
16181618
address entry = __ pc();
16191619
// Generate the code to allocate the interpreter stack frame.
16201620
Register Rsize_of_parameters = R4_ARG2, // Written by generate_fixed_frame.

src/hotspot/cpu/riscv/templateInterpreterGenerator_riscv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
932932
// native method than the typical interpreter frame setup.
933933
address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
934934
// determine code generation flags
935-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
935+
bool inc_counter = UseCompiler || CountCompiledCalls;
936936

937937
// x11: Method*
938938
// x30: sender sp
@@ -1326,7 +1326,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
13261326
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
13271327

13281328
// determine code generation flags
1329-
const bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1329+
const bool inc_counter = UseCompiler || CountCompiledCalls;
13301330

13311331
// t0: sender sp
13321332
address entry_point = __ pc();

src/hotspot/cpu/s390/interp_masm_s390.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1920,7 +1920,7 @@ void InterpreterMacroAssembler::get_method_counters(Register Rmethod,
19201920
// Return (invocation_counter+backedge_counter) as "result" in RctrSum.
19211921
// Counter values are all unsigned.
19221922
void InterpreterMacroAssembler::increment_invocation_counter(Register Rcounters, Register RctrSum) {
1923-
assert(UseCompiler || LogTouchedMethods, "incrementing must be useful");
1923+
assert(UseCompiler, "incrementing must be useful");
19241924
assert_different_registers(Rcounters, RctrSum);
19251925

19261926
int increment = InvocationCounter::count_increment;

src/hotspot/cpu/s390/templateInterpreterGenerator_s390.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@ address TemplateInterpreterGenerator::generate_math_entry(AbstractInterpreter::M
13011301
// native method than the typical interpreter frame setup.
13021302
address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
13031303
// Determine code generation flags.
1304-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1304+
bool inc_counter = UseCompiler || CountCompiledCalls;
13051305

13061306
// Interpreter entry for ordinary Java methods.
13071307
//
@@ -1658,7 +1658,7 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
16581658
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
16591659
address entry_point = __ pc();
16601660

1661-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1661+
bool inc_counter = UseCompiler || CountCompiledCalls;
16621662

16631663
// Interpreter entry for ordinary Java methods.
16641664
//

src/hotspot/cpu/x86/templateInterpreterGenerator_x86.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ void TemplateInterpreterGenerator::bang_stack_shadow_pages(bool native_call) {
790790
// native method than the typical interpreter frame setup.
791791
address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) {
792792
// determine code generation flags
793-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
793+
bool inc_counter = UseCompiler || CountCompiledCalls;
794794

795795
// rbx: Method*
796796
// rbcp: sender sp
@@ -1327,7 +1327,7 @@ address TemplateInterpreterGenerator::generate_abstract_entry(void) {
13271327
//
13281328
address TemplateInterpreterGenerator::generate_normal_entry(bool synchronized) {
13291329
// determine code generation flags
1330-
bool inc_counter = UseCompiler || CountCompiledCalls || LogTouchedMethods;
1330+
bool inc_counter = UseCompiler || CountCompiledCalls;
13311331

13321332
// ebx: Method*
13331333
// rbcp: sender sp (set in InterpreterMacroAssembler::prepare_to_jump_from_interpreted / generate_call_stub)

src/hotspot/share/ci/ciMethod.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
7373
assert(h_m() != NULL, "no null method");
7474
assert(_holder->get_instanceKlass() == h_m->method_holder(), "");
7575

76-
if (LogTouchedMethods) {
77-
h_m->log_touched(Thread::current());
78-
}
7976
// These fields are always filled in in loaded methods.
8077
_flags = ciFlags(h_m->access_flags());
8178

src/hotspot/share/oops/method.cpp

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -639,10 +639,6 @@ MethodCounters* Method::build_method_counters(Thread* current, Method* m) {
639639
MetadataFactory::free_metadata(mh->method_holder()->class_loader_data(), counters);
640640
}
641641

642-
if (LogTouchedMethods) {
643-
mh->log_touched(current);
644-
}
645-
646642
return mh->method_counters();
647643
}
648644

@@ -2445,85 +2441,6 @@ void Method::print_value_on(outputStream* st) const {
24452441
if (WizardMode && code() != NULL) st->print(" ((nmethod*)%p)", code());
24462442
}
24472443

2448-
// LogTouchedMethods and PrintTouchedMethods
2449-
2450-
// TouchedMethodRecord -- we can't use a HashtableEntry<Method*> because
2451-
// the Method may be garbage collected. Let's roll our own hash table.
2452-
class TouchedMethodRecord : CHeapObj<mtTracing> {
2453-
public:
2454-
// It's OK to store Symbols here because they will NOT be GC'ed if
2455-
// LogTouchedMethods is enabled.
2456-
TouchedMethodRecord* _next;
2457-
Symbol* _class_name;
2458-
Symbol* _method_name;
2459-
Symbol* _method_signature;
2460-
};
2461-
2462-
static const int TOUCHED_METHOD_TABLE_SIZE = 20011;
2463-
static TouchedMethodRecord** _touched_method_table = NULL;
2464-
2465-
void Method::log_touched(Thread* current) {
2466-
2467-
const int table_size = TOUCHED_METHOD_TABLE_SIZE;
2468-
Symbol* my_class = klass_name();
2469-
Symbol* my_name = name();
2470-
Symbol* my_sig = signature();
2471-
2472-
unsigned int hash = my_class->identity_hash() +
2473-
my_name->identity_hash() +
2474-
my_sig->identity_hash();
2475-
juint index = juint(hash) % table_size;
2476-
2477-
MutexLocker ml(current, TouchedMethodLog_lock);
2478-
if (_touched_method_table == NULL) {
2479-
_touched_method_table = NEW_C_HEAP_ARRAY2(TouchedMethodRecord*, table_size,
2480-
mtTracing, CURRENT_PC);
2481-
memset(_touched_method_table, 0, sizeof(TouchedMethodRecord*)*table_size);
2482-
}
2483-
2484-
TouchedMethodRecord* ptr = _touched_method_table[index];
2485-
while (ptr) {
2486-
if (ptr->_class_name == my_class &&
2487-
ptr->_method_name == my_name &&
2488-
ptr->_method_signature == my_sig) {
2489-
return;
2490-
}
2491-
if (ptr->_next == NULL) break;
2492-
ptr = ptr->_next;
2493-
}
2494-
TouchedMethodRecord* nptr = NEW_C_HEAP_OBJ(TouchedMethodRecord, mtTracing);
2495-
my_class->increment_refcount();
2496-
my_name->increment_refcount();
2497-
my_sig->increment_refcount();
2498-
nptr->_class_name = my_class;
2499-
nptr->_method_name = my_name;
2500-
nptr->_method_signature = my_sig;
2501-
nptr->_next = NULL;
2502-
2503-
if (ptr == NULL) {
2504-
// first
2505-
_touched_method_table[index] = nptr;
2506-
} else {
2507-
ptr->_next = nptr;
2508-
}
2509-
}
2510-
2511-
void Method::print_touched_methods(outputStream* out) {
2512-
MutexLocker ml(Thread::current()->is_VM_thread() ? NULL : TouchedMethodLog_lock);
2513-
out->print_cr("# Method::print_touched_methods version 1");
2514-
if (_touched_method_table) {
2515-
for (int i = 0; i < TOUCHED_METHOD_TABLE_SIZE; i++) {
2516-
TouchedMethodRecord* ptr = _touched_method_table[i];
2517-
while(ptr) {
2518-
ptr->_class_name->print_symbol_on(out); out->print(".");
2519-
ptr->_method_name->print_symbol_on(out); out->print(":");
2520-
ptr->_method_signature->print_symbol_on(out); out->cr();
2521-
ptr = ptr->_next;
2522-
}
2523-
}
2524-
}
2525-
}
2526-
25272444
// Verification
25282445

25292446
void Method::verify_on(outputStream* st) {

0 commit comments

Comments
 (0)