167 } 168 } 169 170 _location_valid[0] = lv; 171 check_location_valid(); 172 } 173 174 bool frame::safe_for_sender(JavaThread *thread) { 175 176 address _SP = (address) sp(); 177 address _FP = (address) fp(); 178 address _UNEXTENDED_SP = (address) unextended_sp(); 179 // sp must be within the stack 180 bool sp_safe = (_SP <= thread->stack_base()) && 181 (_SP >= thread->stack_base() - thread->stack_size()); 182 183 if (!sp_safe) { 184 return false; 185 } 186 187 // unextended sp must be within the stack and above or equal sp 188 bool unextended_sp_safe = (_UNEXTENDED_SP <= thread->stack_base()) && 189 (_UNEXTENDED_SP >= _SP); 190 191 if (!unextended_sp_safe) return false; 192 193 // an fp must be within the stack and above (but not equal) sp 194 bool fp_safe = (_FP <= thread->stack_base()) && 195 (_FP > _SP); 196 197 // We know sp/unextended_sp are safe only fp is questionable here 198 199 // If the current frame is known to the code cache then we can attempt to 200 // to construct the sender and do some validation of it. This goes a long way 201 // toward eliminating issues when we get in frame construction code 202 203 if (_cb != NULL ) { 204 205 // First check if frame is complete and tester is reliable 206 // Unfortunately we can only check frame complete for runtime stubs and nmethod 207 // other generic buffer blobs are more problematic so we just assume they are 208 // ok. adapter blobs never have a frame complete and are never ok. 209 | 167 } 168 } 169 170 _location_valid[0] = lv; 171 check_location_valid(); 172 } 173 174 bool frame::safe_for_sender(JavaThread *thread) { 175 176 address _SP = (address) sp(); 177 address _FP = (address) fp(); 178 address _UNEXTENDED_SP = (address) unextended_sp(); 179 // sp must be within the stack 180 bool sp_safe = (_SP <= thread->stack_base()) && 181 (_SP >= thread->stack_base() - thread->stack_size()); 182 183 if (!sp_safe) { 184 return false; 185 } 186 187 // unextended sp must be within the stack 188 bool unextended_sp_safe = (_UNEXTENDED_SP <= thread->stack_base()); 189 190 if (!unextended_sp_safe) return false; 191 192 // an fp must be within the stack and above (but not equal) sp 193 bool fp_safe = (_FP <= thread->stack_base()) && 194 (_FP > _SP); 195 196 // We know sp/unextended_sp are safe only fp is questionable here 197 198 // If the current frame is known to the code cache then we can attempt to 199 // to construct the sender and do some validation of it. This goes a long way 200 // toward eliminating issues when we get in frame construction code 201 202 if (_cb != NULL ) { 203 204 // First check if frame is complete and tester is reliable 205 // Unfortunately we can only check frame complete for runtime stubs and nmethod 206 // other generic buffer blobs are more problematic so we just assume they are 207 // ok. adapter blobs never have a frame complete and are never ok. 208 |