< prev index next >
src/hotspot/cpu/sparc/frame_sparc.cpp
Print this page
rev 58073 : [mq]: v3
*** 183,200 ****
if (!thread->is_in_usable_stack(_SP)) {
return false;
}
// unextended sp must be within the stack and above or equal sp
! bool unextended_sp_safe = (_UNEXTENDED_SP < thread->stack_base()) &&
! (_UNEXTENDED_SP >= _SP);
!
! if (!unextended_sp_safe) return false;
// an fp must be within the stack and above (but not equal) sp
! bool fp_safe = (_FP < thread->stack_base()) &&
! (_FP > _SP);
// We know sp/unextended_sp are safe only fp is questionable here
// If the current frame is known to the code cache then we can attempt to
// to construct the sender and do some validation of it. This goes a long way
--- 183,198 ----
if (!thread->is_in_usable_stack(_SP)) {
return false;
}
// unextended sp must be within the stack and above or equal sp
! if (!thread->is_in_stack_range_incl(_UNEXTENDED_SP, _SP)) {
! return false;
! }
// an fp must be within the stack and above (but not equal) sp
! bool fp_safe = thread->is_in_stack_range_excl(_FP, _SP);
// We know sp/unextended_sp are safe only fp is questionable here
// If the current frame is known to the code cache then we can attempt to
// to construct the sender and do some validation of it. This goes a long way
*** 249,262 ****
// Do we have a valid fp?
address sender_fp = (address) sender.fp();
// an fp must be within the stack and above (but not equal) current frame's _FP
! bool sender_fp_safe = (sender_fp < thread->stack_base()) &&
! (sender_fp > _FP);
!
! if (!sender_fp_safe) {
return false;
}
// If the potential sender is the interpreter then we can do some more checking
--- 247,257 ----
// Do we have a valid fp?
address sender_fp = (address) sender.fp();
// an fp must be within the stack and above (but not equal) current frame's _FP
! if (!thread->is_in_stack_range_excl(sender_fp, _FP)) {
return false;
}
// If the potential sender is the interpreter then we can do some more checking
*** 274,289 ****
return false;
}
if (sender.is_entry_frame()) {
// Validate the JavaCallWrapper an entry frame must have
-
address jcw = (address)sender.entry_frame_call_wrapper();
! bool jcw_safe = (jcw < thread->stack_base()) && (jcw > sender_fp);
!
! return jcw_safe;
}
// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
// because you must allocate window space
--- 269,281 ----
return false;
}
if (sender.is_entry_frame()) {
// Validate the JavaCallWrapper an entry frame must have
address jcw = (address)sender.entry_frame_call_wrapper();
! return thread->is_in_stack_range_excl(jcw, sender_fp);
}
// If the frame size is 0 something (or less) is bad because every nmethod has a non-zero frame size
// because you must allocate window space
*** 668,682 ****
if (MetaspaceObj::is_valid(cp) == false) return false;
// validate locals
address locals = (address) *interpreter_frame_locals_addr();
!
! if (locals >= thread->stack_base() || locals < (address) fp()) return false;
!
! // We'd have to be pretty unlucky to be mislead at this point
! return true;
}
// Windows have been flushed on entry (but not marked). Capture the pc that
// is the return address to the frame that contains "sp" as its stack pointer.
--- 660,670 ----
if (MetaspaceObj::is_valid(cp) == false) return false;
// validate locals
address locals = (address) *interpreter_frame_locals_addr();
! return thread->is_in_stack_range_incl(locals, (address)fp());
}
// Windows have been flushed on entry (but not marked). Capture the pc that
// is the return address to the frame that contains "sp" as its stack pointer.
< prev index next >