Skip to content

Commit bb9f0c2

Browse files
addaleaxCommit Bot
authored andcommitted
[snapshot] Improve snapshot docs and error printing
- Minor improvements to the documentation for snapshotting. - Add newlines to printed errors where necessary. Change-Id: I822e7e850adb67eae73b51c23cf34e40ba3106f0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2144954 Reviewed-by: Toon Verwaest <[email protected]> Commit-Queue: Toon Verwaest <[email protected]> Cr-Commit-Position: refs/heads/master@{#67111}
1 parent 0c2530f commit bb9f0c2

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

include/v8.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9800,6 +9800,11 @@ class V8_EXPORT V8 {
98009800

98019801
/**
98029802
* Helper class to create a snapshot data blob.
9803+
*
9804+
* The Isolate used by a SnapshotCreator is owned by it, and will be entered
9805+
* and exited by the constructor and destructor, respectively; The destructor
9806+
* will also destroy the Isolate. Experimental language features, including
9807+
* those available by default, are not available while creating a snapshot.
98039808
*/
98049809
class V8_EXPORT SnapshotCreator {
98059810
public:
@@ -9828,6 +9833,10 @@ class V8_EXPORT SnapshotCreator {
98289833
SnapshotCreator(const intptr_t* external_references = nullptr,
98299834
StartupData* existing_blob = nullptr);
98309835

9836+
/**
9837+
* Destroy the snapshot creator, and exit and dispose of the Isolate
9838+
* associated with it.
9839+
*/
98319840
~SnapshotCreator();
98329841

98339842
/**

src/snapshot/serializer-common.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ ExternalReferenceEncoder::Value ExternalReferenceEncoder::Encode(
7676
if (maybe_index.IsNothing()) {
7777
void* addr = reinterpret_cast<void*>(address);
7878
v8::base::OS::PrintError("Unknown external reference %p.\n", addr);
79-
v8::base::OS::PrintError("%s", ExternalReferenceTable::ResolveSymbol(addr));
79+
v8::base::OS::PrintError("%s\n",
80+
ExternalReferenceTable::ResolveSymbol(addr));
8081
v8::base::OS::Abort();
8182
}
8283
Value result(maybe_index.FromJust());

src/snapshot/startup-serializer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ void SerializedHandleChecker::VisitRootPointers(Root root,
193193
PrintF("%s handle not serialized: ",
194194
root == Root::kGlobalHandles ? "global" : "eternal");
195195
(*p).Print();
196+
PrintF("\n");
196197
ok_ = false;
197198
}
198199
}

0 commit comments

Comments
 (0)