Verified Commit dd6d2353 authored by Camil Staps's avatar Camil Staps 🙂

Fix wasm garbage collector, also look at bottom of A-stack

parent 55620e70
......@@ -137,7 +137,7 @@
(global.set $start-heap (local.get 0))
(global.set $half-heap (i32.add (local.get 0) (local.get 1)))
(global.set $end-heap (i32.add (local.get 0) (i32.add (local.get 1) (local.get 1))))
(global.set $stack (local.get 2))
(global.set $stack (i32.sub (local.get 2) (i32.const 8)))
(global.set $caf-list (local.get 3))
)
(func (export "set_js_ref_constructor") (param i32)
......
......@@ -2831,7 +2831,7 @@ all_instructions opts t = bootstrap $ collect_instructions opts $ map (\i -> i t
new_local TWord (s @ 1) \l ->
if_then (end_i >. to_int l) (end_i .= to_int l) :.
l .= to_word (end_i - first_i) :.
new_local TWord (if_i64_or_i32_expr ((l + lit_word 7) / lit_word 8) ((l + lit_word 3) / lit_word 4) + lit_word 2) \lw ->
new_local TWord (if_i64_or_i32_expr ((l + lit_word 7) >>. lit_word 3) ((l + lit_word 3) >>. lit_word 2) + lit_word 2) \lw ->
ensure_hp lw :.
shrink_b 2 :.
Hp @ 0 .= STRING__ptr + lit_word 2 :.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment