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

Check for Strings sooner in the garbage collectors

parent 1f2ff843
Pipeline #49537 failed with stages
in 26 minutes and 26 seconds
......@@ -1061,6 +1061,24 @@
)
)
)
(if
;; _STRING_+2
(i32.eq (local.get $d) (i32.const 42))
(then
(local.set $size (i32.shr_u (i32.add (i32.load offset=8 (local.get $n)) (i32.const 7)) (i32.const 3)))
(local.set $hp-end (i32.sub (i32.sub (local.get $hp-end) (i32.const 16)) (i32.shl (local.get $size) (i32.const 3))))
(i64.store (local.get $hp-end) (i64.extend_i32_u (local.get $d)))
(call $copy
(i32.add (local.get $hp-end) (i32.const 8))
(i32.add (local.get $n) (i32.const 8))
(i32.add (local.get $size) (i32.const 1)))
(i64.store (local.get $ref) (i64.extend_i32_u (local.get $hp-end)))
(i64.store (local.get $n) (i64.extend_i32_u (i32.add (local.get $hp-end) (i32.const 1))))
(return (local.get $hp-new) (local.get $hp-end))
)
)
(if
(i32.eq (local.get $d) (i32.const 82)) ;; BOOL+2
(then
......@@ -1091,24 +1109,6 @@
(return (local.get $hp-new) (local.get $hp-end))
)
)
(if
;; _STRING_+2
(i32.eq (local.get $d) (i32.const 42))
(then
(local.set $size (i32.shr_u (i32.add (i32.load offset=8 (local.get $n)) (i32.const 7)) (i32.const 3)))
(local.set $hp-end (i32.sub (i32.sub (local.get $hp-end) (i32.const 16)) (i32.shl (local.get $size) (i32.const 3))))
(i64.store (local.get $hp-end) (i64.extend_i32_u (local.get $d)))
(call $copy
(i32.add (local.get $hp-end) (i32.const 8))
(i32.add (local.get $n) (i32.const 8))
(i32.add (local.get $size) (i32.const 1)))
(i64.store (local.get $ref) (i64.extend_i32_u (local.get $hp-end)))
(i64.store (local.get $n) (i64.extend_i32_u (i32.add (local.get $hp-end) (i32.const 1))))
(return (local.get $hp-new) (local.get $hp-end))
)
)
(if
;; _ARRAY_+2
(i32.eq (local.get $d) (i32.const 2))
......
......@@ -61,6 +61,14 @@ static inline struct heap_pointers update_ref(BC_WORD *old, size_t heap_size,
*n=(BC_WORD)hp.end+1;
}
return hp;
} else if (d==(BC_WORD)&__STRING__+2){
unsigned int size=n[1];
size=(size+IF_INT_64_OR_32(7,3))/IF_INT_64_OR_32(8,4);
hp.end-=2+size;
memcpy (hp.end,n,(size+2)*sizeof(BC_WORD));
*n=(BC_WORD)hp.end+1;
*ref=hp.end;
return hp;
} else if (d==(BC_WORD)&BOOL+2){
BC_WORD *shared_node=&static_booleans[n[1] ? 2 : 0];
*ref=shared_node;
......@@ -86,14 +94,6 @@ static inline struct heap_pointers update_ref(BC_WORD *old, size_t heap_size,
*ref=hp.end;
*n=(BC_WORD)hp.end+1;
return hp;
} else if (d==(BC_WORD)&__STRING__+2){
unsigned int size=n[1];
size=(size+IF_INT_64_OR_32(7,3))/IF_INT_64_OR_32(8,4);
hp.end-=2+size;
memcpy (hp.end,n,(size+2)*sizeof(BC_WORD));
*n=(BC_WORD)hp.end+1;
*ref=hp.end;
return hp;
} else if (d==(BC_WORD)&__ARRAY__+2){
unsigned int size=n[1];
d=n[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