--- old/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2020-02-11 20:30:52.461517490 -0500 +++ new/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2020-02-11 20:30:51.328504941 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -59,16 +59,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; } @@ -566,7 +558,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;