Skip to content

fix(v8): expose modern diagnostics/profiler named exports (#3904) - #4012

Merged
proggeramlug merged 1 commit into
mainfrom
fix-3904-v8-exports
Jun 1, 2026
Merged

proggeramlug merged 1 commit into
mainfrom
fix-3904-v8-exports

Conversation

@proggeramlug

Copy link
Copy Markdown
Contributor

Summary

Closes #3904. Adds the modern node:v8 diagnostics/profiler named exports Node ships in its ESM namespace but Perry's manifest omitted (so import { queryObjects, getCppHeapStatistics, ... } from "node:v8" failed perry check): getCppHeapStatistics, getHeapSnapshot, isStringOneByteRepresentation, queryObjects, startCpuProfile, writeHeapSnapshot.

Implementation

  • crates/perry-api-manifest/src/entries.rs — six method("v8", …) rows.
  • crates/perry-runtime/src/object/native_module.rs — the six added to is_native_module_callable_export (named/namespace reads are function-valued) + native_callable_export_arity (Node .length: getCppHeapStatistics/startCpuProfile 0, getHeapSnapshot/isStringOneByteRepresentation/queryObjects 1, writeHeapSnapshot 2).
  • test-parity/node-suite/v8/exports/diagnostics-surface.ts + regenerated docs/api/perry.d.ts / reference.md.

Validation

  • Fixture byte-identical to node --experimental-strip-types in both no-opt and auto-optimize builds (typeof + .length + namespace identity).
  • manifest_consistency 5/5, cargo fmt --all -- --check clean.

Scope

Export-surface/manifest parity. Deeper behavior of getHeapSnapshot/writeHeapSnapshot remains tracked by #3140.

Node's node:v8 ESM namespace exposes several function-valued exports that
Perry's manifest omitted, so importing them failed perry check before
runtime. Added getCppHeapStatistics, getHeapSnapshot,
isStringOneByteRepresentation, queryObjects, startCpuProfile, and
writeHeapSnapshot (Node .length values preserved).

- entries.rs: six method("v8", ...) rows
- native_module.rs: added to is_native_module_callable_export (function-
  valued reads) + native_callable_export_arity (Node .length)
- new fixture test-parity/node-suite/v8/exports/diagnostics-surface.ts
  (byte-identical to node --experimental-strip-types) + regenerated api docs

Export-surface parity; deeper getHeapSnapshot/writeHeapSnapshot behavior
stays tracked by #3140. Closes #3904.
@proggeramlug
proggeramlug force-pushed the fix-3904-v8-exports branch from bacc550 to 39d3cdc Compare June 1, 2026 22:16
@proggeramlug
proggeramlug merged commit 6cb00d1 into main Jun 1, 2026
11 checks passed
@proggeramlug
proggeramlug deleted the fix-3904-v8-exports branch June 1, 2026 22:16
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.

node:v8: modern diagnostics and profiler helper exports are missing from the ESM surface

1 participant