hotspot/src/share/vm/prims/jvmtiRedefineClasses.cpp
changeset 33148 68fa8b6c4340
parent 32401 cc58aeaec340
child 33589 7cbd1b2c139b
child 33593 60764a78fa5c
equal deleted inserted replaced
33146:77349b58b4c0 33148:68fa8b6c4340
    42 #include "prims/methodComparator.hpp"
    42 #include "prims/methodComparator.hpp"
    43 #include "runtime/deoptimization.hpp"
    43 #include "runtime/deoptimization.hpp"
    44 #include "runtime/relocator.hpp"
    44 #include "runtime/relocator.hpp"
    45 #include "utilities/bitMap.inline.hpp"
    45 #include "utilities/bitMap.inline.hpp"
    46 #include "utilities/events.hpp"
    46 #include "utilities/events.hpp"
    47 
       
    48 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
       
    49 
    47 
    50 Array<Method*>* VM_RedefineClasses::_old_methods = NULL;
    48 Array<Method*>* VM_RedefineClasses::_old_methods = NULL;
    51 Array<Method*>* VM_RedefineClasses::_new_methods = NULL;
    49 Array<Method*>* VM_RedefineClasses::_new_methods = NULL;
    52 Method**  VM_RedefineClasses::_matching_old_methods = NULL;
    50 Method**  VM_RedefineClasses::_matching_old_methods = NULL;
    53 Method**  VM_RedefineClasses::_matching_new_methods = NULL;
    51 Method**  VM_RedefineClasses::_matching_new_methods = NULL;
  1712           if (!StressLdcRewrite && new_index <= max_jubyte) {
  1710           if (!StressLdcRewrite && new_index <= max_jubyte) {
  1713             // The new value can still use ldc instead of ldc_w
  1711             // The new value can still use ldc instead of ldc_w
  1714             // unless we are trying to stress ldc -> ldc_w rewriting
  1712             // unless we are trying to stress ldc -> ldc_w rewriting
  1715             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1713             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1716               ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
  1714               ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
  1717               bcp, cp_index, new_index));
  1715               p2i(bcp), cp_index, new_index));
  1718             *(bcp + 1) = new_index;
  1716             *(bcp + 1) = new_index;
  1719           } else {
  1717           } else {
  1720             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1718             RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1721               ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d",
  1719               ("%s->ldc_w@" INTPTR_FORMAT " old=%d, new=%d",
  1722               Bytecodes::name(c), bcp, cp_index, new_index));
  1720               Bytecodes::name(c), p2i(bcp), cp_index, new_index));
  1723             // the new value needs ldc_w instead of ldc
  1721             // the new value needs ldc_w instead of ldc
  1724             u_char inst_buffer[4]; // max instruction size is 4 bytes
  1722             u_char inst_buffer[4]; // max instruction size is 4 bytes
  1725             bcp = (address)inst_buffer;
  1723             bcp = (address)inst_buffer;
  1726             // construct new instruction sequence
  1724             // construct new instruction sequence
  1727             *bcp = Bytecodes::_ldc_w;
  1725             *bcp = Bytecodes::_ldc_w;
  1778         int new_index = find_new_index(cp_index);
  1776         int new_index = find_new_index(cp_index);
  1779         if (new_index != 0) {
  1777         if (new_index != 0) {
  1780           // the original index is mapped so update w/ new value
  1778           // the original index is mapped so update w/ new value
  1781           RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1779           RC_TRACE_WITH_THREAD(0x00080000, THREAD,
  1782             ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
  1780             ("%s@" INTPTR_FORMAT " old=%d, new=%d", Bytecodes::name(c),
  1783             bcp, cp_index, new_index));
  1781             p2i(bcp), cp_index, new_index));
  1784           // Rewriter::rewrite_method() uses put_native_u2() in this
  1782           // Rewriter::rewrite_method() uses put_native_u2() in this
  1785           // situation because it is reusing the constant pool index
  1783           // situation because it is reusing the constant pool index
  1786           // location for a native index into the ConstantPoolCache.
  1784           // location for a native index into the ConstantPoolCache.
  1787           // Since we are updating the constant pool index prior to
  1785           // Since we are updating the constant pool index prior to
  1788           // verification and ConstantPoolCache initialization, we
  1786           // verification and ConstantPoolCache initialization, we