hotspot/src/share/vm/runtime/frame.cpp
changeset 9630 d6419e4395e3
parent 9437 9981851b4b8c
child 9632 cd86c748c12b
equal deleted inserted replaced
9629:1f4dc6af5ad8 9630:d6419e4395e3
    31 #include "oops/markOop.hpp"
    31 #include "oops/markOop.hpp"
    32 #include "oops/methodDataOop.hpp"
    32 #include "oops/methodDataOop.hpp"
    33 #include "oops/methodOop.hpp"
    33 #include "oops/methodOop.hpp"
    34 #include "oops/oop.inline.hpp"
    34 #include "oops/oop.inline.hpp"
    35 #include "oops/oop.inline2.hpp"
    35 #include "oops/oop.inline2.hpp"
       
    36 #include "prims/methodHandles.hpp"
    36 #include "runtime/frame.inline.hpp"
    37 #include "runtime/frame.inline.hpp"
    37 #include "runtime/handles.inline.hpp"
    38 #include "runtime/handles.inline.hpp"
    38 #include "runtime/javaCalls.hpp"
    39 #include "runtime/javaCalls.hpp"
    39 #include "runtime/monitorChunk.hpp"
    40 #include "runtime/monitorChunk.hpp"
    40 #include "runtime/sharedRuntime.hpp"
    41 #include "runtime/sharedRuntime.hpp"
   167   _cb = CodeCache::find_blob_unsafe(_pc);
   168   _cb = CodeCache::find_blob_unsafe(_pc);
   168 
   169 
   169 }
   170 }
   170 
   171 
   171 // type testers
   172 // type testers
       
   173 bool frame::is_ricochet_frame() const {
       
   174   RicochetBlob* rcb = SharedRuntime::ricochet_blob();
       
   175   return (_cb == rcb && rcb != NULL && rcb->returns_to_bounce_addr(_pc));
       
   176 }
       
   177 
   172 bool frame::is_deoptimized_frame() const {
   178 bool frame::is_deoptimized_frame() const {
   173   assert(_deopt_state != unknown, "not answerable");
   179   assert(_deopt_state != unknown, "not answerable");
   174   return _deopt_state == is_deoptimized;
   180   return _deopt_state == is_deoptimized;
   175 }
   181 }
   176 
   182 
   339   return s;
   345   return s;
   340 }
   346 }
   341 
   347 
   342 frame frame::real_sender(RegisterMap* map) const {
   348 frame frame::real_sender(RegisterMap* map) const {
   343   frame result = sender(map);
   349   frame result = sender(map);
   344   while (result.is_runtime_frame()) {
   350   while (result.is_runtime_frame() ||
       
   351          result.is_ricochet_frame()) {
   345     result = result.sender(map);
   352     result = result.sender(map);
   346   }
   353   }
   347   return result;
   354   return result;
       
   355 }
       
   356 
       
   357 frame frame::sender_for_ricochet_frame(RegisterMap* map) const {
       
   358   assert(is_ricochet_frame(), "");
       
   359   return MethodHandles::ricochet_frame_sender(*this, map);
   348 }
   360 }
   349 
   361 
   350 // Note: called by profiler - NOT for current thread
   362 // Note: called by profiler - NOT for current thread
   351 frame frame::profile_find_Java_sender_frame(JavaThread *thread) {
   363 frame frame::profile_find_Java_sender_frame(JavaThread *thread) {
   352 // If we don't recognize this frame, walk back up the stack until we do
   364 // If we don't recognize this frame, walk back up the stack until we do
   527 // (frame::interpreter_frame_sender_sp accessor is in frame_<arch>.cpp)
   539 // (frame::interpreter_frame_sender_sp accessor is in frame_<arch>.cpp)
   528 
   540 
   529 const char* frame::print_name() const {
   541 const char* frame::print_name() const {
   530   if (is_native_frame())      return "Native";
   542   if (is_native_frame())      return "Native";
   531   if (is_interpreted_frame()) return "Interpreted";
   543   if (is_interpreted_frame()) return "Interpreted";
       
   544   if (is_ricochet_frame())    return "Ricochet";
   532   if (is_compiled_frame()) {
   545   if (is_compiled_frame()) {
   533     if (is_deoptimized_frame()) return "Deoptimized";
   546     if (is_deoptimized_frame()) return "Deoptimized";
   534     return "Compiled";
   547     return "Compiled";
   535   }
   548   }
   536   if (sp() == NULL)            return "Empty";
   549   if (sp() == NULL)            return "Empty";
   713       }
   726       }
   714     } else if (_cb->is_runtime_stub()) {
   727     } else if (_cb->is_runtime_stub()) {
   715       st->print("v  ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name());
   728       st->print("v  ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name());
   716     } else if (_cb->is_deoptimization_stub()) {
   729     } else if (_cb->is_deoptimization_stub()) {
   717       st->print("v  ~DeoptimizationBlob");
   730       st->print("v  ~DeoptimizationBlob");
       
   731     } else if (_cb->is_ricochet_stub()) {
       
   732       st->print("v  ~RichochetBlob");
   718     } else if (_cb->is_exception_stub()) {
   733     } else if (_cb->is_exception_stub()) {
   719       st->print("v  ~ExceptionBlob");
   734       st->print("v  ~ExceptionBlob");
   720     } else if (_cb->is_safepoint_stub()) {
   735     } else if (_cb->is_safepoint_stub()) {
   721       st->print("v  ~SafepointBlob");
   736       st->print("v  ~SafepointBlob");
   722     } else {
   737     } else {
   976   finder.oops_do();
   991   finder.oops_do();
   977 }
   992 }
   978 
   993 
   979 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) {
   994 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) {
   980   assert(_cb != NULL, "sanity check");
   995   assert(_cb != NULL, "sanity check");
       
   996   if (_cb == SharedRuntime::ricochet_blob()) {
       
   997     oops_ricochet_do(f, reg_map);
       
   998   }
   981   if (_cb->oop_maps() != NULL) {
   999   if (_cb->oop_maps() != NULL) {
   982     OopMapSet::oops_do(this, reg_map, f);
  1000     OopMapSet::oops_do(this, reg_map, f);
   983 
  1001 
   984     // Preserve potential arguments for a callee. We handle this by dispatching
  1002     // Preserve potential arguments for a callee. We handle this by dispatching
   985     // on the codeblob. For c2i, we do
  1003     // on the codeblob. For c2i, we do
   992   // prevent them from being collected. However, this visit should be
  1010   // prevent them from being collected. However, this visit should be
   993   // restricted to certain phases of the collection only. The
  1011   // restricted to certain phases of the collection only. The
   994   // closure decides how it wants nmethods to be traced.
  1012   // closure decides how it wants nmethods to be traced.
   995   if (cf != NULL)
  1013   if (cf != NULL)
   996     cf->do_code_blob(_cb);
  1014     cf->do_code_blob(_cb);
       
  1015 }
       
  1016 
       
  1017 void frame::oops_ricochet_do(OopClosure* f, const RegisterMap* map) {
       
  1018   assert(is_ricochet_frame(), "");
       
  1019   MethodHandles::ricochet_frame_oops_do(*this, f, map);
   997 }
  1020 }
   998 
  1021 
   999 class CompiledArgumentOopFinder: public SignatureInfo {
  1022 class CompiledArgumentOopFinder: public SignatureInfo {
  1000  protected:
  1023  protected:
  1001   OopClosure*     _f;
  1024   OopClosure*     _f;