hotspot/src/share/vm/code/nmethod.cpp
changeset 35108 ccb4e1f2a6cf
parent 35092 82170e5767c3
child 35132 07bc696c7fdb
equal deleted inserted replaced
35107:ebed5fa5b08a 35108:ccb4e1f2a6cf
  2330 // Method that knows how to preserve outgoing arguments at call. This method must be
  2330 // Method that knows how to preserve outgoing arguments at call. This method must be
  2331 // called with a frame corresponding to a Java invoke
  2331 // called with a frame corresponding to a Java invoke
  2332 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
  2332 void nmethod::preserve_callee_argument_oops(frame fr, const RegisterMap *reg_map, OopClosure* f) {
  2333 #ifndef SHARK
  2333 #ifndef SHARK
  2334   if (method() != NULL && !method()->is_native()) {
  2334   if (method() != NULL && !method()->is_native()) {
  2335     SimpleScopeDesc ssd(this, fr.pc());
  2335     address pc = fr.pc();
       
  2336     SimpleScopeDesc ssd(this, pc);
  2336     Bytecode_invoke call(ssd.method(), ssd.bci());
  2337     Bytecode_invoke call(ssd.method(), ssd.bci());
  2337     bool has_receiver = call.has_receiver();
  2338     bool has_receiver = call.has_receiver();
  2338     bool has_appendix = call.has_appendix();
  2339     bool has_appendix = call.has_appendix();
  2339     Symbol* signature = call.signature();
  2340     Symbol* signature = call.signature();
       
  2341 
       
  2342     // The method attached by JIT-compilers should be used, if present.
       
  2343     // Bytecode can be inaccurate in such case.
       
  2344     Method* callee = attached_method_before_pc(pc);
       
  2345     if (callee != NULL) {
       
  2346       has_receiver = !(callee->access_flags().is_static());
       
  2347       has_appendix = false;
       
  2348       signature = callee->signature();
       
  2349     }
       
  2350 
  2340     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
  2351     fr.oops_compiled_arguments_do(signature, has_receiver, has_appendix, reg_map, f);
  2341   }
  2352   }
  2342 #endif // !SHARK
  2353 #endif // !SHARK
  2343 }
  2354 }
  2344 
  2355 
  3524     }
  3535     }
  3525   }
  3536   }
  3526   return NULL; // not found
  3537   return NULL; // not found
  3527 }
  3538 }
  3528 
  3539 
       
  3540 Method* nmethod::attached_method_before_pc(address pc) {
       
  3541   if (NativeCall::is_call_before(pc)) {
       
  3542     NativeCall* ncall = nativeCall_before(pc);
       
  3543     return attached_method(ncall->instruction_address());
       
  3544   }
       
  3545   return NULL; // not a call
       
  3546 }
       
  3547