Skip to content

Commit 7229ee6

Browse files
committed
Remove emscripten runtime originally for issue #7
1 parent 2dddd90 commit 7229ee6

File tree

19 files changed

+1
-21501
lines changed

19 files changed

+1
-21501
lines changed

.gitignore

-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
/compiler/bin
1212
/compiler/build
1313
/compiler/out
14-
/emscripten-runtime/bin
15-
/emscripten-runtime/build
16-
/emscripten-runtime/out
1714
/annotations/bin
1815
/annotations/build
1916
/annotations/out

build.gradle

+1-8
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,6 @@ allprojects {
2525
}
2626
}
2727

28-
project(':emscripten-runtime') {
29-
dependencies {
30-
compile project(':annotations')
31-
}
32-
}
33-
3428
project(':compiler') {
3529
apply plugin: 'kotlin'
3630
apply plugin: 'application'
@@ -42,8 +36,7 @@ project(':compiler') {
4236
distZip.archiveName = 'asmble.zip'
4337

4438
dependencies {
45-
compile project(':emscripten-runtime')
46-
39+
compile project(':annotations')
4740
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
4841
compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
4942
compile "org.ow2.asm:asm-tree:$asm_version"

compiler/src/main/kotlin/asmble/io/Emscripten.kt

-21
This file was deleted.

compiler/src/test/kotlin/asmble/BaseTestUnit.kt

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package asmble
22

33
import asmble.ast.SExpr
44
import asmble.ast.Script
5-
import asmble.io.Emscripten
65
import asmble.io.SExprToAst
76
import asmble.io.StrToSExpr
87

@@ -13,7 +12,6 @@ open class BaseTestUnit(val name: String, val wast: String, val expectedOutput:
1312
open val shouldFail get() = false
1413
open val skipRunReason: String? get() = null
1514
open val defaultMaxMemPages get() = 1
16-
open val emscriptenMetadata by lazy { Emscripten.metadataFromWast(wast) }
1715
open val parseResult: StrToSExpr.ParseResult.Success by lazy {
1816
StrToSExpr.parse(wast).let {
1917
when (it) {

compiler/src/test/kotlin/asmble/run/jvm/TestRunner.kt

-26
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import asmble.io.ByteWriter
99
import asmble.io.SExprToStr
1010
import org.junit.Assume
1111
import org.junit.Test
12-
import run.jvm.emscripten.Env
1312
import java.io.ByteArrayOutputStream
1413
import java.io.OutputStreamWriter
1514
import java.io.PrintWriter
@@ -44,16 +43,6 @@ abstract class TestRunner<out T : BaseTestUnit>(val unit: T) : TestBase() {
4443
includeBinaryInCompiledClass = true
4544
).withHarnessRegistered(PrintWriter(OutputStreamWriter(out, Charsets.UTF_8), true))
4645

47-
// If there's a staticBump, we are an emscripten mod and we need to include the env
48-
var emEnv: Env? = null
49-
unit.emscriptenMetadata?.also {
50-
emEnv = Env(it.staticBump, out, "unknown-program")
51-
val mods = Env.subModules.fold(listOf(Module.Native(emEnv!!))) { mods, subMod ->
52-
mods + Module.Native(subMod.apply(emEnv))
53-
}
54-
scriptContext = scriptContext.withModuleRegistered("env", Module.Composite(mods))
55-
}
56-
5746
// This will fail assertions as necessary
5847
scriptContext = unit.script.commands.fold(scriptContext) { scriptContext, cmd ->
5948
try {
@@ -65,21 +54,6 @@ abstract class TestRunner<out T : BaseTestUnit>(val unit: T) : TestBase() {
6554
}
6655
}
6756

68-
// If there is a main, we run it w/ no args because emscripten doesn't set it as the start func
69-
scriptContext.modules.lastOrNull()?.also { lastMod ->
70-
lastMod.cls.methods.find { it.name == "main" && it.returnType == Int::class.java }?.let { mainMethod ->
71-
if (mainMethod.parameterTypes.isEmpty())
72-
mainMethod.invoke(lastMod.instance(scriptContext))
73-
else if (mainMethod.parameterTypes.asList() == listOf(Int::class.java, Int::class.java))
74-
mainMethod.invoke(lastMod.instance(scriptContext), emEnv?.argc ?: 0, emEnv?.argv ?: 0)
75-
else
76-
error("Unrecognized main method params for $mainMethod")
77-
}
78-
}
79-
80-
// If there was an emscripten env, we have to run the exit callbacks
81-
emEnv?.also { it.runAtExitCallbacks(scriptContext.modules.last().instance(scriptContext)) }
82-
8357
// Check the output
8458
unit.expectedOutput?.let {
8559
// Sadly, sometimes the expected output is trimmed in Emscripten tests

compiler/src/test/kotlin/asmble/run/jvm/emscripten/EmscriptenTest.kt

-19
This file was deleted.

compiler/src/test/kotlin/asmble/run/jvm/emscripten/EmscriptenTestUnit.kt

-98
This file was deleted.

compiler/src/test/resources/local-spec/expected-output/hello.wast.log

-1
This file was deleted.

compiler/src/test/resources/local-spec/hello.c

-4
This file was deleted.

0 commit comments

Comments
 (0)