implements PR-09.1: remove moduleKey from FE/BE contracts
This commit is contained in:
+12
-30
@@ -21,7 +21,7 @@ class IRBackendExecutableContractTest {
|
||||
void callInstructionMustRequireCategorySpecificMetadata() {
|
||||
assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.CALL_HOST,
|
||||
"",
|
||||
ModuleId.none(),
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
@@ -29,7 +29,7 @@ class IRBackendExecutableContractTest {
|
||||
|
||||
final var callFunc = new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.CALL_FUNC,
|
||||
"app/main",
|
||||
ModuleId.none(),
|
||||
"foo",
|
||||
new CallableId(7),
|
||||
null,
|
||||
@@ -42,7 +42,6 @@ class IRBackendExecutableContractTest {
|
||||
void functionContractMustRejectInvalidSlotAndSpanBounds() {
|
||||
assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction(
|
||||
new FileId(1),
|
||||
"app",
|
||||
"main",
|
||||
new CallableId(1),
|
||||
10,
|
||||
@@ -56,7 +55,6 @@ class IRBackendExecutableContractTest {
|
||||
|
||||
final var thrown = assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction(
|
||||
new FileId(1),
|
||||
"app",
|
||||
"main",
|
||||
new CallableId(1),
|
||||
0,
|
||||
@@ -74,7 +72,7 @@ class IRBackendExecutableContractTest {
|
||||
void instructionContractMustRejectMixedMetadataKinds() {
|
||||
assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.CALL_FUNC,
|
||||
"app/main",
|
||||
ModuleId.none(),
|
||||
"foo",
|
||||
new CallableId(1),
|
||||
new IRBackendExecutableFunction.HostCallMetadata("gfx", "draw", 1, 0, 0),
|
||||
@@ -93,7 +91,7 @@ class IRBackendExecutableContractTest {
|
||||
void jumpAndLabelContractMustRequireNames() {
|
||||
assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.LABEL,
|
||||
"",
|
||||
ModuleId.none(),
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
@@ -106,7 +104,7 @@ class IRBackendExecutableContractTest {
|
||||
|
||||
assertThrows(IllegalArgumentException.class, () -> new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.JMP,
|
||||
"",
|
||||
ModuleId.none(),
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
@@ -125,7 +123,6 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.empty(),
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(1),
|
||||
"app/main",
|
||||
"entry",
|
||||
new CallableId(0),
|
||||
0,
|
||||
@@ -137,21 +134,18 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.HALT,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new CallableSignatureRef("app/main", "entry", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef("entry", 0, "() -> unit")),
|
||||
ReadOnlyList.empty());
|
||||
final var fileB = new IRBackendFile(
|
||||
new FileId(2),
|
||||
ReadOnlyList.empty(),
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(2),
|
||||
"app/main",
|
||||
"aux",
|
||||
new CallableId(0),
|
||||
11,
|
||||
@@ -163,14 +157,12 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.RET,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new CallableSignatureRef("app/main", "aux", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef("aux", 0, "() -> unit")),
|
||||
ReadOnlyList.empty());
|
||||
|
||||
final var aggregator = IRBackend.aggregator();
|
||||
@@ -213,7 +205,6 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.empty(),
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(1),
|
||||
"app/main",
|
||||
"entry",
|
||||
new CallableId(0),
|
||||
0,
|
||||
@@ -225,20 +216,18 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.CALL_INTRINSIC,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
new IRBackendExecutableFunction.IntrinsicCallMetadata("core.color.pack", 1, new IntrinsicId(0)),
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new CallableSignatureRef("app/main", "entry", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef("entry", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new IntrinsicReference("core.color.pack", 1)));
|
||||
final var fileB = new IRBackendFile(
|
||||
new FileId(2),
|
||||
ReadOnlyList.empty(),
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(2),
|
||||
"app/main",
|
||||
"aux",
|
||||
new CallableId(0),
|
||||
11,
|
||||
@@ -250,13 +239,12 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.CALL_INTRINSIC,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
new IRBackendExecutableFunction.IntrinsicCallMetadata("core.color.pack", 1, new IntrinsicId(0)),
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new CallableSignatureRef("app/main", "aux", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef("aux", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new IntrinsicReference("core.color.pack", 1)));
|
||||
|
||||
final var aggregator = IRBackend.aggregator();
|
||||
@@ -280,7 +268,6 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.empty(),
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(7),
|
||||
"app/main",
|
||||
"main",
|
||||
new CallableId(0),
|
||||
10,
|
||||
@@ -292,13 +279,12 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.RET,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
instructionSpan)),
|
||||
functionSpan)),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new CallableSignatureRef("app/main", "main", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef("main", 0, "() -> unit")),
|
||||
ReadOnlyList.empty());
|
||||
|
||||
final var aggregator = IRBackend.aggregator();
|
||||
@@ -323,7 +309,6 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(1),
|
||||
new ModuleId(0),
|
||||
"app:mod/a",
|
||||
"entry",
|
||||
new CallableId(0),
|
||||
0,
|
||||
@@ -335,14 +320,13 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.RET,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new ModuleReference("app", ReadOnlyList.from("mod", "a"))),
|
||||
ReadOnlyList.from(new CallableSignatureRef(new ModuleId(0), "app:mod/a", "entry", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef(new ModuleId(0), "entry", 0, "() -> unit")),
|
||||
ReadOnlyList.empty());
|
||||
final var fileB = new IRBackendFile(
|
||||
new FileId(2),
|
||||
@@ -350,7 +334,6 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction(
|
||||
new FileId(2),
|
||||
new ModuleId(0),
|
||||
"app:mod/b",
|
||||
"aux",
|
||||
new CallableId(0),
|
||||
6,
|
||||
@@ -362,14 +345,13 @@ class IRBackendExecutableContractTest {
|
||||
ReadOnlyList.from(new IRBackendExecutableFunction.Instruction(
|
||||
IRBackendExecutableFunction.InstructionKind.RET,
|
||||
"",
|
||||
"",
|
||||
null,
|
||||
null,
|
||||
Span.none())),
|
||||
Span.none())),
|
||||
IRReservedMetadata.empty(),
|
||||
ReadOnlyList.from(new ModuleReference("app", ReadOnlyList.from("mod", "b"))),
|
||||
ReadOnlyList.from(new CallableSignatureRef(new ModuleId(0), "app:mod/b", "aux", 0, "() -> unit")),
|
||||
ReadOnlyList.from(new CallableSignatureRef(new ModuleId(0), "aux", 0, "() -> unit")),
|
||||
ReadOnlyList.empty());
|
||||
|
||||
final var aggregator = IRBackend.aggregator();
|
||||
|
||||
Reference in New Issue
Block a user