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

Unified Diff: src/api.cc

Issue 2040813005: [snapshot] remove metadata field. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed nit Created 4 years, 6 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 | « include/v8.h ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 348724d9f04eaee3f27365a3e851ec42ef89a4b6..73b72ccfa15b7224b9cbefd9e5503330ae8307c1 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -385,7 +385,6 @@ bool RunExtraCode(Isolate* isolate, Local<Context> context,
StartupData SerializeIsolateAndContext(
Isolate* isolate, Persistent<Context>* context,
- i::Snapshot::Metadata metadata,
i::StartupSerializer::FunctionCodeHandling function_code_handling) {
if (context->IsEmpty()) return {NULL, 0};
@@ -428,7 +427,7 @@ StartupData SerializeIsolateAndContext(
context_ser.Serialize(&raw_context);
ser.SerializeWeakReferencesAndDeferred();
- return i::Snapshot::CreateSnapshotBlob(ser, context_ser, metadata);
+ return i::Snapshot::CreateSnapshotBlob(ser, context_ser);
}
} // namespace
@@ -460,11 +459,8 @@ StartupData V8::CreateSnapshotDataBlob(const char* embedded_source) {
}
}
- i::Snapshot::Metadata metadata;
- metadata.set_embeds_script(embedded_source != NULL);
-
result = SerializeIsolateAndContext(
- isolate, &context, metadata, i::StartupSerializer::CLEAR_FUNCTION_CODE);
+ isolate, &context, i::StartupSerializer::CLEAR_FUNCTION_CODE);
DCHECK(context.IsEmpty());
}
isolate->Dispose();
@@ -515,11 +511,8 @@ StartupData V8::WarmUpSnapshotDataBlob(StartupData cold_snapshot_blob,
context.Reset(isolate, new_context);
}
- i::Snapshot::Metadata metadata;
- metadata.set_embeds_script(i::Snapshot::EmbedsScript(internal_isolate));
-
result = SerializeIsolateAndContext(
- isolate, &context, metadata, i::StartupSerializer::KEEP_FUNCTION_CODE);
+ isolate, &context, i::StartupSerializer::KEEP_FUNCTION_CODE);
DCHECK(context.IsEmpty());
}
isolate->Dispose();
@@ -7274,14 +7267,6 @@ Isolate* Isolate::New(const Isolate::CreateParams& params) {
// TODO(jochen): Once we got rid of Isolate::Current(), we can remove this.
Isolate::Scope isolate_scope(v8_isolate);
if (params.entry_hook || !i::Snapshot::Initialize(isolate)) {
- // If the isolate has a function entry hook, it needs to re-build all its
- // code stubs with entry hooks embedded, so don't deserialize a snapshot.
- if (i::Snapshot::EmbedsScript(isolate)) {
- // If the snapshot embeds a script, we cannot initialize the isolate
- // without the snapshot as a fallback. This is unlikely to happen though.
- V8_Fatal(__FILE__, __LINE__,
- "Initializing isolate from custom startup snapshot failed");
- }
isolate->Init(NULL);
}
return v8_isolate;
« no previous file with comments | « include/v8.h ('k') | src/snapshot/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698