From qamai at openjdk.org Fri Aug 1 09:52:33 2025 From: qamai at openjdk.org (Quan Anh Mai) Date: Fri, 1 Aug 2025 09:52:33 GMT Subject: [lworld] RFR: 8364191: [lworld] Accesses to atomic flat fields prevent scalar replacement [v2] In-Reply-To: References: Message-ID: <9AdjPfcMo_PPTNaDqRyBBQXsJbmdjeRwS5LzPda_wkY=.7f7b838b-cdcd-4bcb-83d5-2fe6e9496455@github.com> > Hi, > > Flat accesses prevent scalar replacement because they are mismatched accesses. It is also generally not possible to look through them, because the payload may contain an oop in the form of raw bits. As a result, this PR adds `LoadFlatNode` and `StoreFlatNode`, which act as high-level abstractions for atomic accesses on flat fields. When it is determined that there is no racing access on the flat field (e.g. because the holder object does not escape), these flat access nodes can be expanded into multiple accesses to each flattened fields, otherwise, they will be expanded into a sequence of inferring a payload and accessing memory with that payload. > > I also fix an issue with deoptimization reallocation where we miss assigning the null marker of elements in a nullable flat array. > > Please take a look and leave your reviews, thanks a lot. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: small fix StoreFlatNode::size_of ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1518/files - new: https://git.openjdk.org/valhalla/pull/1518/files/23828cc7..428b656c Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1518&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1518&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1518.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1518/head:pull/1518 PR: https://git.openjdk.org/valhalla/pull/1518 From coleenp at openjdk.org Fri Aug 1 15:22:36 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Fri, 1 Aug 2025 15:22:36 GMT Subject: [lworld] RFR: [lworld] Remove redundant DTraceAlloc/Method probes Message-ID: <6YdvMt4v6E_bxLcdjK3toUTUUnCSOQvANFGEVo7tzS4=.d43baad8-eedf-4fd5-a4d8-9477bb085249@github.com> Looking through this code, I found this discrepancy. Tested with some tier1 testing. ------------- Commit messages: - Remove redundant DTraceAlloc/Method probes. Changes: https://git.openjdk.org/valhalla/pull/1521/files Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1521&range=00 Stats: 20 lines in 5 files changed: 0 ins; 17 del; 3 mod Patch: https://git.openjdk.org/valhalla/pull/1521.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1521/head:pull/1521 PR: https://git.openjdk.org/valhalla/pull/1521 From thartmann at openjdk.org Mon Aug 4 19:45:35 2025 From: thartmann at openjdk.org (Tobias Hartmann) Date: Mon, 4 Aug 2025 19:45:35 GMT Subject: [lworld] RFR: 8364191: [lworld] Accesses to atomic flat fields prevent scalar replacement [v2] In-Reply-To: <9AdjPfcMo_PPTNaDqRyBBQXsJbmdjeRwS5LzPda_wkY=.7f7b838b-cdcd-4bcb-83d5-2fe6e9496455@github.com> References: <9AdjPfcMo_PPTNaDqRyBBQXsJbmdjeRwS5LzPda_wkY=.7f7b838b-cdcd-4bcb-83d5-2fe6e9496455@github.com> Message-ID: On Fri, 1 Aug 2025 09:52:33 GMT, Quan Anh Mai wrote: >> Hi, >> >> Flat accesses prevent scalar replacement because they are mismatched accesses. It is also generally not possible to look through them, because the payload may contain an oop in the form of raw bits. As a result, this PR adds `LoadFlatNode` and `StoreFlatNode`, which act as high-level abstractions for atomic accesses on flat fields. When it is determined that there is no racing access on the flat field (e.g. because the holder object does not escape), these flat access nodes can be expanded into multiple accesses to each flattened fields, otherwise, they will be expanded into a sequence of inferring a payload and accessing memory with that payload. >> >> I also fix an issue with deoptimization reallocation where we miss assigning the null marker of elements in a nullable flat array. >> >> Please take a look and leave your reviews, thanks a lot. > > Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: > > small fix StoreFlatNode::size_of Thanks for working on this @merykitty! I haven't reviewed this in yet but noticed a build failure: [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp: In member function 'void ConnectionGraph::add_final_edges(Node*)': [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp:1874:25: error: no matching function for call to 'ConnectionGraph::set_escape_state(PointsToNode*&, PointsToNode::EscapeState, const char [24])' [2025-08-04T17:23:31,905Z] 1874 | set_escape_state(field_value_ptn, PointsToNode::GlobalEscape, "store into a flat field"); [2025-08-04T17:23:31,905Z] | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [2025-08-04T17:23:31,905Z] In file included from /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp:38: [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.hpp:434:8: note: candidate: 'void ConnectionGraph::set_escape_state(PointsToNode*, PointsToNode::EscapeState)' [2025-08-04T17:23:31,905Z] 434 | void set_escape_state(PointsToNode* ptn, PointsToNode::EscapeState esc [2025-08-04T17:23:31,905Z] | ^~~~~~~~~~~~~~~~ [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.hpp:434:8: note: candidate expects 2 arguments, 3 provided [2025-08-04T17:23:32,241Z] lib/CompileJvm.gmk:172: recipe for target '/opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/build/linux-x64/hotspot/variant-server/libjvm/objs/static/escape.o' failed [2025-08-04T17:23:32,241Z] make[3]: *** [/opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/build/linux-x64/hotspot/variant-server/libjvm/objs/static/escape.o] Error 1 ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1518#issuecomment-3152113964 From liach at openjdk.org Tue Aug 5 14:12:29 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 5 Aug 2025 14:12:29 GMT Subject: [lworld] RFR: 8360653: [lworld] LayoutIterationTest.java fails with -XX:ForceNonTearable=* In-Reply-To: References: Message-ID: <-OTFrD7SRDsEA7pZUTN6eCy_hXEUOGvgK0uE5OfWWDI=.04ea2be5-c820-4ae6-9c3f-64e348df474e@github.com> On Tue, 8 Jul 2025 00:37:38 GMT, Chen Liang wrote: > Mark this test as flagless so we will skip it with any layout perturbation. Guess people don't bother to review this. I will just integrate. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1505#issuecomment-3155390504 From liach at openjdk.org Tue Aug 5 14:12:29 2025 From: liach at openjdk.org (Chen Liang) Date: Tue, 5 Aug 2025 14:12:29 GMT Subject: [lworld] Integrated: 8360653: [lworld] LayoutIterationTest.java fails with -XX:ForceNonTearable=* In-Reply-To: References: Message-ID: On Tue, 8 Jul 2025 00:37:38 GMT, Chen Liang wrote: > Mark this test as flagless so we will skip it with any layout perturbation. This pull request has now been integrated. Changeset: 67e6bcc4 Author: Chen Liang URL: https://git.openjdk.org/valhalla/commit/67e6bcc418721eded34878eb70c7d0a86df338b1 Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod 8360653: [lworld] LayoutIterationTest.java fails with -XX:ForceNonTearable=* ------------- PR: https://git.openjdk.org/valhalla/pull/1505 From fparain at openjdk.org Wed Aug 6 18:33:33 2025 From: fparain at openjdk.org (Frederic Parain) Date: Wed, 6 Aug 2025 18:33:33 GMT Subject: [lworld] RFR: 8364483: [lworld] Pre-register migrated classes in class loaders In-Reply-To: References: Message-ID: <1j2m-tN1ooL4XvU_pdJ5G4Cbxt7xkjosAIsr91f_lY0=.0d514dc6-86b0-4994-8d4c-7b881f1bfafc@github.com> On Thu, 31 Jul 2025 20:10:14 GMT, Coleen Phillimore wrote: > This change preloads and preregisters all classes in the migrated classes lists, in all class loaders. > Tested with tier1 locally and with -XX:+PrintSystemDictionaryAtExit. src/hotspot/share/classfile/vmSymbols.hpp line 900: > 898: static void migrated_class_names_do(Function f) { > 899: for (int i = 0; i < _migrated_class_names_length; i++) { > 900: //f->do_symbol(&_migrated_class_names[i]); Commented line to be removed? ------------- PR Review Comment: https://git.openjdk.org/valhalla/pull/1520#discussion_r2257963156 From coleenp at openjdk.org Wed Aug 6 21:48:03 2025 From: coleenp at openjdk.org (Coleen Phillimore) Date: Wed, 6 Aug 2025 21:48:03 GMT Subject: [lworld] RFR: 8364483: [lworld] Pre-register migrated classes in class loaders [v2] In-Reply-To: References: Message-ID: > This change preloads and preregisters all classes in the migrated classes lists, in all class loaders. > Tested with tier1 locally and with -XX:+PrintSystemDictionaryAtExit. Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision: remove commented out code. ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1520/files - new: https://git.openjdk.org/valhalla/pull/1520/files/0fd70f7e..1b85463c Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1520&range=01 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1520&range=00-01 Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod Patch: https://git.openjdk.org/valhalla/pull/1520.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1520/head:pull/1520 PR: https://git.openjdk.org/valhalla/pull/1520 From qamai at openjdk.org Thu Aug 7 13:34:54 2025 From: qamai at openjdk.org (Quan Anh Mai) Date: Thu, 7 Aug 2025 13:34:54 GMT Subject: [lworld] RFR: 8364191: [lworld] Accesses to atomic flat fields prevent scalar replacement [v3] In-Reply-To: References: Message-ID: > Hi, > > Flat accesses prevent scalar replacement because they are mismatched accesses. It is also generally not possible to look through them, because the payload may contain an oop in the form of raw bits. As a result, this PR adds `LoadFlatNode` and `StoreFlatNode`, which act as high-level abstractions for atomic accesses on flat fields. When it is determined that there is no racing access on the flat field (e.g. because the holder object does not escape), these flat access nodes can be expanded into multiple accesses to each flattened fields, otherwise, they will be expanded into a sequence of inferring a payload and accessing memory with that payload. > > I also fix an issue with deoptimization reallocation where we miss assigning the null marker of elements in a nullable flat array. > > Please take a look and leave your reviews, thanks a lot. Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: fix release build ------------- Changes: - all: https://git.openjdk.org/valhalla/pull/1518/files - new: https://git.openjdk.org/valhalla/pull/1518/files/428b656c..eb23f4e5 Webrevs: - full: https://webrevs.openjdk.org/?repo=valhalla&pr=1518&range=02 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1518&range=01-02 Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod Patch: https://git.openjdk.org/valhalla/pull/1518.diff Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1518/head:pull/1518 PR: https://git.openjdk.org/valhalla/pull/1518 From qamai at openjdk.org Thu Aug 7 13:34:54 2025 From: qamai at openjdk.org (Quan Anh Mai) Date: Thu, 7 Aug 2025 13:34:54 GMT Subject: [lworld] RFR: 8364191: [lworld] Accesses to atomic flat fields prevent scalar replacement [v2] In-Reply-To: References: <9AdjPfcMo_PPTNaDqRyBBQXsJbmdjeRwS5LzPda_wkY=.7f7b838b-cdcd-4bcb-83d5-2fe6e9496455@github.com> Message-ID: On Mon, 4 Aug 2025 19:42:25 GMT, Tobias Hartmann wrote: >> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision: >> >> small fix StoreFlatNode::size_of > > Thanks for working on this @merykitty! I haven't reviewed this in yet but noticed a build failure: > > > [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp: In member function 'void ConnectionGraph::add_final_edges(Node*)': > [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp:1874:25: error: no matching function for call to 'ConnectionGraph::set_escape_state(PointsToNode*&, PointsToNode::EscapeState, const char [24])' > [2025-08-04T17:23:31,905Z] 1874 | set_escape_state(field_value_ptn, PointsToNode::GlobalEscape, "store into a flat field"); > [2025-08-04T17:23:31,905Z] | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > [2025-08-04T17:23:31,905Z] In file included from /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.cpp:38: > [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.hpp:434:8: note: candidate: 'void ConnectionGraph::set_escape_state(PointsToNode*, PointsToNode::EscapeState)' > [2025-08-04T17:23:31,905Z] 434 | void set_escape_state(PointsToNode* ptn, PointsToNode::EscapeState esc > [2025-08-04T17:23:31,905Z] | ^~~~~~~~~~~~~~~~ > [2025-08-04T17:23:31,905Z] /opt/mach5/mesos/work_dir/slaves/f7f8bd65-a387-4a2b-b519-702f2fefaf87-S170287/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8d44f2d4-5a02-4ac8-95c1-3a37a1d82705/runs/1b653695-e82f-4430-a41f-d099d041486e/workspace/open/src/hotspot/share/opto/escape.hpp:434:8: note: candidate expects 2 arguments, 3 provided > [2025-08-04T17:23:32,241Z] lib/CompileJvm.gmk:172: recipe for target '/opt/mach5/mes... @TobiHartmann Ah dummy mistake, I missed the `NOT_PRODUCT` guard, fixed it now. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/1518#issuecomment-3164224324