Verified Commit 55620e70 authored by Camil Staps's avatar Camil Staps 🚀

Optimise gc loop: CHAR and REAL never appear here, because they are always static

parent defa6697
...@@ -244,13 +244,8 @@ ...@@ -244,13 +244,8 @@
(if (if
(i32.or (i32.or
(i32.eq (local.get $d) (i32.const 210)) ;; INT+2 (i32.eq (local.get $d) (i32.const 210)) ;; INT+2
(i32.or (i32.eq (local.get $d) (i32.const 170)) ;; REAL+2
(i32.eq (local.get $d) (i32.const 130)) ;; CHAR+2 ;; BOOL and CHAR are always static so cannot occur here
(i32.or
(i32.eq (local.get $d) (i32.const 90)) ;; BOOL+2
(i32.eq (local.get $d) (i32.const 170)) ;; REAL+2
)
)
) )
(then (then
(local.set $n (i32.add (local.get $n) (i32.const 16))) (local.set $n (i32.add (local.get $n) (i32.const 16)))
...@@ -625,7 +620,7 @@ ...@@ -625,7 +620,7 @@
) )
(if (if
(i32.eq (local.get $arity) (i32.const 0)) (i32.eqz (local.get $arity))
(then (then
(local.set $d (i32.sub (local.get $d) (i32.const 10))) (local.set $d (i32.sub (local.get $d) (i32.const 10)))
(i64.store (local.get $ref) (i64.extend_i32_u (local.get $d))) (i64.store (local.get $ref) (i64.extend_i32_u (local.get $d)))
...@@ -753,14 +748,14 @@ ...@@ -753,14 +748,14 @@
) )
) )
;; "loop"
;;(call $debug (i32.const 0) (local.get $i) (local.get $len) (local.get $hp))
(i32.store16 (local.get $a-size-stack) (i32.sub (i32.load16_s (local.get $a-size-stack)) (i32.const 1))) (i32.store16 (local.get $a-size-stack) (i32.sub (i32.load16_s (local.get $a-size-stack)) (i32.const 1)))
(local.set $desc (i32.load (i32.add (local.get $s) (local.get $i)))) (local.set $desc (i32.load (i32.add (local.get $s) (local.get $i))))
(i64.store (i32.add (local.get $s) (local.get $i)) (i64.extend_i32_u (local.get $hp))) (i64.store (i32.add (local.get $s) (local.get $i)) (i64.extend_i32_u (local.get $hp)))
;; "loop"
;;(call $debug (local.get $desc) (local.get $i) (local.get $len) (local.get $hp))
(if ;; redirection or predefined constructor (if ;; redirection or predefined constructor
(i32.lt_s (local.get $desc) (i32.const 0)) (i32.lt_s (local.get $desc) (i32.const 0))
(then (then
......
...@@ -225,10 +225,8 @@ BC_WORD *garbage_collect(BC_WORD *stack, BC_WORD *asp, ...@@ -225,10 +225,8 @@ BC_WORD *garbage_collect(BC_WORD *stack, BC_WORD *asp,
#endif #endif
if (d & 2) { if (d & 2) {
if (d == (BC_WORD)&INT+2 if (d == (BC_WORD)&INT+2 || d == (BC_WORD)&REAL+2) {
|| d == (BC_WORD)&BOOL+2 /* CHAR and BOOL are always unboxed */
|| d == (BC_WORD)&CHAR+2
|| d == (BC_WORD)&REAL+2) {
n+=2; n+=2;
continue; continue;
} else if (d == (BC_WORD)&__STRING__+2) { } else if (d == (BC_WORD)&__STRING__+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