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

Side by Side Diff: src/snapshot/deserializer.cc

Issue 1805903002: [serializer] Add API to warm up startup snapshot with an additional script. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comment Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/isolate.cc ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/snapshot/deserializer.h" 5 #include "src/snapshot/deserializer.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/isolate.h" 9 #include "src/isolate.h"
10 #include "src/macro-assembler.h" 10 #include "src/macro-assembler.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 SerializedData::ComputeMagicNumber(external_reference_table_)); 70 SerializedData::ComputeMagicNumber(external_reference_table_));
71 } 71 }
72 72
73 void Deserializer::Deserialize(Isolate* isolate) { 73 void Deserializer::Deserialize(Isolate* isolate) {
74 Initialize(isolate); 74 Initialize(isolate);
75 if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context"); 75 if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context");
76 // No active threads. 76 // No active threads.
77 DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse()); 77 DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse());
78 // No active handles. 78 // No active handles.
79 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty()); 79 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty());
80 // Partial snapshot cache is not yet populated.
81 DCHECK(isolate_->partial_snapshot_cache()->is_empty());
80 82
81 { 83 {
82 DisallowHeapAllocation no_gc; 84 DisallowHeapAllocation no_gc;
83 isolate_->heap()->IterateSmiRoots(this); 85 isolate_->heap()->IterateSmiRoots(this);
84 isolate_->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG); 86 isolate_->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG);
85 isolate_->heap()->RepairFreeListsAfterDeserialization(); 87 isolate_->heap()->RepairFreeListsAfterDeserialization();
86 isolate_->heap()->IterateWeakRoots(this, VISIT_ALL); 88 isolate_->heap()->IterateWeakRoots(this, VISIT_ALL);
87 DeserializeDeferredObjects(); 89 DeserializeDeferredObjects();
88 FlushICacheForNewIsolate(); 90 FlushICacheForNewIsolate();
89 } 91 }
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 810
809 default: 811 default:
810 CHECK(false); 812 CHECK(false);
811 } 813 }
812 } 814 }
813 CHECK_EQ(limit, current); 815 CHECK_EQ(limit, current);
814 return true; 816 return true;
815 } 817 }
816 } // namespace internal 818 } // namespace internal
817 } // namespace v8 819 } // namespace v8
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/snapshot/mksnapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698