Skip to content

Commit debbe24

Browse files
committed
Put materialized locals behind a flag
1 parent 1442732 commit debbe24

File tree

18 files changed

+565
-1515
lines changed

18 files changed

+565
-1515
lines changed

truffle/mxbuild/jdk21/com.oracle.truffle.api.bytecode.test/src_gen/com/oracle/truffle/api/bytecode/test/basic_interpreter/BasicInterpreterBase.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5096,8 +5096,8 @@ public void endBlock() {
50965096
* The result of {@link Node#getSourceSection} on the generated root is undefined if there is no enclosing SourceSection operation.
50975097
* <p>
50985098
* This method can also be called inside of another root operation. Bytecode generation for the outer root node suspends until generation for the inner root node finishes.
5099-
* The inner root node is not lexically nested in the first (you can invoke the inner root node independently), but the inner root *can* manipulate the outer root's locals using
5100-
* materialized local accesses if the outer frame is provided to it.
5099+
* The inner root node is not lexically nested in the outer (you can invoke the inner root node independently), but the inner root <i>can</i> manipulate the outer root's locals
5100+
* using materialized local accesses if the outer frame is provided to it.
51015101
* Multiple root nodes can be obtained from the {@link BytecodeNodes} object in the order of their {@link #beginRoot} calls.
51025102
*
51035103
*/
@@ -6031,7 +6031,7 @@ private void validateLocalScope(BytecodeLocal local) {
60316031
}
60326032
RootData rootOperationData = getCurrentRootOperationData();
60336033
if (rootOperationData.index != localImpl.rootIndex) {
6034-
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses to access locals from an outer root node.");
6034+
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses (i.e., LoadLocalMaterialized/StoreLocalMaterialized or MaterializedLocalAccessor) to access locals from an outer root node.");
60356035
}
60366036
}
60376037

@@ -6134,10 +6134,10 @@ private void validateMaterializedLocalScope(BytecodeLocal local) {
61346134
* <p>
61356135
* Signature: LoadLocalMaterialized(frame) -> Object
61366136
* <p>
6137-
* LoadLocalMaterialized reads {@code local} from the frame produced by {@code frame}.
6138-
* This operation can be used to read locals from materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
6139-
* The given local must be in scope at the point that LoadLocalMaterialized executes, otherwise it may produce unexpected values.
6140-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
6137+
* LoadLocalMaterialized reads {@code local} from the materialized frame produced by {@code frame}.
6138+
* This operation can be used to read a local defined by the current root or an enclosing root.
6139+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
6140+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
61416141
* <p>
61426142
* A corresponding call to {@link #endLoadLocalMaterialized} is required to end the operation.
61436143
*
@@ -6195,10 +6195,10 @@ public void endLoadLocalMaterialized() {
61956195
* <p>
61966196
* Signature: StoreLocalMaterialized(frame, value) -> void
61976197
* <p>
6198-
* StoreLocalMaterialized writes the value produced by {@code value} into the {@code local} in the frame produced by {@code frame}.
6199-
* This operation can be used to store locals into materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
6200-
* The given local must be in scope at the point that StoreLocalMaterialized executes, otherwise it may produce unexpected values.
6201-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
6198+
* StoreLocalMaterialized writes the value produced by {@code value} into {@code local} in the materialized frame produced by {@code frame}.
6199+
* This operation can be used to store locals defined by the current root or an enclosing root.
6200+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
6201+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
62026202
* <p>
62036203
* A corresponding call to {@link #endStoreLocalMaterialized} is required to end the operation.
62046204
*

truffle/mxbuild/jdk21/com.oracle.truffle.api.bytecode.test/src_gen/com/oracle/truffle/api/bytecode/test/basic_interpreter/BasicInterpreterProductionBlockScoping.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10298,8 +10298,8 @@ public void endBlock() {
1029810298
* The result of {@link Node#getSourceSection} on the generated root is undefined if there is no enclosing SourceSection operation.
1029910299
* <p>
1030010300
* This method can also be called inside of another root operation. Bytecode generation for the outer root node suspends until generation for the inner root node finishes.
10301-
* The inner root node is not lexically nested in the first (you can invoke the inner root node independently), but the inner root *can* manipulate the outer root's locals using
10302-
* materialized local accesses if the outer frame is provided to it.
10301+
* The inner root node is not lexically nested in the outer (you can invoke the inner root node independently), but the inner root <i>can</i> manipulate the outer root's locals
10302+
* using materialized local accesses if the outer frame is provided to it.
1030310303
* Multiple root nodes can be obtained from the {@link BytecodeNodes} object in the order of their {@link #beginRoot} calls.
1030410304
*
1030510305
*/
@@ -11234,7 +11234,7 @@ private void validateLocalScope(BytecodeLocal local) {
1123411234
}
1123511235
RootData rootOperationData = getCurrentRootOperationData();
1123611236
if (rootOperationData.index != localImpl.rootIndex) {
11237-
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses to access locals from an outer root node.");
11237+
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses (i.e., LoadLocalMaterialized/StoreLocalMaterialized or MaterializedLocalAccessor) to access locals from an outer root node.");
1123811238
}
1123911239
}
1124011240

@@ -11337,10 +11337,10 @@ private void validateMaterializedLocalScope(BytecodeLocal local) {
1133711337
* <p>
1133811338
* Signature: LoadLocalMaterialized(frame) -> Object
1133911339
* <p>
11340-
* LoadLocalMaterialized reads {@code local} from the frame produced by {@code frame}.
11341-
* This operation can be used to read locals from materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
11342-
* The given local must be in scope at the point that LoadLocalMaterialized executes, otherwise it may produce unexpected values.
11343-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
11340+
* LoadLocalMaterialized reads {@code local} from the materialized frame produced by {@code frame}.
11341+
* This operation can be used to read a local defined by the current root or an enclosing root.
11342+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
11343+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
1134411344
* <p>
1134511345
* A corresponding call to {@link #endLoadLocalMaterialized} is required to end the operation.
1134611346
*
@@ -11398,10 +11398,10 @@ public void endLoadLocalMaterialized() {
1139811398
* <p>
1139911399
* Signature: StoreLocalMaterialized(frame, value) -> void
1140011400
* <p>
11401-
* StoreLocalMaterialized writes the value produced by {@code value} into the {@code local} in the frame produced by {@code frame}.
11402-
* This operation can be used to store locals into materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
11403-
* The given local must be in scope at the point that StoreLocalMaterialized executes, otherwise it may produce unexpected values.
11404-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
11401+
* StoreLocalMaterialized writes the value produced by {@code value} into {@code local} in the materialized frame produced by {@code frame}.
11402+
* This operation can be used to store locals defined by the current root or an enclosing root.
11403+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
11404+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
1140511405
* <p>
1140611406
* A corresponding call to {@link #endStoreLocalMaterialized} is required to end the operation.
1140711407
*

truffle/mxbuild/jdk21/com.oracle.truffle.api.bytecode.test/src_gen/com/oracle/truffle/api/bytecode/test/basic_interpreter/BasicInterpreterProductionRootScoping.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10167,8 +10167,8 @@ public void endBlock() {
1016710167
* The result of {@link Node#getSourceSection} on the generated root is undefined if there is no enclosing SourceSection operation.
1016810168
* <p>
1016910169
* This method can also be called inside of another root operation. Bytecode generation for the outer root node suspends until generation for the inner root node finishes.
10170-
* The inner root node is not lexically nested in the first (you can invoke the inner root node independently), but the inner root *can* manipulate the outer root's locals using
10171-
* materialized local accesses if the outer frame is provided to it.
10170+
* The inner root node is not lexically nested in the outer (you can invoke the inner root node independently), but the inner root <i>can</i> manipulate the outer root's locals
10171+
* using materialized local accesses if the outer frame is provided to it.
1017210172
* Multiple root nodes can be obtained from the {@link BytecodeNodes} object in the order of their {@link #beginRoot} calls.
1017310173
*
1017410174
*/
@@ -11090,7 +11090,7 @@ private void validateLocalScope(BytecodeLocal local) {
1109011090
BytecodeLocalImpl localImpl = (BytecodeLocalImpl) local;
1109111091
RootData rootOperationData = getCurrentRootOperationData();
1109211092
if (rootOperationData.index != localImpl.rootIndex) {
11093-
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses to access locals from an outer root node.");
11093+
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses (i.e., LoadLocalMaterialized/StoreLocalMaterialized or MaterializedLocalAccessor) to access locals from an outer root node.");
1109411094
}
1109511095
}
1109611096

@@ -11207,10 +11207,10 @@ private void validateMaterializedLocalScope(BytecodeLocal local) {
1120711207
* <p>
1120811208
* Signature: LoadLocalMaterialized(frame) -> Object
1120911209
* <p>
11210-
* LoadLocalMaterialized reads {@code local} from the frame produced by {@code frame}.
11211-
* This operation can be used to read locals from materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
11212-
* The given local must be in scope at the point that LoadLocalMaterialized executes, otherwise it may produce unexpected values.
11213-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
11210+
* LoadLocalMaterialized reads {@code local} from the materialized frame produced by {@code frame}.
11211+
* This operation can be used to read a local defined by the current root or an enclosing root.
11212+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
11213+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
1121411214
* <p>
1121511215
* A corresponding call to {@link #endLoadLocalMaterialized} is required to end the operation.
1121611216
*
@@ -11268,10 +11268,10 @@ public void endLoadLocalMaterialized() {
1126811268
* <p>
1126911269
* Signature: StoreLocalMaterialized(frame, value) -> void
1127011270
* <p>
11271-
* StoreLocalMaterialized writes the value produced by {@code value} into the {@code local} in the frame produced by {@code frame}.
11272-
* This operation can be used to store locals into materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
11273-
* The given local must be in scope at the point that StoreLocalMaterialized executes, otherwise it may produce unexpected values.
11274-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
11271+
* StoreLocalMaterialized writes the value produced by {@code value} into {@code local} in the materialized frame produced by {@code frame}.
11272+
* This operation can be used to store locals defined by the current root or an enclosing root.
11273+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
11274+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
1127511275
* <p>
1127611276
* A corresponding call to {@link #endStoreLocalMaterialized} is required to end the operation.
1127711277
*

truffle/mxbuild/jdk21/com.oracle.truffle.api.bytecode.test/src_gen/com/oracle/truffle/api/bytecode/test/basic_interpreter/BasicInterpreterUnsafe.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5096,8 +5096,8 @@ public void endBlock() {
50965096
* The result of {@link Node#getSourceSection} on the generated root is undefined if there is no enclosing SourceSection operation.
50975097
* <p>
50985098
* This method can also be called inside of another root operation. Bytecode generation for the outer root node suspends until generation for the inner root node finishes.
5099-
* The inner root node is not lexically nested in the first (you can invoke the inner root node independently), but the inner root *can* manipulate the outer root's locals using
5100-
* materialized local accesses if the outer frame is provided to it.
5099+
* The inner root node is not lexically nested in the outer (you can invoke the inner root node independently), but the inner root <i>can</i> manipulate the outer root's locals
5100+
* using materialized local accesses if the outer frame is provided to it.
51015101
* Multiple root nodes can be obtained from the {@link BytecodeNodes} object in the order of their {@link #beginRoot} calls.
51025102
*
51035103
*/
@@ -6031,7 +6031,7 @@ private void validateLocalScope(BytecodeLocal local) {
60316031
}
60326032
RootData rootOperationData = getCurrentRootOperationData();
60336033
if (rootOperationData.index != localImpl.rootIndex) {
6034-
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses to access locals from an outer root node.");
6034+
throw failArgument("Local variable must belong to the current root node. Consider using materialized local accesses (i.e., LoadLocalMaterialized/StoreLocalMaterialized or MaterializedLocalAccessor) to access locals from an outer root node.");
60356035
}
60366036
}
60376037

@@ -6134,10 +6134,10 @@ private void validateMaterializedLocalScope(BytecodeLocal local) {
61346134
* <p>
61356135
* Signature: LoadLocalMaterialized(frame) -> Object
61366136
* <p>
6137-
* LoadLocalMaterialized reads {@code local} from the frame produced by {@code frame}.
6138-
* This operation can be used to read locals from materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
6139-
* The given local must be in scope at the point that LoadLocalMaterialized executes, otherwise it may produce unexpected values.
6140-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
6137+
* LoadLocalMaterialized reads {@code local} from the materialized frame produced by {@code frame}.
6138+
* This operation can be used to read a local defined by the current root or an enclosing root.
6139+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
6140+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
61416141
* <p>
61426142
* A corresponding call to {@link #endLoadLocalMaterialized} is required to end the operation.
61436143
*
@@ -6195,10 +6195,10 @@ public void endLoadLocalMaterialized() {
61956195
* <p>
61966196
* Signature: StoreLocalMaterialized(frame, value) -> void
61976197
* <p>
6198-
* StoreLocalMaterialized writes the value produced by {@code value} into the {@code local} in the frame produced by {@code frame}.
6199-
* This operation can be used to store locals into materialized frames. The materialized frame must belong to the same root node or an enclosing root node.
6200-
* The given local must be in scope at the point that StoreLocalMaterialized executes, otherwise it may produce unexpected values.
6201-
* The interpreter will validate the scope if the interpreter is configured to store the bytecode index in the frame (see {@code @GenerateBytecode}).
6198+
* StoreLocalMaterialized writes the value produced by {@code value} into {@code local} in the materialized frame produced by {@code frame}.
6199+
* This operation can be used to store locals defined by the current root or an enclosing root.
6200+
* The local must belong to the materialized frame. It should also be in scope, otherwise the operation may produce unexpected values.
6201+
* The interpreter will validate the scope if the interpreter is configured to {@link com.oracle.truffle.api.bytecode.GenerateBytecode#storeBytecodeIndexInFrame store the bytecode index in the frame}.
62026202
* <p>
62036203
* A corresponding call to {@link #endStoreLocalMaterialized} is required to end the operation.
62046204
*

0 commit comments

Comments
 (0)