summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/binaryen-c.cpp8
-rw-r--r--src/binaryen-c.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp
index 4dff289fb..a9a22ab34 100644
--- a/src/binaryen-c.cpp
+++ b/src/binaryen-c.cpp
@@ -23,9 +23,11 @@
#include "wasm.h"
#include "wasm-binary.h"
#include "wasm-builder.h"
+#include "wasm-interpreter.h"
#include "wasm-printing.h"
#include "wasm-validator.h"
#include "cfg/Relooper.h"
+#include "shell-interface.h"
using namespace wasm;
@@ -484,6 +486,12 @@ BinaryenModuleRef BinaryenModuleRead(char* input, size_t inputSize) {
return wasm;
}
+void BinaryenModuleInterpret(BinaryenModuleRef module) {
+ Module* wasm = (Module*)module;
+ ShellExternalInterface interface;
+ ModuleInstance instance(*wasm, &interface);
+}
+
//
// ========== CFG / Relooper ==========
//
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index a587e03ac..7403d0e81 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -344,6 +344,11 @@ size_t BinaryenModuleWrite(BinaryenModuleRef module, char* output, size_t output
// Deserialize a module from binary form.
BinaryenModuleRef BinaryenModuleRead(char* input, size_t inputSize);
+// Execute a module in the Binaryen interpreter. This will create an instance of
+// the module, run it in the interpreter - which means running the start method -
+// and then destroying the instance.
+void BinaryenModuleInterpret(BinaryenModuleRef module);
+
//
// ========== CFG / Relooper ==========
//