Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/hotspot/jtreg/ProblemList-Xcomp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,4 @@ vmTestbase/nsk/jvmti/scenarios/capability/CM03/cm03t001/TestDescription.java 829

vmTestbase/nsk/stress/thread/thread006.java 8321476 linux-all

compiler/cha/TypeProfileFinalMethod.java 8341039 generic-all

gc/arguments/TestNewSizeFlags.java 8299116 macosx-aarch64
32 changes: 16 additions & 16 deletions test/hotspot/jtreg/compiler/cha/TypeProfileFinalMethod.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2024, Alibaba Group Holding Limited. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand All @@ -25,7 +25,7 @@
/*
* @test
* @summary test c1 to record type profile with CHA optimization
* @requires vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4)
* @requires vm.flavor == "server" & vm.flagless
* @library /test/lib
* @build jdk.test.whitebox.WhiteBox
* @run driver jdk.test.lib.helpers.ClassFileInstaller jdk.test.whitebox.WhiteBox
Expand All @@ -48,6 +48,7 @@ public static void main(String[] args) throws Exception {
"-Xbatch", "-XX:-UseOnStackReplacement",
"-XX:+UnlockDiagnosticVMOptions", "-XX:+WhiteBoxAPI",
"-XX:Tier3InvocationThreshold=200", "-XX:Tier4InvocationThreshold=5000",
"-XX:CompileCommand=CompileOnly," + Launcher.class.getName() + "::test*",
Launcher.class.getName());
OutputAnalyzer output = ProcessTools.executeProcess(pb);
System.out.println("debug output");
Expand All @@ -61,7 +62,7 @@ public static void main(String[] args) throws Exception {
while (matcher.find()) {
matchCnt++;
}
Asserts.assertEquals(matchCnt, 2); // inline Child1::m() twice
Asserts.assertEquals(2, matchCnt); // inline Child1::m() twice
}

static class Launcher {
Expand All @@ -86,23 +87,22 @@ public static void main(String[] args) throws Exception {

static void addCompilerDirectives() {
WhiteBox WB = WhiteBox.getWhiteBox();
// do not inline getInstance() for test1() and test2()
// Directive for test1
String directive = "[{ match: [\"" + Launcher.class.getName() + "::test1\"]," +
"inline:[\"-" + Launcher.class.getName()+"::getInstance()\"] }]";
// Do not inline getInstance
"inline:[\"-" + Launcher.class.getName()+"::getInstance\"] }]";
WB.addCompilerDirective(directive);

// Directive for test2
directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," +
"inline:[\"-" + Launcher.class.getName()+"::getInstance()\"] }]";
WB.addCompilerDirective(directive);

// do not inline test1() for test2() in c1 compilation
directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," +
"c1: { inline:[\"-" + Launcher.class.getName()+"::test1()\"] } }]";
WB.addCompilerDirective(directive);

// print inline tree for checking
directive = "[{ match: [\"" + Launcher.class.getName() + "::test2\"]," +
"c2: { PrintInlining: true } }]";
// Do not inline getInstance
"inline:[\"-" + Launcher.class.getName()+"::getInstance\"]," +
// Do not inline test1 in C1 compilation
"c1: { inline:[\"-" + Launcher.class.getName()+"::test1\"] }," +
// Make sure to inline test1 in C2 compilation
"c2: { inline:[\"+" + Launcher.class.getName()+"::test1\"]," +
" PrintInlining:true }" +
"}]";
WB.addCompilerDirective(directive);
}

Expand Down