implements one-shot PBS boot guard in published wrapper lowering

This commit is contained in:
2026-03-26 20:05:27 +00:00
parent 64762ca227
commit ce55cf6405
9 changed files with 268 additions and 12 deletions
@@ -271,6 +271,20 @@ public record IRBackendExecutableFunction(
throw new IllegalArgumentException("GET_LOCAL must not carry call metadata");
}
}
case GET_GLOBAL -> {
if (expectedArgSlots == null) {
throw new IllegalArgumentException("GET_GLOBAL requires global slot in expectedArgSlots");
}
if (!label.isBlank()
|| !targetLabel.isBlank()
|| !calleeCallableName.isBlank()
|| calleeCallableId != null
|| hostCall != null
|| intrinsicCall != null
|| expectedRetSlots != null) {
throw new IllegalArgumentException("GET_GLOBAL must not carry call metadata");
}
}
case SET_LOCAL -> {
if (expectedArgSlots == null) {
throw new IllegalArgumentException("SET_LOCAL requires local slot in expectedArgSlots");
@@ -285,6 +299,20 @@ public record IRBackendExecutableFunction(
throw new IllegalArgumentException("SET_LOCAL must not carry call metadata");
}
}
case SET_GLOBAL -> {
if (expectedArgSlots == null) {
throw new IllegalArgumentException("SET_GLOBAL requires global slot in expectedArgSlots");
}
if (!label.isBlank()
|| !targetLabel.isBlank()
|| !calleeCallableName.isBlank()
|| calleeCallableId != null
|| hostCall != null
|| intrinsicCall != null
|| expectedRetSlots != null) {
throw new IllegalArgumentException("SET_GLOBAL must not carry call metadata");
}
}
case CALL_FUNC -> {
if (calleeCallableId == null) {
throw new IllegalArgumentException("CALL_FUNC requires calleeCallableId");
@@ -363,7 +391,9 @@ public record IRBackendExecutableFunction(
PUSH_BOOL,
PUSH_CONST,
GET_LOCAL,
GET_GLOBAL,
SET_LOCAL,
SET_GLOBAL,
POP,
ADD,
SUB,