Mercurial > hg > truffle
comparison src/share/vm/oops/methodOop.cpp @ 48:d8b3ef7ee3e5
6599425: 4/3 OopMapCache::lookup() can cause later crash or assert() failure
Summary: Add should_not_be_cached() to markOop and methodOop and query that status inOopMapCache::lookup()
Reviewed-by: coleenp, sspitsyn, jmasa
author | dcubed |
---|---|
date | Wed, 12 Mar 2008 18:07:46 -0700 |
parents | a61af66fc99e |
children | 541929da62d2 |
comparison
equal
deleted
inserted
replaced
47:2c106685d6d0 | 48:d8b3ef7ee3e5 |
---|---|
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 |