COLLECTION

GC

After implementing Omoikane’s DOM and exception notifications, we ended up investigating copying and garbage‑collection lifetimes as well.

This article provides a detailed overview of the DOM manipulation, HTML parsing, sanitizer, and exception/Promise‑rejection notifications added in Omoikane’s PR #1322. It traces the garbage‑collection lifetime issue that arose in Boa’s Promise.finally, examines iframe navigation and document ownership, discusses copy reduction, local measurements and the final CI run, and outlines the remaining challenges.

→

WeakMap and Generational Garbage Collection

This article explains the issue that occurred in the Rust‑based JavaScript engine Boa, where references via ephemerons were incorrectly reclaimed by the generational garbage collector. It covers the conditions for retaining WeakMap values, the calculation of fixed points, the recording of writes from older parents to younger children, the reasons references were lost after a major GC, and the regression tests that tracked the problem.

→

What is a WeakMap?

This article explains how JavaScript’s WeakMap does not retain its keys, comparing it with a regular Map and using code examples. It covers auxiliary information for objects, key identity, the reason it cannot be enumerated, references from values to keys, and handling of ephemerons.

→

The object returned by Boa’s getter was collected by the garbage collector while the inline cache was being updated.

Investigating the SIGSEGV that occurred in Omoikane’s WPT revealed that the new object returned by Boa’s getter in the Rust‑based JavaScript engine was being reclaimed during the inline‑cache update before it could be placed in a VM register. We are isolating the issue with the JIT, verifying it with Valgrind, and tracking the root fix along with regression tests.

→