hotspot/src/share/vm/runtime/sharedRuntime.cpp
changeset 38259 b495d1cfe673
parent 38209 b2a58604e046
child 38716 640c37e201b9
equal deleted inserted replaced
38251:6a4902a969d3 38259:b495d1cfe673
    44 #include "oops/klass.hpp"
    44 #include "oops/klass.hpp"
    45 #include "oops/objArrayKlass.hpp"
    45 #include "oops/objArrayKlass.hpp"
    46 #include "oops/oop.inline.hpp"
    46 #include "oops/oop.inline.hpp"
    47 #include "prims/forte.hpp"
    47 #include "prims/forte.hpp"
    48 #include "prims/jvmtiExport.hpp"
    48 #include "prims/jvmtiExport.hpp"
    49 #include "prims/jvmtiRedefineClassesTrace.hpp"
       
    50 #include "prims/methodHandles.hpp"
    49 #include "prims/methodHandles.hpp"
    51 #include "prims/nativeLookup.hpp"
    50 #include "prims/nativeLookup.hpp"
    52 #include "runtime/arguments.hpp"
    51 #include "runtime/arguments.hpp"
    53 #include "runtime/atomic.inline.hpp"
    52 #include "runtime/atomic.inline.hpp"
    54 #include "runtime/biasedLocking.hpp"
    53 #include "runtime/biasedLocking.hpp"
   601   Handle h_exception = Exceptions::new_exception(thread, name, message);
   600   Handle h_exception = Exceptions::new_exception(thread, name, message);
   602   throw_and_post_jvmti_exception(thread, h_exception);
   601   throw_and_post_jvmti_exception(thread, h_exception);
   603 }
   602 }
   604 
   603 
   605 // The interpreter code to call this tracing function is only
   604 // The interpreter code to call this tracing function is only
   606 // called/generated when TraceRedefineClasses has the right bits
   605 // called/generated when UL is on for redefine, class and has the right level
   607 // set. Since obsolete methods are never compiled, we don't have
   606 // and tags. Since obsolete methods are never compiled, we don't have
   608 // to modify the compilers to generate calls to this function.
   607 // to modify the compilers to generate calls to this function.
   609 //
   608 //
   610 JRT_LEAF(int, SharedRuntime::rc_trace_method_entry(
   609 JRT_LEAF(int, SharedRuntime::rc_trace_method_entry(
   611     JavaThread* thread, Method* method))
   610     JavaThread* thread, Method* method))
   612   assert(RC_TRACE_IN_RANGE(0x00001000, 0x00002000), "wrong call");
       
   613 
       
   614   if (method->is_obsolete()) {
   611   if (method->is_obsolete()) {
   615     // We are calling an obsolete method, but this is not necessarily
   612     // We are calling an obsolete method, but this is not necessarily
   616     // an error. Our method could have been redefined just after we
   613     // an error. Our method could have been redefined just after we
   617     // fetched the Method* from the constant pool.
   614     // fetched the Method* from the constant pool.
   618 
   615     ResourceMark rm;
   619     // RC_TRACE macro has an embedded ResourceMark
   616     log_trace(redefine, class, obsolete)("calling obsolete method '%s'", method->name_and_sig_as_C_string());
   620     RC_TRACE_WITH_THREAD(0x00001000, thread,
       
   621                          ("calling obsolete method '%s'",
       
   622                           method->name_and_sig_as_C_string()));
       
   623     if (RC_TRACE_ENABLED(0x00002000)) {
       
   624       // this option is provided to debug calls to obsolete methods
       
   625       guarantee(false, "faulting at call to an obsolete method.");
       
   626     }
       
   627   }
   617   }
   628   return 0;
   618   return 0;
   629 JRT_END
   619 JRT_END
   630 
   620 
   631 // ret_pc points into caller; we are returning caller's exception handler
   621 // ret_pc points into caller; we are returning caller's exception handler