File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
compiler/src/jdk.graal.compiler/src/jdk/graal/compiler Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 41
41
import jdk .graal .compiler .nodes .spi .PlatformConfigurationProvider ;
42
42
import jdk .graal .compiler .nodes .spi .Virtualizable ;
43
43
import jdk .graal .compiler .nodes .spi .VirtualizerTool ;
44
+ import jdk .graal .compiler .nodes .virtual .AllocatedObjectNode ;
44
45
import jdk .graal .compiler .nodes .virtual .VirtualObjectNode ;
45
46
import jdk .graal .compiler .serviceprovider .SpeculationReasonGroup ;
46
47
import jdk .vm .ci .meta .SpeculationLog ;
@@ -107,6 +108,14 @@ public void virtualize(VirtualizerTool tool) {
107
108
if (virtual .hasIdentity () && tool .canVirtualizeLock (virtual , getMonitorId ())) {
108
109
tool .addLock (virtual , getMonitorId ());
109
110
if (!tool .getPlatformConfigurationProvider ().areLocksSideEffectFree ()) {
111
+ if (object () instanceof AllocatedObjectNode ) {
112
+ /*
113
+ * Don't let the allocation sink past the state split proxy, otherwise we
114
+ * end up with a virtual object in the state instead of the actual allocated
115
+ * one.
116
+ */
117
+ tool .ensureMaterialized (virtual );
118
+ }
110
119
// Ensure that the locks appear to have been acquired in the nearest FrameState.
111
120
tool .ensureAdded (new StateSplitProxyNode (stateAfter ));
112
121
}
Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 2012, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2012, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -117,9 +117,9 @@ public void apply(StructuredGraph graph) {
117
117
assert position == null || position .isAlive ();
118
118
if (!node .isAlive ()) {
119
119
graph .addWithoutUniqueWithInputs (node );
120
- if ( node instanceof FixedWithNextNode ) {
121
- graph . addBeforeFixed ( position , ( FixedWithNextNode ) node );
122
- }
120
+ }
121
+ if ( node instanceof FixedWithNextNode fixedWithNextNode && fixedWithNextNode . next () == null ) {
122
+ graph . addBeforeFixed ( position , fixedWithNextNode );
123
123
}
124
124
}
125
125
You can’t perform that action at this time.
0 commit comments