Mercurial > hg > graal-compiler
diff src/share/vm/prims/jvmtiRedefineClasses.hpp @ 10408:836a62f43af9
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 19 Jun 2013 10:45:56 +0200 |
parents | 43083e670adf |
children | 825e6cb66923 |
line wrap: on
line diff
--- a/src/share/vm/prims/jvmtiRedefineClasses.hpp Tue Jun 18 14:23:29 2013 -0700 +++ b/src/share/vm/prims/jvmtiRedefineClasses.hpp Wed Jun 19 10:45:56 2013 +0200 @@ -87,7 +87,7 @@ // parts of the_class // - adjusting constant pool caches and vtables in other classes // that refer to methods in the_class. These adjustments use the -// SystemDictionary::classes_do() facility which only allows +// ClassLoaderDataGraph::classes_do() facility which only allows // a helper method to be specified. The interesting parameters // that we would like to pass to the helper method are saved in // static global fields in the VM operation. @@ -333,8 +333,8 @@ class VM_RedefineClasses: public VM_Operation { private: - // These static fields are needed by SystemDictionary::classes_do() - // facility and the adjust_cpool_cache_and_vtable() helper: + // These static fields are needed by ClassLoaderDataGraph::classes_do() + // facility and the AdjustCpoolCacheAndVtable helper: static Array<Method*>* _old_methods; static Array<Method*>* _new_methods; static Method** _matching_old_methods; @@ -359,8 +359,15 @@ // _index_map_p contains any entries. int _index_map_count; intArray * _index_map_p; + + // _operands_index_map_count is just an optimization for knowing if + // _operands_index_map_p contains any entries. + int _operands_cur_length; + int _operands_index_map_count; + intArray * _operands_index_map_p; + // ptr to _class_count scratch_classes - Klass** _scratch_classes; + Klass** _scratch_classes; jvmtiError _res; // Performance measurement support. These timers do not cover all @@ -401,13 +408,6 @@ int * emcp_method_count_p); void transfer_old_native_function_registrations(instanceKlassHandle the_class); - // Unevolving classes may point to methods of the_class directly - // from their constant pool caches, itables, and/or vtables. We - // use the SystemDictionary::classes_do() facility and this helper - // to fix up these pointers. - static void adjust_cpool_cache_and_vtable(Klass* k_oop, ClassLoaderData* initiating_loader, TRAPS); - static void adjust_array_vtable(Klass* k_oop); - // Install the redefinition of a class void redefine_single_class(jclass the_jclass, Klass* scratch_class_oop, TRAPS); @@ -422,12 +422,19 @@ // Support for constant pool merging (these routines are in alpha order): void append_entry(constantPoolHandle scratch_cp, int scratch_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS); + void append_operand(constantPoolHandle scratch_cp, int scratch_bootstrap_spec_index, + constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS); + void finalize_operands_merge(constantPoolHandle merge_cp, TRAPS); int find_or_append_indirect_entry(constantPoolHandle scratch_cp, int scratch_i, constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS); + int find_or_append_operand(constantPoolHandle scratch_cp, int scratch_bootstrap_spec_index, + constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS); int find_new_index(int old_index); + int find_new_operand_index(int old_bootstrap_spec_index); bool is_unresolved_class_mismatch(constantPoolHandle cp1, int index1, constantPoolHandle cp2, int index2); void map_index(constantPoolHandle scratch_cp, int old_index, int new_index); + void map_operand_index(int old_bootstrap_spec_index, int new_bootstrap_spec_index); bool merge_constant_pools(constantPoolHandle old_cp, constantPoolHandle scratch_cp, constantPoolHandle *merge_cp_p, int *merge_cp_length_p, TRAPS); @@ -466,10 +473,27 @@ void flush_dependent_code(instanceKlassHandle k_h, TRAPS); - static void check_class(Klass* k_oop, ClassLoaderData* initiating_loader, - TRAPS); static void dump_methods(); + // Check that there are no old or obsolete methods + class CheckClass : public KlassClosure { + Thread* _thread; + public: + CheckClass(Thread* t) : _thread(t) {} + void do_klass(Klass* k); + }; + + // Unevolving classes may point to methods of the_class directly + // from their constant pool caches, itables, and/or vtables. We + // use the ClassLoaderDataGraph::classes_do() facility and this helper + // to fix up these pointers. + class AdjustCpoolCacheAndVtable : public KlassClosure { + Thread* _thread; + public: + AdjustCpoolCacheAndVtable(Thread* t) : _thread(t) {} + void do_klass(Klass* k); + }; + public: VM_RedefineClasses(jint class_count, const jvmtiClassDefinition *class_defs,