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

Low-cost revocation via altered GC semantics #24

Open
dead-claudia opened this issue Sep 30, 2023 · 0 comments
Open

Low-cost revocation via altered GC semantics #24

dead-claudia opened this issue Sep 30, 2023 · 0 comments

Comments

@dead-claudia
Copy link

dead-claudia commented Sep 30, 2023

Partial duplicate of #10 but goes a bit further.

So here's the idea:

  • Symbols get an implicit [[Revoked]] boolean property. In practice, this could be modeled via a bit flag or an internal weak set. (It still must be concurrency-safe, so a bit flag is likely ideal.)
  • In the spec, a proxy is considered "revoked" if it has a revocation symbol with a [[Revoked]] property set to true.
  • In engines, while scanning proxies, if a proxy has a revocation symbol with that field set, the handler now becomes safely collectable. The act of setting that property is sufficient to trigger a possible GC check, much like an object going out of scope.

Doing it this way also has a benefit: there's no need for a dedicated factory for such symbols. You can just create them normally via Symbol.

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

No branches or pull requests

1 participant