Skip to content

Type-safe Embind port, compatible with the current API #7553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9cd6c7d
Initial commit: update CMakeLists and add some basic embind functiona…
GulgDev Apr 25, 2025
a8f3995
Extend embind functionality
GulgDev Apr 25, 2025
515e6a1
Add automatic expression generation and move away from C API
GulgDev Apr 25, 2025
f23396f
Switch to direct bindings
GulgDev Apr 26, 2025
38354b1
Transform expression factories into inline structs
GulgDev Apr 26, 2025
4216539
Merge branch 'main' of https://github.com/WebAssembly/binaryen into c…
GulgDev Apr 26, 2025
f87350c
Switch to C++ API
GulgDev Apr 26, 2025
9da6d8b
Extend API
GulgDev Apr 27, 2025
89e7f4f
Clean up
GulgDev Apr 27, 2025
8440c8f
Add more pass functions
GulgDev Apr 27, 2025
91cf1ee
Fix bugs
GulgDev Apr 27, 2025
d1b425b
Fix memory corruption
GulgDev Apr 27, 2025
5fde9ba
Fix the `Maximum call stack size exceeded` bug!
GulgDev Apr 29, 2025
b81cd4b
Extend expression wrapper field support
GulgDev Apr 29, 2025
2341097
Make expression building functions return specific classes
GulgDev Apr 29, 2025
6ff26de
Fix field bindings
GulgDev Apr 30, 2025
cb2bf97
Fix
GulgDev Apr 30, 2025
0fb5df7
Add boolean fields & do some fixes
GulgDev Apr 30, 2025
2fd493e
Add expression info & fix UB
GulgDev Apr 30, 2025
fd1d914
Refactor
GulgDev May 1, 2025
df7edea
Add vector field type
GulgDev May 1, 2025
c9eb24b
Add vector type to expression info
GulgDev May 1, 2025
2e1fff2
Extend instruction set
GulgDev May 1, 2025
c1f9fd0
Add missing instructions
GulgDev May 1, 2025
db647e2
Update instructions
GulgDev May 1, 2025
f865de4
Fix const
GulgDev May 1, 2025
64ee7d4
Fix bugs & update tests
GulgDev May 1, 2025
7a35cd1
Add general instructions
GulgDev May 1, 2025
9555a78
Add name list field & fix vector set
GulgDev May 1, 2025
478a4f5
Add CallIndirect
GulgDev May 1, 2025
a3ef118
Fix `createType`
GulgDev May 1, 2025
ed6d36b
Add `isTee`
GulgDev May 1, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add isTee
  • Loading branch information
GulgDev committed May 1, 2025
commit ed6d36be7895e4a3bd228e929c601922995a9209
19 changes: 17 additions & 2 deletions src/binaryen-embind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,11 @@ val getExpressionInfo(wasm::Expression* expr) {
info.set("results", binaryen::TypeID(signature.results.getID()));
break;
}
case Expression::Id::LocalSetId: {
auto* cast = expr->cast<wasm::LocalSet>();
info.set("isTee", cast->isTee());
break;
}
default:
break;
}
Expand Down Expand Up @@ -1281,9 +1286,19 @@ EMSCRIPTEN_BINDINGS(Binaryen) {
expr.heapType = wasm::Signature(expr.heapType.getSignature().params,
wasm::Type(value));
};
ACCESSOR(CallIndirectWrapper, getterName.c_str(), +getter);
ACCESSOR(CallIndirectWrapper, setterName.c_str(), +setter);
ACCESSOR(CallIndirectWrapper, getterName.c_str(), getter);
ACCESSOR(CallIndirectWrapper, setterName.c_str(), setter);
CallIndirectWrapper.property(propName.c_str(), +getter, +setter);
}
}

{ // LocalSet
{
std::string propName = "tee";
std::string getterName = BOOL_GETTER_NAME(propName);
auto getter = [](const wasm::LocalSet& expr) { return expr.isTee(); };
ACCESSOR(LocalSetWrapper, getterName.c_str(), getter);
LocalSetWrapper.property(propName.c_str(), +getter);
}
}
}
Loading