From dac06a329a834678c45b7cd60002704edb6f0d82 Mon Sep 17 00:00:00 2001 From: Andrew Haley Date: Tue, 21 Apr 2026 15:22:16 +0000 Subject: [PATCH] 8359166: C2 asserts in Assembler::addr_nop_5 with -XX:-UseAddressNop Reviewed-by: aseoane, qamai --- src/hotspot/cpu/x86/x86.ad | 2 +- test/hotspot/jtreg/runtime/8359166/Test.java | 39 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 test/hotspot/jtreg/runtime/8359166/Test.java diff --git a/src/hotspot/cpu/x86/x86.ad b/src/hotspot/cpu/x86/x86.ad index eaa88d900c7..9b80697601c 100644 --- a/src/hotspot/cpu/x86/x86.ad +++ b/src/hotspot/cpu/x86/x86.ad @@ -4568,7 +4568,7 @@ encode %{ } else if (_method->intrinsic_id() == vmIntrinsicID::_ensureMaterializedForStackWalk) { // The NOP here is purely to ensure that eliding a call to // JVM_EnsureMaterializedForStackWalk doesn't change the code size. - __ addr_nop_5(); + __ nop(5); __ block_comment("call JVM_EnsureMaterializedForStackWalk (elided)"); } else { int method_index = resolved_method_index(masm); diff --git a/test/hotspot/jtreg/runtime/8359166/Test.java b/test/hotspot/jtreg/runtime/8359166/Test.java new file mode 100644 index 00000000000..509a06a3de1 --- /dev/null +++ b/test/hotspot/jtreg/runtime/8359166/Test.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2026, IBM Corp. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8359166 + * @requires os.arch=="amd64" | os.arch=="x86_64" + * @requires vm.debug + * + * @run main/othervm + * -XX:-UseAddressNop -Xcomp -Xbatch -XX:-TieredCompilation Test + */ + +public class Test { + public static void main(String[] args) { + + } +}