222 return s.is_first_frame(); 223 } 224 225 226 bool frame::entry_frame_is_first() const { 227 return entry_frame_call_wrapper()->is_first_frame(); 228 } 229 230 JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const { 231 JavaCallWrapper** jcw = entry_frame_call_wrapper_addr(); 232 address addr = (address) jcw; 233 234 // addr must be within the usable part of the stack 235 if (thread->is_in_usable_stack(addr)) { 236 return *jcw; 237 } 238 239 return NULL; 240 } 241 242 bool frame::should_be_deoptimized() const { 243 if (_deopt_state == is_deoptimized || 244 !is_compiled_frame() ) return false; 245 assert(_cb != NULL && _cb->is_nmethod(), "must be an nmethod"); 246 nmethod* nm = (nmethod *)_cb; 247 if (TraceDependencies) { 248 tty->print("checking (%s) ", nm->is_marked_for_deoptimization() ? "true" : "false"); 249 nm->print_value_on(tty); 250 tty->cr(); 251 } 252 253 if( !nm->is_marked_for_deoptimization() ) 254 return false; 255 256 // If at the return point, then the frame has already been popped, and 257 // only the return needs to be executed. Don't deoptimize here. 258 return !nm->is_at_poll_return(pc()); 259 } 260 261 bool frame::can_be_deoptimized() const { | 222 return s.is_first_frame(); 223 } 224 225 226 bool frame::entry_frame_is_first() const { 227 return entry_frame_call_wrapper()->is_first_frame(); 228 } 229 230 JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const { 231 JavaCallWrapper** jcw = entry_frame_call_wrapper_addr(); 232 address addr = (address) jcw; 233 234 // addr must be within the usable part of the stack 235 if (thread->is_in_usable_stack(addr)) { 236 return *jcw; 237 } 238 239 return NULL; 240 } 241 242 bool frame::is_entry_frame_valid(JavaThread* thread) const { 243 // Validate the JavaCallWrapper an entry frame must have 244 address jcw = (address)entry_frame_call_wrapper(); 245 bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)fp()); // less than stack base 246 if (!jcw_safe) { 247 return false; 248 } 249 250 // Validate sp saved in the java frame anchor 251 JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); 252 return (jfa->last_Java_sp() > sp()); 253 } 254 255 bool frame::should_be_deoptimized() const { 256 if (_deopt_state == is_deoptimized || 257 !is_compiled_frame() ) return false; 258 assert(_cb != NULL && _cb->is_nmethod(), "must be an nmethod"); 259 nmethod* nm = (nmethod *)_cb; 260 if (TraceDependencies) { 261 tty->print("checking (%s) ", nm->is_marked_for_deoptimization() ? "true" : "false"); 262 nm->print_value_on(tty); 263 tty->cr(); 264 } 265 266 if( !nm->is_marked_for_deoptimization() ) 267 return false; 268 269 // If at the return point, then the frame has already been popped, and 270 // only the return needs to be executed. Don't deoptimize here. 271 return !nm->is_at_poll_return(pc()); 272 } 273 274 bool frame::can_be_deoptimized() const { |