52
53 bool frame::safe_for_sender(JavaThread *thread) {
54 address sp = (address)_sp;
55 address fp = (address)_fp;
56 address unextended_sp = (address)_unextended_sp;
57
58 static size_t stack_guard_size = os::uses_stack_guard_pages() ?
59 (JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size()) : 0;
60 size_t usable_stack_size = thread->stack_size() - stack_guard_size;
61
62 // sp must be within the usable part of the stack (not in guards)
63 bool sp_safe = (sp != NULL &&
64 (sp <= thread->stack_base()) &&
65 (sp >= thread->stack_base() - usable_stack_size));
66
67 if (!sp_safe) {
68 return false;
69 }
70
71 bool unextended_sp_safe = (unextended_sp != NULL &&
72 (unextended_sp <= thread->stack_base()) &&
73 (unextended_sp >= sp));
74 if (!unextended_sp_safe) {
75 return false;
76 }
77
78 // We know sp/unextended_sp are safe. Only fp is questionable here.
79
80 bool fp_safe = (fp != NULL &&
81 (fp <= thread->stack_base()) &&
82 fp >= sp);
83
84 if (_cb != NULL ) {
85
86 // First check if frame is complete and tester is reliable
87 // Unfortunately we can only check frame complete for runtime stubs and nmethod
88 // other generic buffer blobs are more problematic so we just assume they are
89 // ok. adapter blobs never have a frame complete and are never ok.
90
91 if (!_cb->is_frame_complete_at(_pc)) {
92 if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
93 return false;
|
52
53 bool frame::safe_for_sender(JavaThread *thread) {
54 address sp = (address)_sp;
55 address fp = (address)_fp;
56 address unextended_sp = (address)_unextended_sp;
57
58 static size_t stack_guard_size = os::uses_stack_guard_pages() ?
59 (JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size()) : 0;
60 size_t usable_stack_size = thread->stack_size() - stack_guard_size;
61
62 // sp must be within the usable part of the stack (not in guards)
63 bool sp_safe = (sp != NULL &&
64 (sp <= thread->stack_base()) &&
65 (sp >= thread->stack_base() - usable_stack_size));
66
67 if (!sp_safe) {
68 return false;
69 }
70
71 bool unextended_sp_safe = (unextended_sp != NULL &&
72 (unextended_sp <= thread->stack_base()));
73 if (!unextended_sp_safe) {
74 return false;
75 }
76
77 // We know sp/unextended_sp are safe. Only fp is questionable here.
78
79 bool fp_safe = (fp != NULL &&
80 (fp <= thread->stack_base()) &&
81 fp >= sp);
82
83 if (_cb != NULL ) {
84
85 // First check if frame is complete and tester is reliable
86 // Unfortunately we can only check frame complete for runtime stubs and nmethod
87 // other generic buffer blobs are more problematic so we just assume they are
88 // ok. adapter blobs never have a frame complete and are never ok.
89
90 if (!_cb->is_frame_complete_at(_pc)) {
91 if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) {
92 return false;
|