You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bc3ebe0
Browse filesBrowse the repository at this point in the historyBrowse files
Revert "[parser] Create debug magic comment values as source substrings"
This reverts commit 8dcf14f.
Reason for revert:
- Parser::SetDebugMagicCommentFields now creates script->source_url via factory()->NewSubString(...). For any //# sourceURL=... with length >= 13 (SlicedString::kMinLength), source_url is now a SlicedString instead of an internalized SeqString.
- In V8HeapExplorer::AddEntry (src/profiler/heap-snapshot-generator.cc), SlicedString nodes are emitted into the heap snapshot with the literal name "(sliced string)" (and ExtractStringReferences only emits parent and length, not offset).
- As a result, ContextAnalyzer in DevTools reads node.findInternalEdgeTarget('source_url')?.name() as "(sliced string)" instead of the script's sourceURL for eval scripts (like //# sourceURL=inside-direct-eval.js)
Failure Link: https://ci.chromium.org/b/8667891195092908785/test-results?q=ExactID%3Afront_end%2Fentrypoints%2Fheap_snapshot_worker%2FHeapSnapshot.test.api.ts%3Aheapsnapshot_analyze_context_fields_api_test%3Aanalyzes_context_fields+VHash%3Ae3b0c44298fc1c14&clean=
Original change's description:
> [parser] Create debug magic comment values as source substrings
>
> The values of the //# sourceURL, sourceMappingURL and debugId magic
> comments were copied into LiteralBuffers while scanning and then
> internalized. An inline source map (sourceMappingURL=data:...) can be
> tens of MiB, so this allocated a string of that size on the heap in a
> non-throwing allocation, e.g. aborting a Node.js worker with a small
> old-generation limit even though the (external) source fits.
>
> The scanner now only records the source locations of these values, and
> the values are created as substrings of the script source:
> - On the main thread, when parsing finishes.
> - For background and streaming compiles, where the source is not
> available while parsing, the locations are kept in the
> BackgroundCompileTask and the substrings are created in
> FinalizeScript after the source is set. Locations outside of the
> source provided by the embedder are ignored.
>
> The semantics are unchanged: the last comment wins, trailing garbage or
> an empty value removes the value, and a source map URL provided through
> the API takes precedence.
>
> Since these values are now usually SlicedStrings of the script source,
> the code serializer serializes all sliced strings as sequential
> strings (one-byte if their contents are, even if their parent is
> two-byte). The script source is an attached object, and off-thread
> deserialization attaches a placeholder for it, so a serialized slice
> of it would not be valid.
>
> Consuming a code cache still materializes these values as sequential
> strings, e.g. on Node.js's NODE_COMPILE_CACHE path, so a huge cached
> value can still be large on the heap there. Keeping them as substrings
> of the source when deserializing requires a code cache format change
> and is left for a follow-up.
>
> This also removes the LiteralBuffer copies of the values.
>
> [email protected], [email protected]
>
> Bug: 566467883
> Change-Id: I07d8d0c36f56c7aee40793b1db272657832ab36f
> Refs: nodejs/node#64155
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8472768
> Reviewed-by: Leszek Swirski <[email protected]>
> Reviewed-by: Patrick Thier <[email protected]>
> Auto-Submit: eliau elkouby (אליהו אלקובי) <[email protected]>
> Commit-Queue: Patrick Thier <[email protected]>
> Cr-Commit-Position: refs/heads/main@{#110612}
Bug: 566467883
Change-Id: Ie6326e508e0243c26a1c958e0556f622c283d144
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8574549
Reviewed-by: Patrick Thier <[email protected]>
Auto-Submit: Kateryna Prokopenko <[email protected]>
Commit-Queue: Kateryna Prokopenko <[email protected]>
Reviewed-by: Leszek Swirski <[email protected]>
Cr-Commit-Position: refs/heads/main@{#110803}
0 commit comments