--- old/src/hotspot/cpu/x86/frame_x86.cpp 2020-02-11 20:31:10.592718300 -0500 +++ new/src/hotspot/cpu/x86/frame_x86.cpp 2020-02-11 20:31:09.475705929 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,16 +57,8 @@ address unextended_sp = (address)_unextended_sp; // consider stack guards when trying to determine "safe" stack pointers - static size_t stack_guard_size = os::uses_stack_guard_pages() ? - JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_zone_size() : 0; - size_t usable_stack_size = thread->stack_size() - stack_guard_size; - // sp must be within the usable part of the stack (not in guards) - bool sp_safe = (sp < thread->stack_base()) && - (sp >= thread->stack_base() - usable_stack_size); - - - if (!sp_safe) { + if (!thread->is_in_usable_stack(sp)) { return false; } @@ -553,7 +545,7 @@ address locals = (address) *interpreter_frame_locals_addr(); - if (locals > thread->stack_base() || locals < (address) fp()) return false; + 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;