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

Unified Diff: src/snapshot/serialize.cc

Issue 1296793003: Add deserialized scripts to script list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 4 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/snapshot/serialize.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/snapshot/serialize.cc
diff --git a/src/snapshot/serialize.cc b/src/snapshot/serialize.cc
index a3a22336d108d65f37cb3cb23e68e6da9eb5c029..e7976aca6fb6821f4b406ce03c696fd3ecf9db1f 100644
--- a/src/snapshot/serialize.cc
+++ b/src/snapshot/serialize.cc
@@ -633,7 +633,7 @@ MaybeHandle<SharedFunctionInfo> Deserializer::DeserializeCode(
DeserializeDeferredObjects();
result = Handle<SharedFunctionInfo>(SharedFunctionInfo::cast(root));
}
- CommitNewInternalizedStrings(isolate);
+ CommitPostProcessedObjects(isolate);
return scope.CloseAndEscape(result);
}
}
@@ -726,8 +726,7 @@ HeapObject* Deserializer::PostProcessNewObject(HeapObject* obj, int space) {
}
}
} else if (obj->IsScript()) {
- // Assign a new script id to avoid collision.
- Script::cast(obj)->set_id(isolate_->heap()->NextScriptId());
+ new_scripts_.Add(handle(Script::cast(obj)));
} else {
DCHECK(CanBeDeferred(obj));
}
@@ -760,7 +759,7 @@ HeapObject* Deserializer::PostProcessNewObject(HeapObject* obj, int space) {
}
-void Deserializer::CommitNewInternalizedStrings(Isolate* isolate) {
+void Deserializer::CommitPostProcessedObjects(Isolate* isolate) {
StringTable::EnsureCapacityForDeserialization(
isolate, new_internalized_strings_.length());
for (Handle<String> string : new_internalized_strings_) {
@@ -768,6 +767,15 @@ void Deserializer::CommitNewInternalizedStrings(Isolate* isolate) {
DCHECK_NULL(StringTable::LookupKeyIfExists(isolate, &key));
StringTable::LookupKey(isolate, &key);
}
+
+ Heap* heap = isolate->heap();
+ Factory* factory = isolate->factory();
+ for (Handle<Script> script : new_scripts_) {
+ // Assign a new script id to avoid collision.
+ script->set_id(isolate_->heap()->NextScriptId());
+ // Add script to list.
+ heap->set_script_list(*WeakFixedArray::Add(factory->script_list(), script));
+ }
}
« no previous file with comments | « src/snapshot/serialize.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698