Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incremental GC #3837

Merged
merged 796 commits into from May 12, 2023
Merged
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
796 commits
Select commit Hold shift + click to select a range
4c89aee
Adjust comment
luc-blaeser Feb 22, 2023
a22018a
Code refactoring
luc-blaeser Feb 22, 2023
54d0334
Barrier optimization
luc-blaeser Feb 22, 2023
075e579
Bug fix
luc-blaeser Feb 22, 2023
a1dfb7e
Pause tuning
luc-blaeser Feb 22, 2023
6dbaf33
GC tuning
luc-blaeser Feb 22, 2023
5f9b48a
Adjust comment
luc-blaeser Feb 23, 2023
fef39be
Update benchmark
luc-blaeser Feb 23, 2023
fb4fcc0
Adjust test for different stack frame sizes
luc-blaeser Feb 23, 2023
96b1ecb
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Feb 23, 2023
a5eaaf6
Remove forwarding pointer test logic
luc-blaeser Feb 23, 2023
c7caef6
Adjust merge
luc-blaeser Feb 23, 2023
77b9277
Adjust merge with generational GC
luc-blaeser Feb 23, 2023
2d4af15
Remove forwarding pointer sanity check logic
luc-blaeser Feb 23, 2023
b5207df
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
7e4c852
Add more forwarding pointer changes
luc-blaeser Feb 23, 2023
7e09745
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
ca39a4b
More forwarding pointer changes
luc-blaeser Feb 23, 2023
fac4442
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
ec820cc
Adjust format and tests
luc-blaeser Feb 23, 2023
37ceebd
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
2e53539
Adjust test result
luc-blaeser Feb 23, 2023
9c86583
Revert unnecessary changes
luc-blaeser Feb 23, 2023
09c81e4
Adjust format
luc-blaeser Feb 23, 2023
19fe816
Reformat
luc-blaeser Feb 23, 2023
f6e31da
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
a16f449
Also use memory check mode for generational GC
luc-blaeser Feb 23, 2023
a2bb7c4
Revert change in run
luc-blaeser Feb 23, 2023
d2c18fe
Adjust comments
luc-blaeser Feb 23, 2023
15102e1
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
b40f1df
Adjust benchmark results
luc-blaeser Feb 23, 2023
3d6c0f6
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
0955b9b
Add missing generational GC ic-ref build
luc-blaeser Feb 23, 2023
831174b
Reenable base test
luc-blaeser Feb 23, 2023
7ec2686
Revert unnecessary changes
luc-blaeser Feb 23, 2023
cb6bb3a
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
196686b
Remove incremental GC implementation
luc-blaeser Feb 23, 2023
40ca7ec
Undo unnecessary changes
luc-blaeser Feb 23, 2023
4dba687
Merge branch 'luc/forwarding_pointer' into luc/incremental-mark-bitmap
luc-blaeser Feb 23, 2023
41d5ad4
Merge branch 'luc/incremental-mark-bitmap' into luc/incremental-prepa…
luc-blaeser Feb 23, 2023
536409e
Remove unnecessary changes
luc-blaeser Feb 23, 2023
268db3e
Adjust test results
luc-blaeser Feb 23, 2023
eb412c3
Revert "Remove incremental GC implementation"
luc-blaeser Feb 23, 2023
aede99c
Revert "Remove unnecessary changes"
luc-blaeser Feb 23, 2023
aa68176
Revert "Adjust test results"
luc-blaeser Feb 23, 2023
003bd6b
Temporarily disable base test
luc-blaeser Feb 23, 2023
0f702d3
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Feb 23, 2023
882dfd8
Merge branch 'luc/incremental-preparation' into luc/incremental-mark-…
luc-blaeser Feb 23, 2023
8b4cb08
Reformat
luc-blaeser Feb 23, 2023
cb29278
Merge branch 'luc/incremental-preparation' into luc/incremental-mark-…
luc-blaeser Feb 23, 2023
d5b8d2b
Adjust test result
luc-blaeser Feb 23, 2023
5298a6a
Adjust test result
luc-blaeser Feb 23, 2023
24e5d8c
Adjust test result
luc-blaeser Feb 23, 2023
255065b
Adjust timer tests for slower incremental GC (in `force-gc` mode)
luc-blaeser Feb 24, 2023
c9a5651
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Feb 24, 2023
c4f7be0
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Feb 24, 2023
5e22983
Merge branch 'luc/incremental-preparation' into luc/incremental-mark-…
luc-blaeser Feb 24, 2023
088767c
Make test more stable for generational GC, especially `ic-ref-run`
luc-blaeser Feb 24, 2023
8ab5ee8
Unstable test results for `ic-ref-run` and incremental GC
luc-blaeser Feb 24, 2023
dca97e0
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Feb 24, 2023
39c1b9d
Skip ic-ref-run in timer test
luc-blaeser Feb 24, 2023
f75cce1
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Feb 28, 2023
736be28
Reenable base tests
luc-blaeser Feb 28, 2023
593f4aa
Update rts/motoko-rts/src/stream.rs
luc-blaeser Feb 28, 2023
9b4fe19
Improve comment
luc-blaeser Feb 28, 2023
2f96966
Unify heap base alignment
luc-blaeser Feb 28, 2023
e21907c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Feb 28, 2023
70f92a4
Resolve merge conflicts
luc-blaeser Feb 28, 2023
e1d1152
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
4655ced
Adjust merge
luc-blaeser Mar 1, 2023
2ed4a94
Adjust test for uniform heap alignment
luc-blaeser Mar 1, 2023
7fd7e97
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 1, 2023
1ac0792
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 1, 2023
3a9520f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
d30d9c6
Improving code comment
luc-blaeser Mar 1, 2023
88c9972
Adjust comment
luc-blaeser Mar 1, 2023
e63a76d
Merge branch 'luc/forwarding_pointer' of https://github.com/dfinity/m…
luc-blaeser Mar 1, 2023
a0851d7
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 1, 2023
b3c71e3
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 1, 2023
2f88dff
Improve comment and format
luc-blaeser Mar 2, 2023
e7d6d68
Optimization: Progress update on non-sliced array
luc-blaeser Mar 6, 2023
fa4bb32
Bug fix: Consider object moving during allocation increments
luc-blaeser Mar 7, 2023
ebb4bb7
Update benchmark result
luc-blaeser Mar 7, 2023
db9a14e
Switch for disabling force GC in certain tests
luc-blaeser Mar 7, 2023
eec88df
Bug fix: Consider object moving during allocation increments
luc-blaeser Mar 7, 2023
3586dea
Adjust benchmark results
luc-blaeser Mar 7, 2023
a5058ed
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 7, 2023
cf295f4
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
60fdc91
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
d2f5d94
Extra forwarding sanity checks for field accesses
luc-blaeser Mar 7, 2023
7e43553
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
f298706
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
80adc3c
ic-ref-run too slow for some timer tests with incremental GC
luc-blaeser Mar 7, 2023
d91c28c
Correct comment
luc-blaeser Mar 7, 2023
ce0016a
Stricter forward check (to be relaxed on higher PR)
luc-blaeser Mar 7, 2023
27c946c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 7, 2023
2bf11ce
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 7, 2023
ca7889e
Revert "Stricter forward check (to be relaxed on higher PR)"
luc-blaeser Mar 7, 2023
1b67786
Bug fix in tabulate - and code comments
luc-blaeser Mar 8, 2023
f7f07e5
Rename iterate function
luc-blaeser Mar 8, 2023
e4deedc
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
2d8d787
Update benchmark result
luc-blaeser Mar 8, 2023
ca21038
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
c451d14
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 8, 2023
487a9a3
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 8, 2023
88a41d4
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 8, 2023
0a9e90c
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 10, 2023
96613d2
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 10, 2023
f0317f6
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 10, 2023
1b472d6
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 15, 2023
52fb919
Merge variant optimization for forwarding pointers
luc-blaeser Mar 15, 2023
b57e1b5
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 15, 2023
ec59c3a
Adjust mutbox write for allocation increments
luc-blaeser Mar 15, 2023
b5e8afc
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 15, 2023
fbc98d1
Improve comment
luc-blaeser Mar 17, 2023
fd2c35a
Refactor static write barrier elimination
luc-blaeser Mar 17, 2023
2c0f3e5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 22, 2023
b176e9c
Squashed commit of the following:
luc-blaeser Mar 22, 2023
8c1a44a
Squashed commit of the following:
luc-blaeser Mar 22, 2023
0e83545
Adjust test run script
luc-blaeser Mar 23, 2023
f830c98
Postpone allocation increment
luc-blaeser Mar 23, 2023
a2465c2
Update benchmark results
luc-blaeser Mar 23, 2023
96995f9
Use the specific GC for drun tests
luc-blaeser Mar 23, 2023
f43b897
Tune the allocation increment factor
luc-blaeser Mar 23, 2023
017b10f
Postpone allocation increments
luc-blaeser Mar 23, 2023
0625fc0
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
9049280
Update benchmark results
luc-blaeser Mar 23, 2023
974b45d
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
d62ea71
Adjust benchmark results
luc-blaeser Mar 23, 2023
4383bff
Squashed commit of the following:
luc-blaeser Mar 23, 2023
12fa14d
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 23, 2023
301b8fe
Adjust benchmark results
luc-blaeser Mar 23, 2023
ed9b1c5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 28, 2023
8600573
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 28, 2023
ad1fd57
Additional merge changes: Array index refactoring
luc-blaeser Mar 28, 2023
f4a7457
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
52935f0
Use two WASM functions for the forwarding check
luc-blaeser Mar 28, 2023
f037531
Prevent time overflow on large GC increments
luc-blaeser Mar 28, 2023
dd5782b
Refactor allocation barrier
luc-blaeser Mar 28, 2023
7e2d1cc
Refactor allocation barrier
luc-blaeser Mar 28, 2023
22289a7
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
040e909
Reformat
luc-blaeser Mar 28, 2023
1a68b8e
Use two WASM functions for the forwarding check
luc-blaeser Mar 28, 2023
4c9aec3
Update benchmark results
luc-blaeser Mar 28, 2023
4e8e363
Family of shared functions for heap allocation
luc-blaeser Mar 28, 2023
cafb090
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
9497da8
Update benchmark results
luc-blaeser Mar 28, 2023
2c0dcf6
Update benchmark results
luc-blaeser Mar 28, 2023
ff67a78
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 28, 2023
2235319
Protect against an accidental restart of a stopped GC
luc-blaeser Mar 28, 2023
f15dc6d
Add an assertion that the GC is not stopped
luc-blaeser Mar 28, 2023
294db87
Refactor memory initialization
luc-blaeser Mar 28, 2023
f98d3a9
Simplify pre-write barrier
luc-blaeser Mar 29, 2023
d9201cd
Improve mark bitmap iterator
luc-blaeser Mar 29, 2023
a17a170
Adjust comment
luc-blaeser Mar 29, 2023
55b896c
Provide rationale for partition size
luc-blaeser Mar 29, 2023
c710a9e
Provide rationale for survival rate threshold
luc-blaeser Mar 29, 2023
26d0172
Introduce constant for max memory size
luc-blaeser Mar 29, 2023
1e919de
Fix typo
luc-blaeser Mar 30, 2023
c1e54ec
Performance optimization
luc-blaeser Mar 31, 2023
e892f2f
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Mar 31, 2023
b677559
Update benchmark results
luc-blaeser Mar 31, 2023
71a1fc1
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Mar 31, 2023
f83aa3e
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Mar 31, 2023
a3e954d
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 5, 2023
9cfef91
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 5, 2023
a2d849f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 5, 2023
d39bcd6
Adjust comment
luc-blaeser Apr 5, 2023
0b05f6e
Guarantee progress on time advance
luc-blaeser Apr 5, 2023
5164da3
Improve debug assertion for mark stack
luc-blaeser Apr 5, 2023
d52662c
Simplify large partition lookup
luc-blaeser Apr 5, 2023
2b054c2
Add debug assertion
luc-blaeser Apr 5, 2023
1e05c58
Explain the allocation partition switch
luc-blaeser Apr 5, 2023
b573e01
Simplify collection heuristics
luc-blaeser Apr 5, 2023
51f2a76
Rename the allocation pointer for bitmap
luc-blaeser Apr 5, 2023
b3977d3
Refactoring: Remove superfluous condition
luc-blaeser Apr 5, 2023
15b5c57
Adjust test case
luc-blaeser Apr 5, 2023
6ce31fa
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 6, 2023
5b8683c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 6, 2023
9899479
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
cec6db1
Correct the variable declaration type
luc-blaeser Apr 6, 2023
564d0d7
Refactoring: Reduce double map into a single map
luc-blaeser Apr 6, 2023
e0cd563
Code refactoring
luc-blaeser Apr 6, 2023
41161eb
Code refactoring
luc-blaeser Apr 6, 2023
eee41e9
Code refactoring
luc-blaeser Apr 6, 2023
15aa49b
Code refactoring
luc-blaeser Apr 6, 2023
9de640f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
d5549f8
Adjust tests for forwarding pointer
luc-blaeser Apr 6, 2023
4395b48
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 6, 2023
1925d03
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 6, 2023
5bd4da2
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 11, 2023
497baa8
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 11, 2023
d070ab2
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 11, 2023
2937ce3
Fix typo in comment
luc-blaeser Apr 11, 2023
65297d6
Improve comment
luc-blaeser Apr 11, 2023
921c9cb
Improve comment
luc-blaeser Apr 11, 2023
e5cf26a
Improve comment
luc-blaeser Apr 11, 2023
61bab8d
Improve comment
luc-blaeser Apr 11, 2023
f4e7ed6
Fix typo in comment
luc-blaeser Apr 11, 2023
04b0158
Use --force-gc in tests explicitly
luc-blaeser Apr 11, 2023
2f035b7
One more case with `--force-gc`
luc-blaeser Apr 11, 2023
9228bc1
Using a sentinel for empty mark stack
luc-blaeser Apr 11, 2023
80c9a5e
Limit evacuations to available free space
luc-blaeser Apr 12, 2023
59449d5
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 12, 2023
dff7277
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
242b2e4
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
3e6fb1c
review: incremental gc suggestions (#3927)
crusso Apr 12, 2023
20a2dba
Reformat
luc-blaeser Apr 12, 2023
a347d5d
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
9fe83ae
Reformat
luc-blaeser Apr 12, 2023
6cfa3fb
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
cf10be8
Improve comment
luc-blaeser Apr 12, 2023
a6d4c72
Fix units in bitmap iterator
luc-blaeser Apr 12, 2023
72af011
Revert unnecessary changes
luc-blaeser Apr 12, 2023
033c263
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 12, 2023
fd5bc9e
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 12, 2023
58d733c
Reformat
luc-blaeser Apr 12, 2023
6f915ff
Adjust memory check to new mark stack sentinel
luc-blaeser Apr 12, 2023
e1e82d3
Memory check: Invalidate tag in original object
luc-blaeser Apr 12, 2023
687b843
Refactor main incremental GC run function
luc-blaeser Apr 13, 2023
0513c82
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser Apr 13, 2023
47d20ee
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser Apr 13, 2023
e5e2d2f
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser Apr 13, 2023
2a7c11d
Bug fix in RTS test
luc-blaeser Apr 14, 2023
2159789
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 1, 2023
910eb1a
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
43b2dfa
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
01c0f8f
Updating nix hashes
github-actions[bot] May 1, 2023
2e7d7f3
Refactoring: Improve quicksort
luc-blaeser May 1, 2023
442eb15
Adjust tests for different stack size
luc-blaeser May 1, 2023
98dce2c
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
c7ba335
Refactoring: Stack size test cases
luc-blaeser May 1, 2023
b680ecc
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 1, 2023
e52ae23
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
fcb4e94
Revert "Updating nix hashes"
luc-blaeser May 1, 2023
33c14d7
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 1, 2023
83cc04e
Use `--force-gc` again by default in tests
luc-blaeser May 4, 2023
09510f7
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 4, 2023
ed82364
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 4, 2023
4ba783a
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 4, 2023
ffb137e
Tuning the GC for the critical heap limit
luc-blaeser May 10, 2023
8d65545
More tuning of the critical GC memory limit
luc-blaeser May 10, 2023
647d517
Merge branch 'master' into luc/forwarding_pointer
luc-blaeser May 10, 2023
0bba417
Merge branch 'luc/forwarding_pointer' into luc/incremental-preparation
luc-blaeser May 10, 2023
97afe73
Merge branch 'luc/incremental-preparation' into luc/incremental-gc
luc-blaeser May 10, 2023
bb76ecf
Use structural equality in OCaml
luc-blaeser May 11, 2023
0457f54
Add GC random test
luc-blaeser May 11, 2023
ce3d393
Prepare `Changelog.md`
luc-blaeser May 11, 2023
cf2f0e0
Document the incremental GC option as beta testing
luc-blaeser May 12, 2023
b1b1e7f
Merge branch 'master' into luc/incremental-gc
luc-blaeser May 12, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions default.nix
Expand Up @@ -361,12 +361,7 @@ rec {
(test_subdir dir deps).overrideAttrs (args: {
EXTRA_MOC_ARGS = "--sanity-checks";
});

compacting_gc_subdir = dir: deps:
(test_subdir dir deps).overrideAttrs (args: {
EXTRA_MOC_ARGS = "--compacting-gc";
});


generational_gc_subdir = dir: deps:
(test_subdir dir deps).overrideAttrs (args: {
EXTRA_MOC_ARGS = "--generational-gc";
Expand All @@ -382,6 +377,10 @@ rec {
EXTRA_MOC_ARGS = "--sanity-checks --generational-gc";
});

snty_incremental_gc_subdir = dir: deps:
(test_subdir dir deps).overrideAttrs (args: {
EXTRA_MOC_ARGS = "--sanity-checks --incremental-gc";
});

perf_subdir = dir: deps:
(test_subdir dir deps).overrideAttrs (args: {
Expand Down Expand Up @@ -498,6 +497,7 @@ rec {
drun-dbg = snty_subdir "run-drun" [ moc nixpkgs.drun ];
drun-compacting-gc = snty_compacting_gc_subdir "run-drun" [ moc nixpkgs.drun ] ;
drun-generational-gc = snty_generational_gc_subdir "run-drun" [ moc nixpkgs.drun ] ;
drun-incremental-gc = snty_incremental_gc_subdir "run-drun" [ moc nixpkgs.drun ] ;
fail = test_subdir "fail" [ moc ];
repl = test_subdir "repl" [ moc ];
ld = test_subdir "ld" ([ mo-ld ] ++ ldTestDeps);
Expand Down
1 change: 1 addition & 0 deletions doc/md/compiler-ref.md
Expand Up @@ -34,6 +34,7 @@ You can use the following options with the `moc` command.
| `-help`,`--help` | Displays usage information. |
| `--hide-warnings` | Hides compiler warnings. |
| `-Werror` | Treat warnings as errors. |
| `--incremental-gc` | Use incremental GC |
| `--idl` | Compile binary and emit Candid IDL specification to `.did` file. |
| `-i` | Runs the compiler in an interactive read–eval–print loop (REPL) shell so you can evaluate program execution (implies -r). |
| `--map` | Outputs a JavaScript source map. |
Expand Down
30 changes: 16 additions & 14 deletions rts/motoko-rts-tests/src/continuation_table.rs
@@ -1,9 +1,12 @@
use std::array::from_fn;

use crate::memory::TestMemory;

use motoko_rts::continuation_table::{
continuation_count, recall_continuation, remember_continuation,
};
use motoko_rts::types::{Value, Words};
use motoko_rts::memory::alloc_blob;
use motoko_rts::types::{size_of, Array, Blob, Bytes, Value, Words};

pub unsafe fn test() {
println!("Testing continuation table ...");
Expand All @@ -13,36 +16,35 @@ pub unsafe fn test() {
const N: usize = 2000; // >256, to exercise `double_continuation_table`

// Array will be doubled 3 times, so 256 + 512 + 1024 + 2048 = 3840 words, plus each array will
// have 2 word header.
let mut heap = TestMemory::new(Words(3848));
// have an array header. Also add the set of N pointers to empty blobs.
let mut heap = TestMemory::new(Words(
3840 + 4 * size_of::<Array>().to_bytes().as_u32()
+ N as u32 * size_of::<Blob>().to_bytes().as_u32(),
));

let pointers: [Value; N] = from_fn(|_| alloc_blob(&mut heap, Bytes(0)));

let mut references: [u32; N] = [0; N];
for i in 0..N {
references[i] = remember_continuation(
&mut heap,
Value::from_raw(((i as u32) << 2).wrapping_sub(1)),
);
references[i] = remember_continuation(&mut heap, pointers[i]);
assert_eq!(continuation_count(), (i + 1) as u32);
}

for i in 0..N / 2 {
let c = recall_continuation(references[i]);
assert_eq!(c.get_raw(), (i << 2).wrapping_sub(1) as u32);
assert_eq!(c.get_ptr(), pointers[i].get_ptr());
assert_eq!(continuation_count(), (N - i - 1) as u32);
}

for i in 0..N / 2 {
references[i] = remember_continuation(
&mut heap,
Value::from_raw(((i as u32) << 2).wrapping_sub(1)),
);
references[i] = remember_continuation(&mut heap, pointers[i]);
assert_eq!(continuation_count(), (N / 2 + i + 1) as u32);
}

for i in (0..N).rev() {
assert_eq!(
recall_continuation(references[i]).get_raw(),
(i << 2).wrapping_sub(1) as u32,
recall_continuation(references[i]).get_ptr(),
pointers[i].get_ptr(),
);
assert_eq!(continuation_count(), i as u32);
}
Expand Down