Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Current Trunk
- Replace BinaryenSIMDBitselect* with BinaryenSIMDTernary* in the C API and add
qfma/qfms instructions.
- Added `offset` parameter to BinaryenSetFunctionTable.
- Add the ability to create multivalue Types in the C and JS APIs.
- Remove named function types. They are replaced by `params` and `results` types
local to each function.

v88
---
Expand Down
3 changes: 2 additions & 1 deletion scripts/clean_c_api_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
trace = open(sys.argv[1]).read()

start = trace.find('// beginning a Binaryen API trace')
end = trace.rfind('// ending a Binaryen API trace')
if start >= 0:
trace = trace[start:]
trace = trace[start:end]

while 1:
start = trace.find('\n(')
Expand Down
30 changes: 14 additions & 16 deletions src/abi/js.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,20 @@ extern cashew::IString SCRATCH_STORE_F64;
inline void
ensureScratchMemoryHelpers(Module* wasm,
cashew::IString specific = cashew::IString()) {
auto ensureImport =
[&](Name name, const std::vector<Type> params, Type result) {
if (wasm->getFunctionOrNull(name)) {
return;
}
if (specific.is() && name != specific) {
return;
}
auto func = make_unique<Function>();
func->name = name;
func->params = params;
func->result = result;
func->module = ENV;
func->base = name;
wasm->addFunction(std::move(func));
};
auto ensureImport = [&](Name name, Type params, Type results) {
if (wasm->getFunctionOrNull(name)) {
return;
}
if (specific.is() && name != specific) {
return;
}
auto func = make_unique<Function>();
func->name = name;
func->sig = Signature(params, results);
func->module = ENV;
func->base = name;
wasm->addFunction(std::move(func));
};

ensureImport(SCRATCH_LOAD_I32, {i32}, i32);
ensureImport(SCRATCH_STORE_I32, {i32, i32}, none);
Expand Down
4 changes: 2 additions & 2 deletions src/abi/stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ getStackSpace(Index local, Function* func, Index size, Module& wasm) {
// no need to restore the old stack value, we're gone anyhow
} else {
// save the return value
auto temp = builder.addVar(func, func->result);
auto temp = builder.addVar(func, func->sig.results);
block->list.push_back(builder.makeLocalSet(temp, func->body));
block->list.push_back(makeStackRestore());
block->list.push_back(builder.makeLocalGet(temp, func->result));
block->list.push_back(builder.makeLocalGet(temp, func->sig.results));
}
block->finalize();
func->body = block;
Expand Down
Loading