comparison src/share/vm/oops/method.cpp @ 20489:966205f0e717

8058564: Tiered compilation performance drop in PIT Summary: Ensure MethodCounters are created before method is enqueued for compilation Reviewed-by: kvn, drchase, jiangli, roland
author iveresov
date Fri, 19 Sep 2014 11:53:58 -0700
parents bc4ce33c0985
children b12a2a9b05ca
comparison
equal deleted inserted replaced
20488:9c8439756c05 20489:966205f0e717
91 set_jfr_towrite(false); 91 set_jfr_towrite(false);
92 set_force_inline(false); 92 set_force_inline(false);
93 set_hidden(false); 93 set_hidden(false);
94 set_dont_inline(false); 94 set_dont_inline(false);
95 set_method_data(NULL); 95 set_method_data(NULL);
96 set_method_counters(NULL); 96 clear_method_counters();
97 set_vtable_index(Method::garbage_vtable_index); 97 set_vtable_index(Method::garbage_vtable_index);
98 98
99 // Fix and bury in Method* 99 // Fix and bury in Method*
100 set_interpreter_entry(NULL); // sets i2i entry and from_int 100 set_interpreter_entry(NULL); // sets i2i entry and from_int
101 set_adapter_entry(NULL); 101 set_adapter_entry(NULL);
115 MetadataFactory::free_metadata(loader_data, constMethod()); 115 MetadataFactory::free_metadata(loader_data, constMethod());
116 set_constMethod(NULL); 116 set_constMethod(NULL);
117 MetadataFactory::free_metadata(loader_data, method_data()); 117 MetadataFactory::free_metadata(loader_data, method_data());
118 set_method_data(NULL); 118 set_method_data(NULL);
119 MetadataFactory::free_metadata(loader_data, method_counters()); 119 MetadataFactory::free_metadata(loader_data, method_counters());
120 set_method_counters(NULL); 120 clear_method_counters();
121 // The nmethod will be gone when we get here. 121 // The nmethod will be gone when we get here.
122 if (code() != NULL) _code = NULL; 122 if (code() != NULL) _code = NULL;
123 } 123 }
124 124
125 address Method::get_i2c_entry() { 125 address Method::get_i2c_entry() {
386 386
387 MethodCounters* Method::build_method_counters(Method* m, TRAPS) { 387 MethodCounters* Method::build_method_counters(Method* m, TRAPS) {
388 methodHandle mh(m); 388 methodHandle mh(m);
389 ClassLoaderData* loader_data = mh->method_holder()->class_loader_data(); 389 ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
390 MethodCounters* counters = MethodCounters::allocate(loader_data, CHECK_NULL); 390 MethodCounters* counters = MethodCounters::allocate(loader_data, CHECK_NULL);
391 if (mh->method_counters() == NULL) { 391 if (!mh->init_method_counters(counters)) {
392 mh->set_method_counters(counters);
393 } else {
394 MetadataFactory::free_metadata(loader_data, counters); 392 MetadataFactory::free_metadata(loader_data, counters);
395 } 393 }
396 return mh->method_counters(); 394 return mh->method_counters();
397 } 395 }
398 396
850 // have already been called (before an exception happened), so 848 // have already been called (before an exception happened), so
851 // this->_method_data may not be NULL. 849 // this->_method_data may not be NULL.
852 assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?"); 850 assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?");
853 851
854 set_method_data(NULL); 852 set_method_data(NULL);
855 set_method_counters(NULL); 853 clear_method_counters();
856 } 854 }
857 855
858 // Called when the method_holder is getting linked. Setup entrypoints so the method 856 // Called when the method_holder is getting linked. Setup entrypoints so the method
859 // is ready to be called from interpreter, compiler, and vtables. 857 // is ready to be called from interpreter, compiler, and vtables.
860 void Method::link_method(methodHandle h_method, TRAPS) { 858 void Method::link_method(methodHandle h_method, TRAPS) {