Skip to content
New issue

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

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

Already on GitHub? # to your account

Add a separate GC stack for tracking GC preserved objects, and add hooks for GC preserve regions #87

Closed
wants to merge 1 commit into from

Conversation

qinsoon
Copy link
Member

@qinsoon qinsoon commented Feb 7, 2025

This PR adds two things:

  1. a different shadow stack to record objects that are GC preserved. We need to be able to identify those objects, and they are different from the objects in the normal stack.
  2. GC-specific hooks that are inserted for GC.@preserve regions, and related refactoring for code gen. Each GC can deal with the semantics of GC.@preserve based on its implementation.

There could be an alternative implementation for 1. Instead of having a different shadow stack, we just use an extra bit to encode whether the objects is from GC preserve, or from normal GC push. This would require changing the stock GC to handle the extra bit. But this is definitely viable.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant