Verified Commit ab97d96e authored by Camil Staps's avatar Camil Staps 🚀

Fix garbage collection of CAFs in wasm interpreter

parent a7841fc8
Pipeline #23098 passed with stages
in 12 minutes and 58 seconds
......@@ -190,8 +190,8 @@
(local.set $n (i32.add (global.get $caf-list) (i32.const 8)))
(block $end-copy-cafs
(loop $copy-cafs
(br_if $end-copy-cafs (i32.eqz (i32.load (i32.sub (local.get $n) (i32.const 8)))))
(local.set $n (i32.load (i32.sub (local.get $n) (i32.const 8))))
(br_if $end-copy-cafs (i32.eqz (local.get $n)))
(local.set $a-arity (i32.load16_s (local.get $n)))
(block $end-copy-caf-pointers
(loop $copy-caf-pointers
......
......@@ -132,7 +132,7 @@ intp = new Uint8Array(intp);
}
}
);
util.instance.exports.setup_gc(hp, heap_size, asp, 98*8);
util.instance.exports.setup_gc(hp, heap_size, asp, 97*8);
intp = await WebAssembly.instantiate(intp,
{
......
......@@ -30,7 +30,7 @@ uint64_t prelinker_preamble[669] = {
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
0,0,
/* 96 */ 0, 97*8, /* caf list */
/* 96 */ 0, 98*8, /* caf list */
/* 98 */
Cjmp_ap1, Cjmp_ap2, Cjmp_ap3, Cjmp_ap4, Cjmp_ap5,
Cjmp_ap6, Cjmp_ap7, Cjmp_ap8, Cjmp_ap9, Cjmp_ap10,
......
[1993,1,1993]
[1993,1993,1,1993,1993]
halt at 4
121339 402949 524288
162345 361943 524288
[1993,1,1993]
[1993,1993,1,1993,1993]
halt at 4
128551 133593 262144
174456 87688 262144
......@@ -9,8 +9,19 @@ primes :: [Int]
primes =: [2,3,5:[p \\ p <- [7,9..]
| not (any (\d->p rem d==0) (takeWhile (\d->d*d<=p) primes))]]
:: SymPrime = SymPrime Int Int Int !Int !Int
symprime p :== SymPrime p 37 42 47 52
fromsymprime (SymPrime p 37 42 47 52) :== p
symprimes :: [SymPrime]
symprimes =: [symprime 2,symprime 3,symprime 5:[symprime p \\ p <- [7,9..]
| not (any (\d->p rem fromsymprime d==0) (takeWhile (\(SymPrime d 37 42 47 52)->d*d<=p) symprimes))]]
Start =
[ primes!!300
, fromsymprime (symprimes!!300)
, hd (iter 200 reverse [1..1000])
, primes!!300
, fromsymprime (symprimes!!300)
]
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