Skip to content

Commit 6b073af

Browse files
committed
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).
1 parent 2ecaf6c commit 6b073af

File tree

4 files changed

+520
-113
lines changed

4 files changed

+520
-113
lines changed

Diff for: TODO

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ Optimization ideas:
4747
- add implicit numeric strings for Uint32 numbers?
4848
- optimize `s += a + b`, `s += a.b` and similar simple expressions
4949
- ensure string canonical representation and optimise comparisons and hashes?
50-
- remove JSObject.first_weak_ref, use bit+context based hashed array for weak references
5150
- property access optimization on the global object, functions,
5251
prototypes and special non extensible objects.
5352
- create object literals with the correct length by backpatching length argument

0 commit comments

Comments
 (0)