Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
abc-interpreter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
8
Issues
8
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
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 @@
...
@@ -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.eq
z (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
...
...
src/gc.c
View file @
55620e70
...
@@ -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
)
{
...
...
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