@@ -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
25292446void Method::verify_on (outputStream* st) {
0 commit comments