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

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

Issue 2736923002: SnapshotCreator: start from existing snapshot if we have one (Closed)
Patch Set: addressed comments Created 3 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/snapshot/deserializer.h ('k') | src/snapshot/serializer-common.h » ('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/api.h" 7 #include "src/api.h"
8 #include "src/assembler-inl.h" 8 #include "src/assembler-inl.h"
9 #include "src/bootstrapper.h" 9 #include "src/bootstrapper.h"
10 #include "src/external-reference-table.h" 10 #include "src/external-reference-table.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 void Deserializer::Initialize(Isolate* isolate) { 71 void Deserializer::Initialize(Isolate* isolate) {
72 DCHECK_NULL(isolate_); 72 DCHECK_NULL(isolate_);
73 DCHECK_NOT_NULL(isolate); 73 DCHECK_NOT_NULL(isolate);
74 isolate_ = isolate; 74 isolate_ = isolate;
75 DCHECK_NULL(external_reference_table_); 75 DCHECK_NULL(external_reference_table_);
76 external_reference_table_ = ExternalReferenceTable::instance(isolate); 76 external_reference_table_ = ExternalReferenceTable::instance(isolate);
77 CHECK_EQ(magic_number_, 77 CHECK_EQ(magic_number_,
78 SerializedData::ComputeMagicNumber(external_reference_table_)); 78 SerializedData::ComputeMagicNumber(external_reference_table_));
79 // The current isolate must have at least as many API-provided external
80 // references as the to-be-deserialized snapshot expects and refers to.
81 CHECK_LE(num_extra_references_,
82 SerializedData::GetExtraReferences(external_reference_table_));
79 } 83 }
80 84
81 void Deserializer::Deserialize(Isolate* isolate) { 85 void Deserializer::Deserialize(Isolate* isolate) {
82 Initialize(isolate); 86 Initialize(isolate);
83 if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context"); 87 if (!ReserveSpace()) V8::FatalProcessOutOfMemory("deserializing context");
84 // No active threads. 88 // No active threads.
85 DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse()); 89 DCHECK_NULL(isolate_->thread_manager()->FirstThreadStateInUse());
86 // No active handles. 90 // No active handles.
87 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty()); 91 DCHECK(isolate_->handle_scope_implementer()->blocks()->is_empty());
88 // Partial snapshot cache is not yet populated. 92 // Partial snapshot cache is not yet populated.
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 865
862 default: 866 default:
863 CHECK(false); 867 CHECK(false);
864 } 868 }
865 } 869 }
866 CHECK_EQ(limit, current); 870 CHECK_EQ(limit, current);
867 return true; 871 return true;
868 } 872 }
869 } // namespace internal 873 } // namespace internal
870 } // namespace v8 874 } // namespace v8
OLDNEW
« no previous file with comments | « src/snapshot/deserializer.h ('k') | src/snapshot/serializer-common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698