Skip to content

fix(ext/node): implement node:v8 heap APIs#32483

Merged
bartlomieju merged 2 commits intomainfrom
v8_heap
Mar 5, 2026
Merged

fix(ext/node): implement node:v8 heap APIs#32483
bartlomieju merged 2 commits intomainfrom
v8_heap

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

@bartlomieju bartlomieju commented Mar 5, 2026

Summary

  • Implements v8.getHeapSpaceStatistics(), v8.getHeapCodeStatistics(), v8.getHeapSnapshot(), and v8.writeHeapSnapshot() from the node:v8 module
  • Bumps v8 crate from 146.1.0 to 146.3.0 (includes HeapCodeStatistics API from rusty_v8 PR Implement import-maps #1921)
  • Converts ext/node/polyfills/v8.ts to v8.js
  • Enables node compat tests: test-heapdump.js, test-v8-getheapsnapshot-twice.js, test-v8-stats.js

Factored out from #32457 (coverage APIs will follow in a separate PR).

Implements several missing `node:v8` APIs:
- `v8.getHeapSpaceStatistics()` - returns per-space heap statistics
- `v8.getHeapCodeStatistics()` - real implementation using v8 146.3.0
- `v8.getHeapSnapshot()` - returns a Readable stream of heap snapshot JSON
- `v8.writeHeapSnapshot(filename?, options?)` - writes heap snapshot to file

Also bumps the v8 crate from 146.1.0 to 146.3.0, converts
`ext/node/polyfills/v8.ts` to `v8.js`, and enables node compat tests
`test-heapdump.js`, `test-v8-getheapsnapshot-twice.js`, and `test-v8-stats.js`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bartlomieju bartlomieju changed the title feat(ext/node): implement v8 heap APIs and bump v8 crate to 146.3.0 fix(ext/node): implement node:v8 heap APIs Mar 5, 2026
@bartlomieju bartlomieju merged commit 0c84694 into main Mar 5, 2026
113 checks passed
@bartlomieju bartlomieju deleted the v8_heap branch March 5, 2026 14:20
bartlomieju added a commit to bartlomieju/deno that referenced this pull request Mar 5, 2026
Implements `v8.getHeapSpaceStatistics()`,
`v8.getHeapCodeStatistics()`, `v8.getHeapSnapshot()`, and
`v8.writeHeapSnapshot()` from the `node:v8` module

Enabled node compat tests: `test-heapdump.js`,
`test-v8-getheapsnapshot-twice.js`, `test-v8-stats.js`

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants