Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(204)

Unified Diff: src/snapshot-common.cc

Issue 845973003: Embed custom script into the snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/mksnapshot.cc ('k') | tools/gyp/v8.gyp » ('j') | tools/gyp/v8.gyp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot-common.cc
diff --git a/src/snapshot-common.cc b/src/snapshot-common.cc
index dc7f655abc24ffafc2d9b5a6f718ba8939519f9c..e38872d5d18711de53720d31daab7e58b90efd4c 100644
--- a/src/snapshot-common.cc
+++ b/src/snapshot-common.cc
@@ -25,12 +25,14 @@ bool Snapshot::Initialize(Isolate* isolate) {
if (FLAG_profile_deserialization) timer.Start();
const v8::StartupData blob = SnapshotBlob();
- SnapshotData snapshot_data(ExtractStartupData(&blob));
+ Vector<const byte> startup_data = ExtractStartupData(&blob);
+ SnapshotData snapshot_data(startup_data);
Deserializer deserializer(&snapshot_data);
bool success = isolate->Init(&deserializer);
if (FLAG_profile_deserialization) {
double ms = timer.Elapsed().InMillisecondsF();
- PrintF("[Snapshot loading and deserialization took %0.3f ms]\n", ms);
+ int bytes = startup_data.length();
+ PrintF("[Deserializing isolate (%d bytes) took %0.3f ms]\n", bytes, ms);
}
return success;
}
@@ -38,13 +40,21 @@ bool Snapshot::Initialize(Isolate* isolate) {
Handle<Context> Snapshot::NewContextFromSnapshot(Isolate* isolate) {
if (!HaveASnapshotToStartFrom()) return Handle<Context>();
+ base::ElapsedTimer timer;
+ if (FLAG_profile_deserialization) timer.Start();
const v8::StartupData blob = SnapshotBlob();
- SnapshotData snapshot_data(ExtractContextData(&blob));
+ Vector<const byte> context_data = ExtractContextData(&blob);
+ SnapshotData snapshot_data(context_data);
Deserializer deserializer(&snapshot_data);
Object* root;
deserializer.DeserializePartial(isolate, &root);
CHECK(root->IsContext());
+ if (FLAG_profile_deserialization) {
+ double ms = timer.Elapsed().InMillisecondsF();
+ int bytes = context_data.length();
+ PrintF("[Deserializing context (%d bytes) took %0.3f ms]\n", bytes, ms);
+ }
return Handle<Context>(Context::cast(root));
}
« no previous file with comments | « src/mksnapshot.cc ('k') | tools/gyp/v8.gyp » ('j') | tools/gyp/v8.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698