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

Unified Diff: src/snapshot-common.cc

Issue 1094014: Merge the partial_snapshots branch back into bleeding_edge. For... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
Index: src/snapshot-common.cc
===================================================================
--- src/snapshot-common.cc (revision 4215)
+++ src/snapshot-common.cc (working copy)
@@ -59,4 +59,24 @@
return false;
}
+
+Handle<Context> Snapshot::NewContextFromSnapshot() {
+ if (context_size_ == 0) {
+ return Handle<Context>();
+ }
+ Heap::ReserveSpace(new_space_used_,
+ pointer_space_used_,
+ data_space_used_,
+ code_space_used_,
+ map_space_used_,
+ cell_space_used_,
+ large_space_used_);
+ SnapshotByteSource source(context_data_, context_size_);
+ Deserializer deserializer(&source);
+ Object* root;
+ deserializer.DeserializePartial(&root);
+ CHECK(root->IsContext());
+ return Handle<Context>(Context::cast(root));
+}
+
} } // namespace v8::internal

Powered by Google App Engine
This is Rietveld 408576698