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
80567554
Verified
Commit
80567554
authored
Apr 25, 2019
by
Camil Staps
🚀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
In wasm garbage collector, allow for empty spaces in the array of references from host to wasm
parent
0f06ce70
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
src-js/abc-interpreter-util.wat
src-js/abc-interpreter-util.wat
+14
-3
No files found.
src-js/abc-interpreter-util.wat
View file @
80567554
...
...
@@ -3,6 +3,9 @@
;;(func $debug (import "clean" "debug") (param i32 i32 i32 i32))
;; to get host references during garbage collection
;; has-host-reference should return a heap pointer when the requested index
;; is found, 0 if it is not found and no higher index is known, or -1 if
;; it is not found but higher indexes may be known
(func $has-host-reference (import "clean" "has_host_reference") (param i32) (result i32))
(func $update-host-reference (import "clean" "update_host_reference") (param i32 i32))
...
...
@@ -190,10 +193,18 @@
(block $end-copy-host-references
(loop $copy-host-references
(local.set $n (call $has-host-reference (local.get $d)))
(br_if $end-copy-host-references (i32.eqz (local.get $n)))
(i32.store (local.get $asp) (local.get $n))
(local.set $new (call $update-ref (local.get $asp) (local.get $new)))
(call $update-host-reference (local.get $d) (i32.load (local.get $asp)))
(if
(i32.gt_s (local.get $n) (i32.const 0))
(then
(i32.store (local.get $asp) (local.get $n))
(local.set $new (call $update-ref (local.get $asp) (local.get $new)))
(call $update-host-reference (local.get $d) (i32.load (local.get $asp)))
)
)
(local.set $d (i32.add (local.get $d) (i32.const 1)))
(br $copy-host-references)
)
...
...
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