-
Notifications
You must be signed in to change notification settings - Fork 168
8381531: [lworld] Startup performance regression with Valhalla caused by Method::link_method #2357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
matias9927
wants to merge
13
commits into
openjdk:lworld
Choose a base branch
from
matias9927:sig_cc_8381531
base: lworld
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5483660
Inherit calling conventions from super
matias9927 41c2562
Cleanup
matias9927 10e916c
Merge branch 'lworld' into sig_cc_8381531
matias9927 b3ec737
Moved cc inheritance out of compute_calling_conventions
matias9927 1c165e3
Cleanup
matias9927 0000954
Merge branch 'lworld' into sig_cc_8381531
matias9927 0263d54
Fixed interface method comparison
matias9927 051fc1d
Added test
matias9927 ecbf5eb
Cleanup
matias9927 fda2997
Changed loggging
matias9927 ade2006
Merge branch 'lworld' into sig_cc_8381531
matias9927 2fc1553
Added test case
matias9927 b6ca17a
Test cleanup and copyright
matias9927 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| /* | ||
| * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. | ||
| * 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. | ||
| */ | ||
|
|
||
| class A { | ||
| 0xCAFEBABE; | ||
| 65535; // minor version | ||
| 71; // version | ||
| [] { // Constant Pool | ||
| ; // first element is empty | ||
| Method #2 #3; // #1 | ||
| Class #4; // #2 | ||
| NameAndType #5 #6; // #3 | ||
| Utf8 "java/lang/Object"; // #4 | ||
| Utf8 "<init>"; // #5 | ||
| Utf8 "()V"; // #6 | ||
| Class #8; // #7 | ||
| Utf8 "A"; // #8 | ||
| Class #10; // #9 | ||
| Utf8 "I"; // #10 | ||
| Utf8 "Code"; // #11 | ||
| Utf8 "LineNumberTable"; // #12 | ||
| Utf8 "foo"; // #13 | ||
| Utf8 "(LPoint;)V"; // #14 | ||
| Utf8 "SourceFile"; // #15 | ||
| Utf8 "SigTest.java"; // #16 | ||
| Utf8 "LoadableDescriptors"; // #17 | ||
| Utf8 "LPoint;"; // #18 | ||
| } | ||
|
|
||
| 0x0020; // access | ||
| #7; // this_cpx | ||
| #2; // super_cpx | ||
|
|
||
| [] { // Interfaces | ||
| #9; | ||
| } // end of Interfaces | ||
|
|
||
| [] { // Fields | ||
| } // end of Fields | ||
|
|
||
| [] { // Methods | ||
| { // method | ||
| 0x0000; // access | ||
| #5; // name_index | ||
| #6; // descriptor_index | ||
| [] { // Attributes | ||
| Attr(#11) { // Code | ||
| 1; // max_stack | ||
| 1; // max_locals | ||
| Bytes[]{ | ||
| 0x2A 0xB7 0x00 0x01 0xB1; | ||
| } | ||
| [] { // Traps | ||
| } // end of Traps | ||
| [] { // Attributes | ||
| Attr(#12) { // LineNumberTable | ||
| [] { // line_number_table | ||
| 0 35; | ||
| } | ||
| } // end of LineNumberTable | ||
| } // end of Attributes | ||
| } // end of Code | ||
| } // end of Attributes | ||
| } | ||
| ; | ||
| { // method | ||
| 0x0001; // access | ||
| #13; // name_index | ||
| #14; // descriptor_index | ||
| [] { // Attributes | ||
| Attr(#11) { // Code | ||
| 0; // max_stack | ||
| 2; // max_locals | ||
| Bytes[]{ | ||
| 0xB1; | ||
| } | ||
| [] { // Traps | ||
| } // end of Traps | ||
| [] { // Attributes | ||
| Attr(#12) { // LineNumberTable | ||
| [] { // line_number_table | ||
| 0 36; | ||
| } | ||
| } // end of LineNumberTable | ||
| } // end of Attributes | ||
| } // end of Code | ||
| } // end of Attributes | ||
| } | ||
| } // end of Methods | ||
|
|
||
| [] { // Attributes | ||
| Attr(#15) { // SourceFile | ||
| #16; | ||
| } // end of SourceFile | ||
| ; | ||
| Attr(#17) { // LoadableDescriptors | ||
| [] { // Utf8 | ||
| // Removed LPoint | ||
| } | ||
| } // end of LoadableDescriptors | ||
| } // end of Attributes | ||
| } |
78 changes: 78 additions & 0 deletions
78
test/hotspot/jtreg/runtime/valhalla/inlinetypes/AdapterInheritanceApp.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| /* | ||
| * Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. | ||
| * 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. | ||
| */ | ||
|
|
||
| public class AdapterInheritanceApp { | ||
| public static void main(String[] args) { | ||
| A a = new A(); | ||
| B b = new B(); | ||
| C c = new C(); | ||
|
|
||
| for (int i = 0; i < 100000; i++) { | ||
| // A.foo() should be non-scalarized because Point is not present in the | ||
| // LoadableDescriptors attribute for either class A or interface I | ||
| a.foo(new Point(0, 0)); | ||
|
|
||
| // B.foo() will inherit the adapter from A.foo() and will also be non-scalarized. | ||
| b.foo(new Point(0, 1)); | ||
|
|
||
| // C.foo() will try to inherit the non-scalarizeda dapter from B.foo() but it | ||
| // will run into a mismatch when checking J.foo() which has scalarized calling | ||
| // conventions for foo(). The calling conventions must then be recalculated. | ||
| c.foo(new Point(1, 0)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| value class Point { | ||
| int x; | ||
| int y; | ||
|
|
||
| Point(int x, int y) { | ||
| this.x = x; | ||
| this.y = y; | ||
| } | ||
| } | ||
|
|
||
| // For this test, these classes are derived from JCOD files which remove Point | ||
| // from the LoadableDescriptors attribute so that Point will not be loaded when | ||
| // trying to link foo() | ||
| // | ||
| // interface I { | ||
| // void foo(Point i); | ||
| // } | ||
|
|
||
| // class A implements I { | ||
| // void foo(Point i) {} | ||
| // } | ||
|
|
||
| interface J { | ||
| void foo(Point i); | ||
| } | ||
|
|
||
| class B extends A { | ||
| public void foo(Point i) {} | ||
| } | ||
|
|
||
| class C extends B implements J { | ||
| public void foo(Point i) {} | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we wrap this in a
if (!method->is_static()) {...}block?