blob: b6286de39dad673767947e605640bade7c72a8fc [file] [log] [blame]
function createWasmModule() {
let builder = new Builder();
builder = builder.Type().End()
.Function().End()
.Export().Function("calc").End()
.Code()
.Function("calc", { params: ["i32"], ret: "i32" })
.GetLocal(0)
.GetLocal(0)
.I32Add();
const count = 7000;
for (let i = 0; i < count; i++) {
builder = builder.GetLocal(0).I32Add();
}
builder = builder.Return().End().End();
return new WebAssembly.Module(builder.WebAssembly().get());
}