Merged
Conversation
Expose `Isolate::get_heap_code_and_metadata_statistics()` which wraps V8's `GetHeapCodeAndMetadataStatistics`. Returns a `HeapCodeStatistics` struct with code_and_metadata_size, bytecode_and_metadata_size, external_script_source_size, and cpu_profiler_metadata_size. This is needed to implement Node.js `v8.getHeapCodeStatistics()` in Deno. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
code_and_metadata_size may be 0 on a fresh isolate before any JS is compiled, depending on the platform and V8 version. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
code_and_metadata_size tracks JIT-compiled code, which may be 0 if V8 only uses the interpreter for simple scripts. Assert non-decreasing instead of > 0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devsnek
reviewed
Mar 4, 2026
…ual mirror Use the real V8 HeapCodeStatistics type via bindgen, matching the pattern used by HeapStatistics and HeapSpaceStatistics. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devsnek
approved these changes
Mar 4, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Isolate::get_heap_code_and_metadata_statistics()wrapping V8'sGetHeapCodeAndMetadataStatisticsHeapCodeStatisticsstruct withcode_and_metadata_size,bytecode_and_metadata_size,external_script_source_size, andcpu_profiler_metadata_sizev8.getHeapCodeStatistics()in DenoTest plan
tests/test_api.rs(heap_code_statistics) that verifies the API returns valid statistics before and after running JS code🤖 Generated with Claude Code