src/share/vm/prims/jvmtiRedefineClasses.hpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 483   void rewrite_cp_refs_in_stack_map_table(methodHandle method, TRAPS);
 484   void rewrite_cp_refs_in_verification_type_info(
 485          address& stackmap_addr_ref, address stackmap_end, u2 frame_i,
 486          u1 frame_size, TRAPS);
 487   void set_new_constant_pool(ClassLoaderData* loader_data,
 488          instanceKlassHandle scratch_class,
 489          constantPoolHandle scratch_cp, int scratch_cp_length, TRAPS);
 490 
 491   void flush_dependent_code(instanceKlassHandle k_h, TRAPS);
 492 
 493   static void dump_methods();
 494 
 495   // Check that there are no old or obsolete methods
 496   class CheckClass : public KlassClosure {
 497     Thread* _thread;
 498    public:
 499     CheckClass(Thread* t) : _thread(t) {}
 500     void do_klass(Klass* k);
 501   };
 502 












 503   // Unevolving classes may point to methods of the_class directly
 504   // from their constant pool caches, itables, and/or vtables. We
 505   // use the ClassLoaderDataGraph::classes_do() facility and this helper
 506   // to fix up these pointers.
 507   class AdjustCpoolCacheAndVtable : public KlassClosure {
 508     Thread* _thread;
 509    public:
 510     AdjustCpoolCacheAndVtable(Thread* t) : _thread(t) {}
 511     void do_klass(Klass* k);
 512   };
 513 
 514   // Clean MethodData out
 515   class MethodDataCleaner : public KlassClosure {
 516    public:
 517     MethodDataCleaner() {}
 518     void do_klass(Klass* k);
 519   };
 520  public:
 521   VM_RedefineClasses(jint class_count,
 522                      const jvmtiClassDefinition *class_defs,


   1 /*
   2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


 483   void rewrite_cp_refs_in_stack_map_table(methodHandle method, TRAPS);
 484   void rewrite_cp_refs_in_verification_type_info(
 485          address& stackmap_addr_ref, address stackmap_end, u2 frame_i,
 486          u1 frame_size, TRAPS);
 487   void set_new_constant_pool(ClassLoaderData* loader_data,
 488          instanceKlassHandle scratch_class,
 489          constantPoolHandle scratch_cp, int scratch_cp_length, TRAPS);
 490 
 491   void flush_dependent_code(instanceKlassHandle k_h, TRAPS);
 492 
 493   static void dump_methods();
 494 
 495   // Check that there are no old or obsolete methods
 496   class CheckClass : public KlassClosure {
 497     Thread* _thread;
 498    public:
 499     CheckClass(Thread* t) : _thread(t) {}
 500     void do_klass(Klass* k);
 501   };
 502 
 503   // Update old Unsafe.throwIllegalAccessError() itable entries
 504   class UpdateITableThrowIllegalAccessErrorEntries : public KlassClosure {
 505    public:
 506     UpdateITableThrowIllegalAccessErrorEntries() {}
 507 
 508     void do_klass(Klass* k) {
 509       if (k->oop_is_instance()) {
 510         InstanceKlass::cast(k)->itable()->update_throw_illegal_access_entries();
 511       }
 512     }
 513  };
 514 
 515   // Unevolving classes may point to methods of the_class directly
 516   // from their constant pool caches, itables, and/or vtables. We
 517   // use the ClassLoaderDataGraph::classes_do() facility and this helper
 518   // to fix up these pointers.
 519   class AdjustCpoolCacheAndVtable : public KlassClosure {
 520     Thread* _thread;
 521    public:
 522     AdjustCpoolCacheAndVtable(Thread* t) : _thread(t) {}
 523     void do_klass(Klass* k);
 524   };
 525 
 526   // Clean MethodData out
 527   class MethodDataCleaner : public KlassClosure {
 528    public:
 529     MethodDataCleaner() {}
 530     void do_klass(Klass* k);
 531   };
 532  public:
 533   VM_RedefineClasses(jint class_count,
 534                      const jvmtiClassDefinition *class_defs,