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

Unified Diff: src/d8.cc

Issue 782573002: Sketch of on demand snapshot generation for d8 Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add bits needed by the Chrome implementation Created 6 years 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/api.cc ('k') | src/mksnapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.cc
diff --git a/src/d8.cc b/src/d8.cc
index e18f2da91d1a03ccdba7e5de40a00c3d86127f71..a30e454b840b1d8e703d98e1820a95cb2ff0da31 100644
--- a/src/d8.cc
+++ b/src/d8.cc
@@ -1565,6 +1565,11 @@ class StartupDataHandler {
delete[] snapshot_.data;
}
+ void SetSnapshotOnly(const char* snapshot_blob) {
+ Load(snapshot_blob, &snapshot_, v8::V8::SetSnapshotDataBlob);
+ }
+
+
private:
void Load(const char* blob_file,
v8::StartupData* startup_data,
@@ -1619,6 +1624,11 @@ int Shell::Main(int argc, char* argv[]) {
#endif // defined(_MSC_VER)
#endif // defined(_WIN32) || defined(_WIN64)
if (!SetOptions(argc, argv)) return 1;
+
+ i::FLAG_harmony_shipping = false;
+ i::FLAG_random_seed = 314159265;
+
+ i::CpuFeatures::Probe(true);
v8::V8::InitializeICU(options.icu_data_file);
v8::Platform* platform = v8::platform::CreateDefaultPlatform();
v8::V8::InitializePlatform(platform);
@@ -1652,7 +1662,12 @@ int Shell::Main(int argc, char* argv[]) {
base::SysInfo::AmountOfVirtualMemory(),
base::SysInfo::NumberOfProcessors());
#endif
+ i::FLAG_logfile_per_isolate = false;
+ create_params.enable_serializer = true;
Isolate* isolate = Isolate::New(create_params);
+ v8::V8::CreateSnapshotFromHeap(isolate, NULL, NULL, "snapshot.bin", NULL,
+ "snapshot.cc");
+ startup_data.SetSnapshotOnly("snapshot.bin");
DumbLineEditor dumb_line_editor(isolate);
{
Isolate::Scope scope(isolate);
« no previous file with comments | « src/api.cc ('k') | src/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698