Mercurial > hg > graal-jvmci-8
comparison src/share/vm/runtime/frame.cpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | aa3d708d67c4 |
children | 957c266d8bc5 da91efe96a93 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
168 _cb = CodeCache::find_blob_unsafe(_pc); | 168 _cb = CodeCache::find_blob_unsafe(_pc); |
169 | 169 |
170 } | 170 } |
171 | 171 |
172 // type testers | 172 // type testers |
173 bool frame::is_ricochet_frame() const { | 173 bool frame::is_ignored_frame() const { |
174 RicochetBlob* rcb = SharedRuntime::ricochet_blob(); | 174 return false; // FIXME: some LambdaForm frames should be ignored |
175 return (_cb == rcb && rcb != NULL && rcb->returns_to_bounce_addr(_pc)); | 175 } |
176 } | |
177 | |
178 bool frame::is_deoptimized_frame() const { | 176 bool frame::is_deoptimized_frame() const { |
179 assert(_deopt_state != unknown, "not answerable"); | 177 assert(_deopt_state != unknown, "not answerable"); |
180 return _deopt_state == is_deoptimized; | 178 return _deopt_state == is_deoptimized; |
181 } | 179 } |
182 | 180 |
346 } | 344 } |
347 | 345 |
348 frame frame::real_sender(RegisterMap* map) const { | 346 frame frame::real_sender(RegisterMap* map) const { |
349 frame result = sender(map); | 347 frame result = sender(map); |
350 while (result.is_runtime_frame() || | 348 while (result.is_runtime_frame() || |
351 result.is_ricochet_frame()) { | 349 result.is_ignored_frame()) { |
352 result = result.sender(map); | 350 result = result.sender(map); |
353 } | 351 } |
354 return result; | 352 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); | |
360 } | 353 } |
361 | 354 |
362 // Note: called by profiler - NOT for current thread | 355 // Note: called by profiler - NOT for current thread |
363 frame frame::profile_find_Java_sender_frame(JavaThread *thread) { | 356 frame frame::profile_find_Java_sender_frame(JavaThread *thread) { |
364 // If we don't recognize this frame, walk back up the stack until we do | 357 // If we don't recognize this frame, walk back up the stack until we do |
539 // (frame::interpreter_frame_sender_sp accessor is in frame_<arch>.cpp) | 532 // (frame::interpreter_frame_sender_sp accessor is in frame_<arch>.cpp) |
540 | 533 |
541 const char* frame::print_name() const { | 534 const char* frame::print_name() const { |
542 if (is_native_frame()) return "Native"; | 535 if (is_native_frame()) return "Native"; |
543 if (is_interpreted_frame()) return "Interpreted"; | 536 if (is_interpreted_frame()) return "Interpreted"; |
544 if (is_ricochet_frame()) return "Ricochet"; | |
545 if (is_compiled_frame()) { | 537 if (is_compiled_frame()) { |
546 if (is_deoptimized_frame()) return "Deoptimized"; | 538 if (is_deoptimized_frame()) return "Deoptimized"; |
547 return "Compiled"; | 539 return "Compiled"; |
548 } | 540 } |
549 if (sp() == NULL) return "Empty"; | 541 if (sp() == NULL) return "Empty"; |
726 } | 718 } |
727 } else if (_cb->is_runtime_stub()) { | 719 } else if (_cb->is_runtime_stub()) { |
728 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); | 720 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); |
729 } else if (_cb->is_deoptimization_stub()) { | 721 } else if (_cb->is_deoptimization_stub()) { |
730 st->print("v ~DeoptimizationBlob"); | 722 st->print("v ~DeoptimizationBlob"); |
731 } else if (_cb->is_ricochet_stub()) { | |
732 st->print("v ~RichochetBlob"); | |
733 } else if (_cb->is_exception_stub()) { | 723 } else if (_cb->is_exception_stub()) { |
734 st->print("v ~ExceptionBlob"); | 724 st->print("v ~ExceptionBlob"); |
735 } else if (_cb->is_safepoint_stub()) { | 725 } else if (_cb->is_safepoint_stub()) { |
736 st->print("v ~SafepointBlob"); | 726 st->print("v ~SafepointBlob"); |
737 } else { | 727 } else { |
991 finder.oops_do(); | 981 finder.oops_do(); |
992 } | 982 } |
993 | 983 |
994 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { | 984 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { |
995 assert(_cb != NULL, "sanity check"); | 985 assert(_cb != NULL, "sanity check"); |
996 if (_cb == SharedRuntime::ricochet_blob()) { | |
997 oops_ricochet_do(f, reg_map); | |
998 } | |
999 if (_cb->oop_maps() != NULL) { | 986 if (_cb->oop_maps() != NULL) { |
1000 OopMapSet::oops_do(this, reg_map, f); | 987 OopMapSet::oops_do(this, reg_map, f); |
1001 | 988 |
1002 // Preserve potential arguments for a callee. We handle this by dispatching | 989 // Preserve potential arguments for a callee. We handle this by dispatching |
1003 // on the codeblob. For c2i, we do | 990 // on the codeblob. For c2i, we do |
1010 // prevent them from being collected. However, this visit should be | 997 // prevent them from being collected. However, this visit should be |
1011 // restricted to certain phases of the collection only. The | 998 // restricted to certain phases of the collection only. The |
1012 // closure decides how it wants nmethods to be traced. | 999 // closure decides how it wants nmethods to be traced. |
1013 if (cf != NULL) | 1000 if (cf != NULL) |
1014 cf->do_code_blob(_cb); | 1001 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); | |
1020 } | 1002 } |
1021 | 1003 |
1022 class CompiledArgumentOopFinder: public SignatureInfo { | 1004 class CompiledArgumentOopFinder: public SignatureInfo { |
1023 protected: | 1005 protected: |
1024 OopClosure* _f; | 1006 OopClosure* _f; |
1085 frame caller = *this; | 1067 frame caller = *this; |
1086 | 1068 |
1087 // First consult the ADLC on where it puts parameter 0 for this signature. | 1069 // First consult the ADLC on where it puts parameter 0 for this signature. |
1088 VMReg reg = SharedRuntime::name_for_receiver(); | 1070 VMReg reg = SharedRuntime::name_for_receiver(); |
1089 oop r = *caller.oopmapreg_to_location(reg, reg_map); | 1071 oop r = *caller.oopmapreg_to_location(reg, reg_map); |
1090 assert( Universe::heap()->is_in_or_null(r), "bad receiver" ); | 1072 assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (intptr_t) r, (intptr_t) r)); |
1091 return r; | 1073 return r; |
1092 } | 1074 } |
1093 | 1075 |
1094 | 1076 |
1095 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const { | 1077 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const { |
1405 // For now just label the frame | 1387 // For now just label the frame |
1406 nmethod* nm = cb()->as_nmethod_or_null(); | 1388 nmethod* nm = cb()->as_nmethod_or_null(); |
1407 values.describe(-1, info_address, | 1389 values.describe(-1, info_address, |
1408 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, | 1390 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, |
1409 nm, nm->method()->name_and_sig_as_C_string()), 2); | 1391 nm, nm->method()->name_and_sig_as_C_string()), 2); |
1410 } else if (is_ricochet_frame()) { | |
1411 values.describe(-1, info_address, err_msg("#%d ricochet frame", frame_no), 2); | |
1412 } else { | 1392 } else { |
1413 // provide default info if not handled before | 1393 // provide default info if not handled before |
1414 char *info = (char *) "special frame"; | 1394 char *info = (char *) "special frame"; |
1415 if ((_cb != NULL) && | 1395 if ((_cb != NULL) && |
1416 (_cb->name() != NULL)) { | 1396 (_cb->name() != NULL)) { |