Skip to content

Commit

Permalink
Change JSObject.weak_ref_list to use a bit and external hash table.
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
LanderlYoung committed Aug 13, 2024
1 parent 2ecaf6c commit ba55652
Show file tree
Hide file tree
Showing 4 changed files with 520 additions and 113 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Optimization ideas:
- add implicit numeric strings for Uint32 numbers?
- optimize `s += a + b`, `s += a.b` and similar simple expressions
- ensure string canonical representation and optimise comparisons and hashes?
- remove JSObject.first_weak_ref, use bit+context based hashed array for weak references
- property access optimization on the global object, functions,
prototypes and special non extensible objects.
- create object literals with the correct length by backpatching length argument
Expand Down
Loading

0 comments on commit ba55652

Please sign in to comment.