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

Add WeakRef Implementation #337

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Aug 6, 2024

  1. Add WeakRef implementation

    1. Refactor JSObject weak reference list to support different kind of weak reference
    2. Support Symbol as WeakMap key
    LanderlYoung committed Aug 6, 2024
    Configuration menu
    Copy the full SHA
    2ecaf6c View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2024

  1. Change JSObject.weak_ref_list to use a bit and external hash table.

    1. Add a generic hashmap implementation.
    2. Change Error `JSObject.is_uncatchable_error` flag to `JSObject.u.error` struct, leaving room for weak ref flag bit.
    3. Compat `JSString.hash_next` to 31-bits (can be safely compat to 28-bits), leaving room for weak ref flag bit.
    
    Save memory for each JSObject (8 bytes on 64-bit platform, 4 bytes on 32-bit platform).
    LanderlYoung committed Aug 14, 2024
    Configuration menu
    Copy the full SHA
    6b073af View commit details
    Browse the repository at this point in the history