Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
clean-and-itasks
abc-interpreter
Commits
55620e70
Verified
Commit
55620e70
authored
Apr 30, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimise gc loop: CHAR and REAL never appear here, because they are always static
parent
defa6697
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
src-js/abc-interpreter-util.wat
src-js/abc-interpreter-util.wat
+6
-11
src/gc.c
src/gc.c
+2
-4
No files found.
src-js/abc-interpreter-util.wat
View file @
55620e70
...
...
@@ -244,13 +244,8 @@
(if
(i32.or
(i32.eq (local.get $d) (i32.const 210)) ;; INT+2
(i32.or
(i32.eq (local.get $d) (i32.const 130)) ;; CHAR+2
(i32.or
(i32.eq (local.get $d) (i32.const 90)) ;; BOOL+2
(i32.eq (local.get $d) (i32.const 170)) ;; REAL+2
)
)
(i32.eq (local.get $d) (i32.const 170)) ;; REAL+2
;; BOOL and CHAR are always static so cannot occur here
)
(then
(local.set $n (i32.add (local.get $n) (i32.const 16)))
...
...
@@ -625,7 +620,7 @@
)
(if
(i32.eq (local.get $arity)
(i32.const 0)
)
(i32.eq
z
(local.get $arity))
(then
(local.set $d (i32.sub (local.get $d) (i32.const 10)))
(i64.store (local.get $ref) (i64.extend_i32_u (local.get $d)))
...
...
@@ -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)))
(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)))
;; "loop"
;;(call $debug (local.get $desc) (local.get $i) (local.get $len) (local.get $hp))
(if ;; redirection or predefined constructor
(i32.lt_s (local.get $desc) (i32.const 0))
(then
...
...
src/gc.c
View file @
55620e70
...
...
@@ -225,10 +225,8 @@ BC_WORD *garbage_collect(BC_WORD *stack, BC_WORD *asp,
#endif
if
(
d
&
2
)
{
if
(
d
==
(
BC_WORD
)
&
INT
+
2
||
d
==
(
BC_WORD
)
&
BOOL
+
2
||
d
==
(
BC_WORD
)
&
CHAR
+
2
||
d
==
(
BC_WORD
)
&
REAL
+
2
)
{
if
(
d
==
(
BC_WORD
)
&
INT
+
2
||
d
==
(
BC_WORD
)
&
REAL
+
2
)
{
/* CHAR and BOOL are always unboxed */
n
+=
2
;
continue
;
}
else
if
(
d
==
(
BC_WORD
)
&
__STRING__
+
2
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment