Skip to content

Commit 2ca492d

Browse files
fandreuzPaul Hohensee
authored andcommitted
8357822: C2: Multiple string optimization tests are no longer testing string concatenation optimizations
Backport-of: 6c616c71ec9a8ee6e0203921deef20d09db39698
1 parent 885510d commit 2ca492d

File tree

6 files changed

+86
-5
lines changed

6 files changed

+86
-5
lines changed

test/hotspot/jtreg/compiler/c2/Test7046096.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,6 +30,18 @@
3030
* compiler.c2.Test7046096
3131
*/
3232

33+
34+
/*
35+
* @test id=stringConcatInline
36+
* @bug 7046096 8357822
37+
* @summary The same test with an updated compile directive that produces
38+
* StringBuilder-backed string concatenations.
39+
*
40+
* @compile -XDstringConcat=inline Test7046096.java
41+
* @run main/othervm -Xbatch compiler.c2.Test7046096
42+
*/
43+
44+
3345
package compiler.c2;
3446

3547
public class Test7046096 {

test/hotspot/jtreg/compiler/c2/Test7179138_2.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
23
* Copyright 2012 Skip Balk. All Rights Reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
@@ -32,6 +33,18 @@
3233
* @author Skip Balk
3334
*/
3435

36+
37+
/*
38+
* @test id=stringConcatInline
39+
* @bug 7179138
40+
* @summary The same test with an updated compile directive that produces
41+
* StringBuilder-backed string concatenations.
42+
*
43+
* @compile -XDstringConcat=inline Test7179138_2.java
44+
* @run main/othervm -Xbatch -XX:-TieredCompilation compiler.c2.Test7179138_2
45+
*/
46+
47+
3548
package compiler.c2;
3649

3750
public class Test7179138_2 {

test/hotspot/jtreg/vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_disabled/TestDescription.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,3 +33,17 @@
3333
* @run main/othervm -XX:-CompactStrings vm.compiler.optimizations.stringconcat.implicit.Implicit01
3434
*/
3535

36+
37+
/*
38+
* @test id=stringConcatInline
39+
*
40+
* @summary The same test with an updated compile directive that produces
41+
* StringBuilder-backed string concatenations.
42+
* VM Testbase keywords: [jit, quick]
43+
*
44+
* @library /vmTestbase
45+
* /test/lib
46+
* @compile -XDstringConcat=inline ../../Implicit01.java
47+
* @run main/othervm -XX:-CompactStrings vm.compiler.optimizations.stringconcat.implicit.Implicit01
48+
*/
49+

test/hotspot/jtreg/vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_enabled/TestDescription.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,3 +33,17 @@
3333
* @run main/othervm -XX:+CompactStrings vm.compiler.optimizations.stringconcat.implicit.Implicit01
3434
*/
3535

36+
37+
/*
38+
* @test id=stringConcatInline
39+
*
40+
* @summary The same test with an updated compile directive that produces
41+
* StringBuilder-backed string concatenations.
42+
* VM Testbase keywords: [jit, quick]
43+
*
44+
* @library /vmTestbase
45+
* /test/lib
46+
* @compile -XDstringConcat=inline ../../Implicit01.java
47+
* @run main/othervm -XX:+CompactStrings vm.compiler.optimizations.stringconcat.implicit.Implicit01
48+
*/
49+

test/hotspot/jtreg/vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_disabled/TestDescription.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,3 +33,17 @@
3333
* @run main/othervm -XX:-CompactStrings vm.compiler.optimizations.stringconcat.implicit.Merge01
3434
*/
3535

36+
37+
/*
38+
* @test id=stringConcatInline
39+
*
40+
* @summary The same test with an updated compile directive that produces
41+
* StringBuilder-backed string concatenations.
42+
* VM Testbase keywords: [jit, quick]
43+
*
44+
* @library /vmTestbase
45+
* /test/lib
46+
* @compile -XDstringConcat=inline ../../Merge01.java
47+
* @run main/othervm -XX:-CompactStrings vm.compiler.optimizations.stringconcat.implicit.Merge01
48+
*/
49+

test/hotspot/jtreg/vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_enabled/TestDescription.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,3 +33,17 @@
3333
* @run main/othervm -XX:+CompactStrings vm.compiler.optimizations.stringconcat.implicit.Merge01
3434
*/
3535

36+
37+
/*
38+
* @test id=stringConcatInline
39+
*
40+
* @summary The same test with an updated compile directive that produces
41+
* StringBuilder-backed string concatenations.
42+
* VM Testbase keywords: [jit, quick]
43+
*
44+
* @library /vmTestbase
45+
* /test/lib
46+
* @compile -XDstringConcat=inline ../../Merge01.java
47+
* @run main/othervm -XX:+CompactStrings vm.compiler.optimizations.stringconcat.implicit.Merge01
48+
*/
49+

0 commit comments

Comments
 (0)