Skip to content

Commit 7a65fc4

Browse files
committed
rename fused instruction super instruction
1 parent a179d91 commit 7a65fc4

118 files changed

Lines changed: 4073 additions & 4080 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

compiler/src/commonMain/kotlin/io/github/charlietap/chasm/compiler/ext/FunctionExt.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.charlietap.chasm.compiler.ext
22

33
import io.github.charlietap.chasm.ir.instruction.ControlInstruction
4-
import io.github.charlietap.chasm.ir.instruction.FusedControlInstruction
4+
import io.github.charlietap.chasm.ir.instruction.ControlSuperInstruction
55
import io.github.charlietap.chasm.ir.instruction.Instruction
66
import io.github.charlietap.chasm.ir.module.Function
77

@@ -23,7 +23,7 @@ private suspend fun SequenceScope<Instruction>.function(
2323
instruction.elseInstructions?.let { function(it) }
2424
}
2525
is ControlInstruction.TryTable -> function(instruction.instructions)
26-
is FusedControlInstruction.If -> {
26+
is ControlSuperInstruction.If -> {
2727
function(instruction.thenInstructions)
2828
instruction.elseInstructions?.let { function(it) }
2929
}
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package io.github.charlietap.chasm.compiler.ext
22

33
import io.github.charlietap.chasm.ir.instruction.AggregateInstruction
4-
import io.github.charlietap.chasm.ir.instruction.FusedAggregateInstruction
4+
import io.github.charlietap.chasm.ir.instruction.AggregateSuperInstruction
55
import io.github.charlietap.chasm.ir.instruction.Instruction
66

77
internal fun Instruction.isAllocating(): Boolean = when (this) {
@@ -12,13 +12,13 @@ internal fun Instruction.isAllocating(): Boolean = when (this) {
1212
is AggregateInstruction.ArrayNewFixed,
1313
is AggregateInstruction.ArrayNewElement,
1414
is AggregateInstruction.ArrayNewDefault,
15-
is FusedAggregateInstruction.StructNew,
16-
is FusedAggregateInstruction.StructNewDefault,
17-
is FusedAggregateInstruction.ArrayNew,
18-
is FusedAggregateInstruction.ArrayNewData,
19-
is FusedAggregateInstruction.ArrayNewDefault,
20-
is FusedAggregateInstruction.ArrayNewElement,
21-
is FusedAggregateInstruction.ArrayNewFixed,
15+
is AggregateSuperInstruction.StructNew,
16+
is AggregateSuperInstruction.StructNewDefault,
17+
is AggregateSuperInstruction.ArrayNew,
18+
is AggregateSuperInstruction.ArrayNewData,
19+
is AggregateSuperInstruction.ArrayNewDefault,
20+
is AggregateSuperInstruction.ArrayNewElement,
21+
is AggregateSuperInstruction.ArrayNewFixed,
2222
-> true
2323
else -> false
2424
}

compiler/src/commonMain/kotlin/io/github/charlietap/chasm/compiler/ext/ModuleExt.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package io.github.charlietap.chasm.compiler.ext
22

33
import io.github.charlietap.chasm.ir.instruction.AggregateInstruction
4-
import io.github.charlietap.chasm.ir.instruction.FusedAggregateInstruction
4+
import io.github.charlietap.chasm.ir.instruction.AggregateSuperInstruction
55
import io.github.charlietap.chasm.ir.module.Export
66
import io.github.charlietap.chasm.ir.module.Module
77

88
internal fun Module.containsGcInstructions(): Boolean = functions.any { function ->
99
function.traverseInstructions().any { instruction ->
1010
instruction is AggregateInstruction ||
11-
instruction is FusedAggregateInstruction
11+
instruction is AggregateSuperInstruction
1212
}
1313
}
1414

compiler/src/commonMain/kotlin/io/github/charlietap/chasm/compiler/passes/FrameSlotPass.kt

Lines changed: 495 additions & 495 deletions
Large diffs are not rendered by default.

compiler/src/commonMain/kotlin/io/github/charlietap/chasm/compiler/passes/JumpPass.kt

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ package io.github.charlietap.chasm.compiler.passes
22

33
import io.github.charlietap.chasm.ir.instruction.AdminInstruction
44
import io.github.charlietap.chasm.ir.instruction.ControlInstruction
5+
import io.github.charlietap.chasm.ir.instruction.ControlSuperInstruction
56
import io.github.charlietap.chasm.ir.instruction.Expression
6-
import io.github.charlietap.chasm.ir.instruction.FusedControlInstruction
77
import io.github.charlietap.chasm.ir.instruction.Instruction
88
import io.github.charlietap.chasm.ir.module.Index
99
import io.github.charlietap.chasm.ir.module.Module
@@ -94,43 +94,43 @@ private fun lowerInstruction(
9494
is ControlInstruction.TryTable -> lowerTryTable(instruction, output, labels, handlers)
9595
is ControlInstruction.Block -> lowerBlock(instruction.instructions, output, labels, handlers)
9696
is ControlInstruction.Loop -> lowerLoop(instruction.instructions, output, labels, handlers)
97-
is FusedControlInstruction.If -> lowerIf(instruction, output, labels, handlers)
97+
is ControlSuperInstruction.If -> lowerIf(instruction, output, labels, handlers)
9898
is ControlInstruction.Br -> lowerJump(
9999
target = jumpTarget(labels, instruction.labelIndex),
100100
currentHandlerDepth = handlers.size,
101101
output = output,
102102
)
103-
is FusedControlInstruction.BrIf -> lowerJumpIf(
103+
is ControlSuperInstruction.BrIf -> lowerJumpIf(
104104
instruction = instruction,
105105
target = jumpTarget(labels, instruction.labelIndex),
106106
currentHandlerDepth = handlers.size,
107107
output = output,
108108
)
109-
is FusedControlInstruction.BrTable -> lowerJumpTable(
109+
is ControlSuperInstruction.BrTable -> lowerJumpTable(
110110
instruction = instruction,
111111
labels = labels,
112112
currentHandlerDepth = handlers.size,
113113
output = output,
114114
)
115-
is FusedControlInstruction.BrOnNull -> lowerJumpOnNull(
115+
is ControlSuperInstruction.BrOnNull -> lowerJumpOnNull(
116116
instruction = instruction,
117117
target = jumpTarget(labels, instruction.labelIndex),
118118
currentHandlerDepth = handlers.size,
119119
output = output,
120120
)
121-
is FusedControlInstruction.BrOnNonNull -> lowerJumpOnNonNull(
121+
is ControlSuperInstruction.BrOnNonNull -> lowerJumpOnNonNull(
122122
instruction = instruction,
123123
target = jumpTarget(labels, instruction.labelIndex),
124124
currentHandlerDepth = handlers.size,
125125
output = output,
126126
)
127-
is FusedControlInstruction.BrOnCast -> lowerJumpOnCast(
127+
is ControlSuperInstruction.BrOnCast -> lowerJumpOnCast(
128128
instruction = instruction,
129129
target = jumpTarget(labels, instruction.labelIndex),
130130
currentHandlerDepth = handlers.size,
131131
output = output,
132132
)
133-
is FusedControlInstruction.BrOnCastFail -> lowerJumpOnCastFail(
133+
is ControlSuperInstruction.BrOnCastFail -> lowerJumpOnCastFail(
134134
instruction = instruction,
135135
target = jumpTarget(labels, instruction.labelIndex),
136136
currentHandlerDepth = handlers.size,
@@ -172,7 +172,7 @@ private fun lowerLoop(
172172
}
173173

174174
private fun lowerIf(
175-
instruction: FusedControlInstruction.If,
175+
instruction: ControlSuperInstruction.If,
176176
output: MutableList<Instruction>,
177177
labels: ArrayDeque<JumpLabel>,
178178
handlers: ArrayDeque<ActiveTryHandler>,
@@ -269,7 +269,7 @@ private fun lowerJump(
269269
}
270270

271271
private fun lowerJumpIf(
272-
instruction: FusedControlInstruction.BrIf,
272+
instruction: ControlSuperInstruction.BrIf,
273273
target: JumpLabel,
274274
currentHandlerDepth: Int,
275275
output: MutableList<Instruction>,
@@ -288,7 +288,7 @@ private fun lowerJumpIf(
288288
}
289289

290290
private fun lowerJumpTable(
291-
instruction: FusedControlInstruction.BrTable,
291+
instruction: ControlSuperInstruction.BrTable,
292292
labels: ArrayDeque<JumpLabel>,
293293
currentHandlerDepth: Int,
294294
output: MutableList<Instruction>,
@@ -323,7 +323,7 @@ private fun lowerJumpTable(
323323
}
324324

325325
private fun lowerJumpOnNull(
326-
instruction: FusedControlInstruction.BrOnNull,
326+
instruction: ControlSuperInstruction.BrOnNull,
327327
target: JumpLabel,
328328
currentHandlerDepth: Int,
329329
output: MutableList<Instruction>,
@@ -342,7 +342,7 @@ private fun lowerJumpOnNull(
342342
}
343343

344344
private fun lowerJumpOnNonNull(
345-
instruction: FusedControlInstruction.BrOnNonNull,
345+
instruction: ControlSuperInstruction.BrOnNonNull,
346346
target: JumpLabel,
347347
currentHandlerDepth: Int,
348348
output: MutableList<Instruction>,
@@ -361,7 +361,7 @@ private fun lowerJumpOnNonNull(
361361
}
362362

363363
private fun lowerJumpOnCast(
364-
instruction: FusedControlInstruction.BrOnCast,
364+
instruction: ControlSuperInstruction.BrOnCast,
365365
target: JumpLabel,
366366
currentHandlerDepth: Int,
367367
output: MutableList<Instruction>,
@@ -382,7 +382,7 @@ private fun lowerJumpOnCast(
382382
}
383383

384384
private fun lowerJumpOnCastFail(
385-
instruction: FusedControlInstruction.BrOnCastFail,
385+
instruction: ControlSuperInstruction.BrOnCastFail,
386386
target: JumpLabel,
387387
currentHandlerDepth: Int,
388388
output: MutableList<Instruction>,

0 commit comments

Comments
 (0)