Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## v0.5.1197 — feat(runtime): #2656 — make WeakMap/WeakSet actually weak

WeakMap/WeakSet previously stored entries as plain `[key, value]` pair arrays that the
GC traced strongly, so keys were never collected — weak in API only. Entries are now
`CLASS_ID_WEAK_ENTRY` objects whose field-0 key is a weak GC slot (skipped by the
strong-edge scanners, exactly like a WeakRef target / finalization-record target), with
the value in field 1 (strong; `undefined` for a WeakSet, so the member isn't pinned
through the value slot). The post-mark weak pass tombstones entries whose key was
collected — nulling both slots so the value is released — and lookups treat a
tombstoned (undefined-key) entry as empty. `set` reuses tombstone slots and `delete`
compacts them, bounding growth. This directly reuses the existing WeakRef/
FinalizationRegistry weak-slot machinery (`is_weak_target_trace_slot`,
`weak_target_should_clear`, the post-mark walk) — no new GC phase.

A key/value reachable only through the collection is now collectible; live entries are
retained and values released when their key dies. Verified under the default GC and the
auto-evacuation policy. Regression test:
`crates/perry/tests/issue_2656_weak_collections_actually_weak.rs`.

Out of scope: the `PERRY_GC_FORCE_EVACUATE` full-evacuation debug-stress mode
over-collects weak targets in general (FinalizationRegistry has the same limitation) and
is also subject to the separate strong-array-in-closure bug #5467 — no production GC mode
(default, auto-evacuation) is affected.

## v0.5.1196 — fix(codegen): #5431 — cross-module call to a `$`-named exported function returned `undefined`

Calling an exported function whose name contains a non-`[A-Za-z0-9_]` character (e.g.
Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

Perry is a native TypeScript compiler written in Rust that compiles TypeScript source code directly to native executables. It uses SWC for TypeScript parsing and LLVM for code generation.

**Current Version:** 0.5.1196
**Current Version:** 0.5.1197


## TypeScript Parity Status
Expand Down
Loading
Loading