Skip to content

Commit dfa0f5b

Browse files
committed
remove runtime extensions module
1 parent e61fcde commit dfa0f5b

24 files changed

+29
-78
lines changed

chasm/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ kotlin {
3636

3737
implementation(projects.executor.instantiator)
3838
implementation(projects.executor.invoker)
39-
implementation(projects.executor.runtimeExt)
4039

4140
implementation(projects.executor.memory)
4241

executor/instantiator/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ kotlin {
2525
dependencies {
2626
api(projects.ast)
2727
api(projects.executor.runtime)
28-
api(projects.executor.runtimeExt)
2928
api(projects.executor.invoker)
3029
api(libs.result)
3130

executor/invoker/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ kotlin {
2525
dependencies {
2626
api(projects.ast)
2727
api(projects.executor.runtime)
28-
api(projects.executor.runtimeExt)
2928
api(libs.result)
3029

3130
implementation(projects.executor.memory)

executor/memory/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ kotlin {
2525
dependencies {
2626
api(projects.ast)
2727
api(projects.executor.runtime)
28-
api(projects.executor.runtimeExt)
2928
api(libs.result)
3029
}
3130
}

executor/runtime-ext/build.gradle.kts

-50
This file was deleted.
+28-23
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
package io.github.charlietap.chasm.executor.runtime.ext
1+
package io.github.charlietap.chasm.executor.runtime
22

33
import com.github.michaelbull.result.Err
44
import com.github.michaelbull.result.Ok
5-
import io.github.charlietap.chasm.executor.runtime.Stack
65
import io.github.charlietap.chasm.executor.runtime.error.InvocationError
6+
import io.github.charlietap.chasm.executor.runtime.ext.binaryOperation
7+
import io.github.charlietap.chasm.executor.runtime.ext.constOperation
8+
import io.github.charlietap.chasm.executor.runtime.ext.convertOperation
9+
import io.github.charlietap.chasm.executor.runtime.ext.pushFrame
10+
import io.github.charlietap.chasm.executor.runtime.ext.relationalOperation
11+
import io.github.charlietap.chasm.executor.runtime.ext.testOperation
12+
import io.github.charlietap.chasm.executor.runtime.ext.unaryOperation
713
import io.github.charlietap.chasm.executor.runtime.instruction.AdminInstruction
814
import io.github.charlietap.chasm.executor.runtime.value.NumberValue.F32
915
import io.github.charlietap.chasm.executor.runtime.value.NumberValue.F64
@@ -12,30 +18,9 @@ import io.github.charlietap.chasm.executor.runtime.value.NumberValue.I64
1218
import io.github.charlietap.chasm.fixture.frame
1319
import io.github.charlietap.chasm.fixture.instruction
1420
import io.github.charlietap.chasm.fixture.stack
15-
import kotlin.math.sqrt
1621
import kotlin.test.Test
1722
import kotlin.test.assertEquals
1823

19-
private fun Int.eq(other: Int): Boolean = this == other
20-
21-
private fun Long.eq(other: Long): Boolean = this == other
22-
23-
private fun Float.eq(other: Float): Boolean = this == other
24-
25-
private fun Double.eq(other: Double): Boolean = this == other
26-
27-
private fun Int.eqz(): Boolean = this == 0
28-
29-
private fun Long.eqz(): Boolean = this == 0L
30-
31-
private fun Long.countTrailingZero(): Long = countTrailingZeroBits().toLong()
32-
33-
private fun Long.wrap(): Int = this.toInt()
34-
35-
private fun Float.sqrt(): Float = sqrt(this)
36-
37-
private fun Double.sqrt(): Double = sqrt(this)
38-
3924
class StackExtTest {
4025

4126
@Test
@@ -370,3 +355,23 @@ class StackExtTest {
370355
assertEquals(Stack.MAX_DEPTH, stack.size())
371356
}
372357
}
358+
359+
private fun Int.eq(other: Int): Boolean = this == other
360+
361+
private fun Long.eq(other: Long): Boolean = this == other
362+
363+
private fun Float.eq(other: Float): Boolean = this == other
364+
365+
private fun Double.eq(other: Double): Boolean = this == other
366+
367+
private fun Int.eqz(): Boolean = this == 0
368+
369+
private fun Long.eqz(): Boolean = this == 0L
370+
371+
private fun Long.countTrailingZero(): Long = countTrailingZeroBits().toLong()
372+
373+
private fun Long.wrap(): Int = this.toInt()
374+
375+
private fun Float.sqrt(): Float = kotlin.math.sqrt(this)
376+
377+
private fun Double.sqrt(): Double = kotlin.math.sqrt(this)

executor/runtime/src/commonTest/kotlin/StackTest.kt renamed to executor/runtime/src/commonTest/kotlin/io/github/charlietap/chasm/executor/runtime/StackTest.kt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
package io.github.charlietap.chasm.executor.runtime
12

23
import io.github.charlietap.chasm.fixture.frame
34
import io.github.charlietap.chasm.fixture.label

settings.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ include(":executor:instantiator")
4646
include(":executor:invoker")
4747
include(":executor:memory")
4848
include(":executor:runtime")
49-
include(":executor:runtime-ext")
5049

5150
include(":libs:sse2")
5251
include(":libs:stack")

0 commit comments

Comments
 (0)