--- old/src/hotspot/cpu/s390/frame_s390.cpp 2020-02-11 20:31:03.347638058 -0500 +++ new/src/hotspot/cpu/s390/frame_s390.cpp 2020-02-11 20:31:02.168625000 -0500 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016, 2019, SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -59,17 +59,9 @@ address fp = (address)_fp; 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_reserved_zone_size() : 0; - size_t usable_stack_size = thread->stack_size() - stack_guard_size; - + // consider stack guards when trying to determine "safe" stack pointers // 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; } @@ -81,10 +73,10 @@ } // An fp must be within the stack and above (but not equal) sp. - bool fp_safe = (fp <= thread->stack_base()) && (fp > sp); + bool fp_safe = (fp < thread->stack_base()) && (fp > sp); // An interpreter fp must be within the stack and above (but not equal) sp. // Moreover, it must be at least the size of the z_ijava_state structure. - bool fp_interp_safe = (fp <= thread->stack_base()) && (fp > sp) && + bool fp_interp_safe = (fp < thread->stack_base()) && (fp > sp) && ((fp - sp) >= z_ijava_state_size); // We know sp/unextended_sp are safe, only fp is questionable here @@ -144,7 +136,7 @@ // sender_fp must be within the stack and above (but not // equal) current frame's fp. - if (sender_fp > thread->stack_base() || sender_fp <= fp) { + if (sender_fp >= thread->stack_base() || sender_fp <= fp) { return false; }