208 return s.is_first_frame(); 209 } 210 211 212 bool frame::entry_frame_is_first() const { 213 return entry_frame_call_wrapper()->is_first_frame(); 214 } 215 216 JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const { 217 JavaCallWrapper** jcw = entry_frame_call_wrapper_addr(); 218 address addr = (address) jcw; 219 220 // addr must be within the usable part of the stack 221 if (thread->is_in_usable_stack(addr)) { 222 return *jcw; 223 } 224 225 return NULL; 226 } 227 228 bool frame::should_be_deoptimized() const { 229 if (_deopt_state == is_deoptimized || 230 !is_compiled_frame() ) return false; 231 assert(_cb != NULL && _cb->is_compiled(), "must be an nmethod"); 232 CompiledMethod* nm = (CompiledMethod *)_cb; 233 if (TraceDependencies) { 234 tty->print("checking (%s) ", nm->is_marked_for_deoptimization() ? "true" : "false"); 235 nm->print_value_on(tty); 236 tty->cr(); 237 } 238 239 if( !nm->is_marked_for_deoptimization() ) 240 return false; 241 242 // If at the return point, then the frame has already been popped, and 243 // only the return needs to be executed. Don't deoptimize here. 244 return !nm->is_at_poll_return(pc()); 245 } 246 247 bool frame::can_be_deoptimized() const { | 208 return s.is_first_frame(); 209 } 210 211 212 bool frame::entry_frame_is_first() const { 213 return entry_frame_call_wrapper()->is_first_frame(); 214 } 215 216 JavaCallWrapper* frame::entry_frame_call_wrapper_if_safe(JavaThread* thread) const { 217 JavaCallWrapper** jcw = entry_frame_call_wrapper_addr(); 218 address addr = (address) jcw; 219 220 // addr must be within the usable part of the stack 221 if (thread->is_in_usable_stack(addr)) { 222 return *jcw; 223 } 224 225 return NULL; 226 } 227 228 bool frame::entry_frame_is_safe(JavaThread* thread) const { 229 // Validate the JavaCallWrapper an entry frame must have 230 address jcw = (address)entry_frame_call_wrapper(); 231 bool jcw_safe = (jcw <= thread->stack_base()) && (jcw > (address)fp()); 232 if (!jcw_safe) { 233 return false; 234 } 235 236 // Validate sp saved in the java frame anchor 237 JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); 238 return (jfa->last_Java_sp() > sp()); 239 } 240 241 bool frame::should_be_deoptimized() const { 242 if (_deopt_state == is_deoptimized || 243 !is_compiled_frame() ) return false; 244 assert(_cb != NULL && _cb->is_compiled(), "must be an nmethod"); 245 CompiledMethod* nm = (CompiledMethod *)_cb; 246 if (TraceDependencies) { 247 tty->print("checking (%s) ", nm->is_marked_for_deoptimization() ? "true" : "false"); 248 nm->print_value_on(tty); 249 tty->cr(); 250 } 251 252 if( !nm->is_marked_for_deoptimization() ) 253 return false; 254 255 // If at the return point, then the frame has already been popped, and 256 // only the return needs to be executed. Don't deoptimize here. 257 return !nm->is_at_poll_return(pc()); 258 } 259 260 bool frame::can_be_deoptimized() const { |