new test main with code directly (fixes) runtime runing
This commit is contained in:
+42
@@ -128,6 +128,45 @@ public record IRBackendExecutableFunction(
|
||||
throw new IllegalArgumentException("expectedRetSlots must be non-negative");
|
||||
}
|
||||
switch (kind) {
|
||||
case PUSH_I32 -> {
|
||||
if (label.isBlank()) {
|
||||
throw new IllegalArgumentException("PUSH_I32 requires immediate label payload");
|
||||
}
|
||||
if (!targetLabel.isBlank()
|
||||
|| !calleeCallableName.isBlank()
|
||||
|| calleeCallableId != null
|
||||
|| hostCall != null
|
||||
|| intrinsicCall != null
|
||||
|| expectedArgSlots != null
|
||||
|| expectedRetSlots != null) {
|
||||
throw new IllegalArgumentException("PUSH_I32 must not carry call metadata");
|
||||
}
|
||||
}
|
||||
case PUSH_CONST -> {
|
||||
if (!targetLabel.isBlank()
|
||||
|| !calleeCallableName.isBlank()
|
||||
|| calleeCallableId != null
|
||||
|| hostCall != null
|
||||
|| intrinsicCall != null
|
||||
|| expectedArgSlots != null
|
||||
|| expectedRetSlots != null) {
|
||||
throw new IllegalArgumentException("PUSH_CONST must not carry call metadata");
|
||||
}
|
||||
}
|
||||
case GET_LOCAL -> {
|
||||
if (expectedArgSlots == null) {
|
||||
throw new IllegalArgumentException("GET_LOCAL requires local slot in expectedArgSlots");
|
||||
}
|
||||
if (!label.isBlank()
|
||||
|| !targetLabel.isBlank()
|
||||
|| !calleeCallableName.isBlank()
|
||||
|| calleeCallableId != null
|
||||
|| hostCall != null
|
||||
|| intrinsicCall != null
|
||||
|| expectedRetSlots != null) {
|
||||
throw new IllegalArgumentException("GET_LOCAL must not carry call metadata");
|
||||
}
|
||||
}
|
||||
case CALL_FUNC -> {
|
||||
if (calleeCallableId == null) {
|
||||
throw new IllegalArgumentException("CALL_FUNC requires calleeCallableId");
|
||||
@@ -199,6 +238,9 @@ public record IRBackendExecutableFunction(
|
||||
}
|
||||
|
||||
public enum InstructionKind {
|
||||
PUSH_I32,
|
||||
PUSH_CONST,
|
||||
GET_LOCAL,
|
||||
HALT,
|
||||
RET,
|
||||
CALL_FUNC,
|
||||
|
||||
Reference in New Issue
Block a user