hotspot/src/share/vm/oops/methodOop.cpp
changeset 221 ec745a0fe922
parent 1 489c9b5090e2
child 351 74ef5746f624
equal deleted inserted replaced
220:e6ef4818c49d 221:ec745a0fe922
   763     return vt_m != methodOop(this);
   763     return vt_m != methodOop(this);
   764   }
   764   }
   765 }
   765 }
   766 
   766 
   767 
   767 
       
   768 // give advice about whether this methodOop should be cached or not
       
   769 bool methodOopDesc::should_not_be_cached() const {
       
   770   if (is_old()) {
       
   771     // This method has been redefined. It is either EMCP or obsolete
       
   772     // and we don't want to cache it because that would pin the method
       
   773     // down and prevent it from being collectible if and when it
       
   774     // finishes executing.
       
   775     return true;
       
   776   }
       
   777 
       
   778   if (mark()->should_not_be_cached()) {
       
   779     // It is either not safe or not a good idea to cache this
       
   780     // method at this time because of the state of the embedded
       
   781     // markOop. See markOop.cpp for the gory details.
       
   782     return true;
       
   783   }
       
   784 
       
   785   // caching this method should be just fine
       
   786   return false;
       
   787 }
       
   788 
       
   789 
   768 methodHandle methodOopDesc:: clone_with_new_data(methodHandle m, u_char* new_code, int new_code_length,
   790 methodHandle methodOopDesc:: clone_with_new_data(methodHandle m, u_char* new_code, int new_code_length,
   769                                                 u_char* new_compressed_linenumber_table, int new_compressed_linenumber_size, TRAPS) {
   791                                                 u_char* new_compressed_linenumber_table, int new_compressed_linenumber_size, TRAPS) {
   770   // Code below does not work for native methods - they should never get rewritten anyway
   792   // Code below does not work for native methods - they should never get rewritten anyway
   771   assert(!m->is_native(), "cannot rewrite native methods");
   793   assert(!m->is_native(), "cannot rewrite native methods");
   772   // Allocate new methodOop
   794   // Allocate new methodOop