hotspot/src/share/vm/oops/method.cpp
changeset 26799 0c349e16bbe8
parent 26586 992efa57514f
child 27247 99db666dbe8e
equal deleted inserted replaced
26797:b89b8ffec1f0 26799:0c349e16bbe8
    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() {
   393 
   393 
   394 MethodCounters* Method::build_method_counters(Method* m, TRAPS) {
   394 MethodCounters* Method::build_method_counters(Method* m, TRAPS) {
   395   methodHandle mh(m);
   395   methodHandle mh(m);
   396   ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
   396   ClassLoaderData* loader_data = mh->method_holder()->class_loader_data();
   397   MethodCounters* counters = MethodCounters::allocate(loader_data, CHECK_NULL);
   397   MethodCounters* counters = MethodCounters::allocate(loader_data, CHECK_NULL);
   398   if (mh->method_counters() == NULL) {
   398   if (!mh->init_method_counters(counters)) {
   399     mh->set_method_counters(counters);
       
   400   } else {
       
   401     MetadataFactory::free_metadata(loader_data, counters);
   399     MetadataFactory::free_metadata(loader_data, counters);
   402   }
   400   }
   403   return mh->method_counters();
   401   return mh->method_counters();
   404 }
   402 }
   405 
   403 
   857   // have already been called (before an exception happened), so
   855   // have already been called (before an exception happened), so
   858   // this->_method_data may not be NULL.
   856   // this->_method_data may not be NULL.
   859   assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?");
   857   assert(!DumpSharedSpaces || _method_data == NULL, "unexpected method data?");
   860 
   858 
   861   set_method_data(NULL);
   859   set_method_data(NULL);
   862   set_method_counters(NULL);
   860   clear_method_counters();
   863 }
   861 }
   864 
   862 
   865 // Called when the method_holder is getting linked. Setup entrypoints so the method
   863 // Called when the method_holder is getting linked. Setup entrypoints so the method
   866 // is ready to be called from interpreter, compiler, and vtables.
   864 // is ready to be called from interpreter, compiler, and vtables.
   867 void Method::link_method(methodHandle h_method, TRAPS) {
   865 void Method::link_method(methodHandle h_method, TRAPS) {