Mercurial > hg > truffle
comparison src/share/vm/runtime/frame.cpp @ 6275:957c266d8bc5
Merge with http://hg.openjdk.java.net/hsx/hsx24/hotspot/
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 21 Aug 2012 10:39:19 +0200 |
parents | 28577a53d3a7 1d7922586cf6 |
children | e522a00b91aa |
comparison
equal
deleted
inserted
replaced
5891:fd8832ae511d | 6275:957c266d8bc5 |
---|---|
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"; |
748 } | 740 } |
749 } else if (_cb->is_runtime_stub()) { | 741 } else if (_cb->is_runtime_stub()) { |
750 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); | 742 st->print("v ~RuntimeStub::%s", ((RuntimeStub *)_cb)->name()); |
751 } else if (_cb->is_deoptimization_stub()) { | 743 } else if (_cb->is_deoptimization_stub()) { |
752 st->print("v ~DeoptimizationBlob"); | 744 st->print("v ~DeoptimizationBlob"); |
753 } else if (_cb->is_ricochet_stub()) { | |
754 st->print("v ~RichochetBlob"); | |
755 } else if (_cb->is_exception_stub()) { | 745 } else if (_cb->is_exception_stub()) { |
756 st->print("v ~ExceptionBlob"); | 746 st->print("v ~ExceptionBlob"); |
757 } else if (_cb->is_safepoint_stub()) { | 747 } else if (_cb->is_safepoint_stub()) { |
758 st->print("v ~SafepointBlob"); | 748 st->print("v ~SafepointBlob"); |
759 } else { | 749 } else { |
1013 finder.oops_do(); | 1003 finder.oops_do(); |
1014 } | 1004 } |
1015 | 1005 |
1016 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { | 1006 void frame::oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* reg_map) { |
1017 assert(_cb != NULL, "sanity check"); | 1007 assert(_cb != NULL, "sanity check"); |
1018 if (_cb == SharedRuntime::ricochet_blob()) { | |
1019 oops_ricochet_do(f, reg_map); | |
1020 } | |
1021 if (_cb->oop_maps() != NULL) { | 1008 if (_cb->oop_maps() != NULL) { |
1022 OopMapSet::oops_do(this, reg_map, f); | 1009 OopMapSet::oops_do(this, reg_map, f); |
1023 | 1010 |
1024 // Preserve potential arguments for a callee. We handle this by dispatching | 1011 // Preserve potential arguments for a callee. We handle this by dispatching |
1025 // on the codeblob. For c2i, we do | 1012 // on the codeblob. For c2i, we do |
1032 // prevent them from being collected. However, this visit should be | 1019 // prevent them from being collected. However, this visit should be |
1033 // restricted to certain phases of the collection only. The | 1020 // restricted to certain phases of the collection only. The |
1034 // closure decides how it wants nmethods to be traced. | 1021 // closure decides how it wants nmethods to be traced. |
1035 if (cf != NULL) | 1022 if (cf != NULL) |
1036 cf->do_code_blob(_cb); | 1023 cf->do_code_blob(_cb); |
1037 } | |
1038 | |
1039 void frame::oops_ricochet_do(OopClosure* f, const RegisterMap* map) { | |
1040 assert(is_ricochet_frame(), ""); | |
1041 MethodHandles::ricochet_frame_oops_do(*this, f, map); | |
1042 } | 1024 } |
1043 | 1025 |
1044 class CompiledArgumentOopFinder: public SignatureInfo { | 1026 class CompiledArgumentOopFinder: public SignatureInfo { |
1045 protected: | 1027 protected: |
1046 OopClosure* _f; | 1028 OopClosure* _f; |
1107 frame caller = *this; | 1089 frame caller = *this; |
1108 | 1090 |
1109 // First consult the ADLC on where it puts parameter 0 for this signature. | 1091 // First consult the ADLC on where it puts parameter 0 for this signature. |
1110 VMReg reg = SharedRuntime::name_for_receiver(); | 1092 VMReg reg = SharedRuntime::name_for_receiver(); |
1111 oop r = *caller.oopmapreg_to_location(reg, reg_map); | 1093 oop r = *caller.oopmapreg_to_location(reg, reg_map); |
1112 assert( Universe::heap()->is_in_or_null(r), "bad receiver" ); | 1094 assert(Universe::heap()->is_in_or_null(r), err_msg("bad receiver: " INTPTR_FORMAT " (" INTX_FORMAT ")", (intptr_t) r, (intptr_t) r)); |
1113 return r; | 1095 return r; |
1114 } | 1096 } |
1115 | 1097 |
1116 | 1098 |
1117 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const { | 1099 oop* frame::oopmapreg_to_location(VMReg reg, const RegisterMap* reg_map) const { |
1427 // For now just label the frame | 1409 // For now just label the frame |
1428 nmethod* nm = cb()->as_nmethod_or_null(); | 1410 nmethod* nm = cb()->as_nmethod_or_null(); |
1429 values.describe(-1, info_address, | 1411 values.describe(-1, info_address, |
1430 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, | 1412 FormatBuffer<1024>("#%d nmethod " INTPTR_FORMAT " for native method %s", frame_no, |
1431 nm, nm->method()->name_and_sig_as_C_string()), 2); | 1413 nm, nm->method()->name_and_sig_as_C_string()), 2); |
1432 } else if (is_ricochet_frame()) { | |
1433 values.describe(-1, info_address, err_msg("#%d ricochet frame", frame_no), 2); | |
1434 } else { | 1414 } else { |
1435 // provide default info if not handled before | 1415 // provide default info if not handled before |
1436 char *info = (char *) "special frame"; | 1416 char *info = (char *) "special frame"; |
1437 if ((_cb != NULL) && | 1417 if ((_cb != NULL) && |
1438 (_cb->name() != NULL)) { | 1418 (_cb->name() != NULL)) { |