--- old/src/share/vm/runtime/frame.cpp 2019-02-15 19:02:40.282733594 +0300 +++ new/src/share/vm/runtime/frame.cpp 2019-02-15 19:02:40.142738485 +0300 @@ -239,6 +239,19 @@ return NULL; } +bool frame::is_entry_frame_valid(JavaThread* thread) const { + // Validate the JavaCallWrapper an entry frame must have + address jcw = (address)entry_frame_call_wrapper(); + bool jcw_safe = (jcw < thread->stack_base()) && (jcw > (address)fp()); // less than stack base + if (!jcw_safe) { + return false; + } + + // Validate sp saved in the java frame anchor + JavaFrameAnchor* jfa = entry_frame_call_wrapper()->anchor(); + return (jfa->last_Java_sp() > sp()); +} + bool frame::should_be_deoptimized() const { if (_deopt_state == is_deoptimized || !is_compiled_frame() ) return false;