1.1 --- a/src/share/vm/runtime/frame.cpp Fri May 06 12:12:29 2011 -0700 1.2 +++ b/src/share/vm/runtime/frame.cpp Fri May 06 16:33:13 2011 -0700 1.3 @@ -33,6 +33,7 @@ 1.4 #include "oops/methodOop.hpp" 1.5 #include "oops/oop.inline.hpp" 1.6 #include "oops/oop.inline2.hpp" 1.7 +#include "prims/methodHandles.hpp" 1.8 #include "runtime/frame.inline.hpp" 1.9 #include "runtime/handles.inline.hpp" 1.10 #include "runtime/javaCalls.hpp" 1.11 @@ -169,6 +170,11 @@ 1.12 } 1.13 1.14 // type testers 1.15 +bool frame::is_ricochet_frame() const { 1.16 + RicochetBlob* rcb = SharedRuntime::ricochet_blob(); 1.17 + return (_cb == rcb && rcb != NULL && rcb->returns_to_bounce_addr(_pc)); 1.18 +} 1.19 + 1.20 bool frame::is_deoptimized_frame() const { 1.21 assert(_deopt_state != unknown, "not answerable"); 1.22 return _deopt_state == is_deoptimized; 1.23 @@ -341,12 +347,18 @@ 1.24 1.25 frame frame::real_sender(RegisterMap* map) const { 1.26 frame result = sender(map); 1.27 - while (result.is_runtime_frame()) { 1.28 + while (result.is_runtime_frame() || 1.29 + result.is_ricochet_frame()) { 1.30 result = result.sender(map); 1.31 } 1.32 return result; 1.33 } 1.34 1.35 +frame frame::sender_for_ricochet_frame(RegisterMap* map) const { 1.36 + assert(is_ricochet_frame(), ""); 1.37 + return MethodHandles::ricochet_frame_sender(*this, map); 1.38 +} 1.39 + 1.40 // Note: called by profiler - NOT for current thread 1.41 frame frame::profile_find_Java_sender_frame(JavaThread *thread) { 1.42 // If we don't recognize this frame, walk back up the stack until we do 1.43 @@ -529,6 +541,7 @@ 1.44 const char* frame::print_name() const { 1.45 if (is_native_frame()) return "Native"; 1.46 if (is_interpreted_frame()) return "Interpreted"; 1.47 + if (is_ricochet_frame()) return "Ricochet"; 1.48 if (is_compiled_frame()) { 1.49 if (is_deoptimized_frame()) return "Deoptimized"; 1.50 return "Compiled"; 1.51 @@ -715,6 +728,8 @@ 1.52 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); 1.53 } else if (_cb->is_deoptimization_stub()) { 1.54 st->print("v ~DeoptimizationBlob"); 1.55 + } else if (_cb->is_ricochet_stub()) { 1.56 + st->print("v ~RichochetBlob"); 1.57 } else if (_cb->is_exception_stub()) { 1.58 st->print("v ~ExceptionBlob"); 1.59 } else if (_cb->is_safepoint_stub()) { 1.60 @@ -978,6 +993,9 @@ 1.61 1.62 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { 1.63 assert(_cb != NULL, "sanity check"); 1.64 + if (_cb == SharedRuntime::ricochet_blob()) { 1.65 + oops_ricochet_do(f, reg_map); 1.66 + } 1.67 if (_cb->oop_maps() != NULL) { 1.68 OopMapSet::oops_do(this, reg_map, f); 1.69 1.70 @@ -996,6 +1014,11 @@ 1.71 cf->do_code_blob(_cb); 1.72 } 1.73 1.74 +void frame::oops_ricochet_do(OopClosure* f, const RegisterMap* map) { 1.75 + assert(is_ricochet_frame(), ""); 1.76 + MethodHandles::ricochet_frame_oops_do(*this, f, map); 1.77 +} 1.78 + 1.79 class CompiledArgumentOopFinder: public SignatureInfo { 1.80 protected: 1.81 OopClosure* _f;