hotspot/src/share/vm/code/compiledMethod.cpp
changeset 46623 261b9d05b79d
parent 42650 1f304d0c888b
child 46630 75aa3e39d02c
equal deleted inserted replaced
46620:750c6edff33b 46623:261b9d05b79d
    22  *
    22  *
    23  */
    23  */
    24 
    24 
    25 #include "precompiled.hpp"
    25 #include "precompiled.hpp"
    26 #include "code/compiledIC.hpp"
    26 #include "code/compiledIC.hpp"
       
    27 #include "code/compiledMethod.inline.hpp"
    27 #include "code/scopeDesc.hpp"
    28 #include "code/scopeDesc.hpp"
    28 #include "code/codeCache.hpp"
    29 #include "code/codeCache.hpp"
    29 #include "prims/methodHandles.hpp"
    30 #include "prims/methodHandles.hpp"
    30 #include "interpreter/bytecode.hpp"
    31 #include "interpreter/bytecode.hpp"
    31 #include "memory/resourceArea.hpp"
    32 #include "memory/resourceArea.hpp"
    55   if (!has_method_handle_invokes())  return false;
    56   if (!has_method_handle_invokes())  return false;
    56   PcDesc* pd = pc_desc_at(return_pc);
    57   PcDesc* pd = pc_desc_at(return_pc);
    57   if (pd == NULL)
    58   if (pd == NULL)
    58     return false;
    59     return false;
    59   return pd->is_method_handle_invoke();
    60   return pd->is_method_handle_invoke();
    60 }
       
    61 
       
    62 // When using JVMCI the address might be off by the size of a call instruction.
       
    63 bool CompiledMethod::is_deopt_entry(address pc) {
       
    64   return pc == deopt_handler_begin()
       
    65 #if INCLUDE_JVMCI
       
    66     || (is_compiled_by_jvmci() && pc == (deopt_handler_begin() + NativeCall::instruction_size))
       
    67 #endif
       
    68     ;
       
    69 }
    61 }
    70 
    62 
    71 // Returns a string version of the method state.
    63 // Returns a string version of the method state.
    72 const char* CompiledMethod::state() const {
    64 const char* CompiledMethod::state() const {
    73   int state = get_state();
    65   int state = get_state();
   313     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
   305     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
   314   }
   306   }
   315 #endif // !SHARK
   307 #endif // !SHARK
   316 }
   308 }
   317 
   309 
   318 // -----------------------------------------------------------------------------
       
   319 // CompiledMethod::get_deopt_original_pc
       
   320 //
       
   321 // Return the original PC for the given PC if:
       
   322 // (a) the given PC belongs to a nmethod and
       
   323 // (b) it is a deopt PC
       
   324 address CompiledMethod::get_deopt_original_pc(const frame* fr) {
       
   325   if (fr->cb() == NULL)  return NULL;
       
   326 
       
   327   CompiledMethod* cm = fr->cb()->as_compiled_method_or_null();
       
   328   if (cm != NULL && cm->is_deopt_pc(fr->pc()))
       
   329     return cm->get_original_pc(fr);
       
   330 
       
   331   return NULL;
       
   332 }
       
   333 
       
   334 Method* CompiledMethod::attached_method(address call_instr) {
   310 Method* CompiledMethod::attached_method(address call_instr) {
   335   assert(code_contains(call_instr), "not part of the nmethod");
   311   assert(code_contains(call_instr), "not part of the nmethod");
   336   RelocIterator iter(this, call_instr, call_instr + 1);
   312   RelocIterator iter(this, call_instr, call_instr + 1);
   337   while (iter.next()) {
   313   while (iter.next()) {
   338     if (iter.addr() == call_instr) {
   314     if (iter.addr() == call_instr) {