Skip to content

Commit

Permalink
[snapshot] Improve snapshot docs and error printing
Browse files Browse the repository at this point in the history
- 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 <verwaest@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#67111}
  • Loading branch information
addaleax authored and Commit Bot committed Apr 14, 2020
1 parent 0c2530f commit bb9f0c2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -9800,6 +9800,11 @@ class V8_EXPORT V8 {

/**
* Helper class to create a snapshot data blob.
*
* The Isolate used by a SnapshotCreator is owned by it, and will be entered
* and exited by the constructor and destructor, respectively; The destructor
* will also destroy the Isolate. Experimental language features, including
* those available by default, are not available while creating a snapshot.
*/
class V8_EXPORT SnapshotCreator {
public:
Expand Down Expand Up @@ -9828,6 +9833,10 @@ class V8_EXPORT SnapshotCreator {
SnapshotCreator(const intptr_t* external_references = nullptr,
StartupData* existing_blob = nullptr);

/**
* Destroy the snapshot creator, and exit and dispose of the Isolate
* associated with it.
*/
~SnapshotCreator();

/**
Expand Down
3 changes: 2 additions & 1 deletion src/snapshot/serializer-common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ ExternalReferenceEncoder::Value ExternalReferenceEncoder::Encode(
if (maybe_index.IsNothing()) {
void* addr = reinterpret_cast<void*>(address);
v8::base::OS::PrintError("Unknown external reference %p.\n", addr);
v8::base::OS::PrintError("%s", ExternalReferenceTable::ResolveSymbol(addr));
v8::base::OS::PrintError("%s\n",
ExternalReferenceTable::ResolveSymbol(addr));
v8::base::OS::Abort();
}
Value result(maybe_index.FromJust());
Expand Down
1 change: 1 addition & 0 deletions src/snapshot/startup-serializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ void SerializedHandleChecker::VisitRootPointers(Root root,
PrintF("%s handle not serialized: ",
root == Root::kGlobalHandles ? "global" : "eternal");
(*p).Print();
PrintF("\n");
ok_ = false;
}
}
Expand Down

0 comments on commit bb9f0c2

Please sign in to comment.