Skip to content

Commit

Permalink
enable wasm stringref in v8
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdovzhanyn committed Oct 2, 2024
1 parent e033757 commit a7dd367
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/compiler/CodeGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ namespace Theta {
MEMORY_NAME.c_str()
);

// BinaryenAddTable(
// module,
// STRINGREF_TABLE.c_str(),
// 1000,
// 100000000,
// BinaryenTypeStringref()
// );
BinaryenAddTable(
module,
STRINGREF_TABLE.c_str(),
1000,
100000000,
BinaryenTypeStringref()
);

StandardLibrary::registerFunctions(module);

Expand Down
2 changes: 2 additions & 0 deletions src/runtime/Runtime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdexcept>
#include "runtime/ExecutionContext.hpp"
#include <iostream>
#include <v8.h>

using namespace std;

Expand Down Expand Up @@ -68,6 +69,7 @@ namespace Theta {

private:
Runtime() {
v8::V8::SetFlagsFromString("--experimental-wasm-stringref");
engine = wasm::Engine::make();
store = wasm::Store::make(engine.get());
}
Expand Down

0 comments on commit a7dd367

Please sign in to comment.