Mercurial > hg > truffle
comparison src/cpu/x86/vm/frame_x86.inline.hpp @ 107:93b6525e3b82
6603919: Stackwalking crash on x86 -server with Sun Studio's collect -j on
Summary: Rewrite frame::safe_for_sender and friends to be safe for collector/analyzer
Reviewed-by: dcubed, kvn
author | sgoldman |
---|---|
date | Tue, 08 Apr 2008 12:23:15 -0400 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
106:c9314fa4f757 | 107:93b6525e3b82 |
---|---|
70 inline frame::frame(intptr_t* sp, intptr_t* fp) { | 70 inline frame::frame(intptr_t* sp, intptr_t* fp) { |
71 _sp = sp; | 71 _sp = sp; |
72 _unextended_sp = sp; | 72 _unextended_sp = sp; |
73 _fp = fp; | 73 _fp = fp; |
74 _pc = (address)(sp[-1]); | 74 _pc = (address)(sp[-1]); |
75 assert(_pc != NULL, "no pc?"); | 75 |
76 // Here's a sticky one. This constructor can be called via AsyncGetCallTrace | |
77 // when last_Java_sp is non-null but the pc fetched is junk. If we are truly | |
78 // unlucky the junk value could be to a zombied method and we'll die on the | |
79 // find_blob call. This is also why we can have no asserts on the validity | |
80 // of the pc we find here. AsyncGetCallTrace -> pd_get_top_frame_for_signal_handler | |
81 // -> pd_last_frame should use a specialized version of pd_last_frame which could | |
82 // call a specilaized frame constructor instead of this one. | |
83 // Then we could use the assert below. However this assert is of somewhat dubious | |
84 // value. | |
85 // assert(_pc != NULL, "no pc?"); | |
86 | |
76 _cb = CodeCache::find_blob(_pc); | 87 _cb = CodeCache::find_blob(_pc); |
77 // In case of native stubs, the pc retreived here might be | 88 |
78 // wrong. (the _last_native_pc will have the right value) | |
79 // So do not put add any asserts on the _pc here. | |
80 | |
81 // QQQ The above comment is wrong and has been wrong for years. This constructor | |
82 // should (and MUST) not be called in that situation. In the native situation | |
83 // the pc should be supplied to the constructor. | |
84 _deopt_state = not_deoptimized; | 89 _deopt_state = not_deoptimized; |
85 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { | 90 if (_cb != NULL && _cb->is_nmethod() && ((nmethod*)_cb)->is_deopt_pc(_pc)) { |
86 _pc = (((nmethod*)_cb)->get_original_pc(this)); | 91 _pc = (((nmethod*)_cb)->get_original_pc(this)); |
87 _deopt_state = is_deoptimized; | 92 _deopt_state = is_deoptimized; |
88 } else { | 93 } else { |