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

Side by Side Diff: src/snapshot-external.cc

Issue 654243003: Revert "Break deserializer reservations into chunks that fit onto a page." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « src/snapshot-common.cc ('k') | src/vector.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 // Used for building with external snapshots. 5 // Used for building with external snapshots.
6 6
7 #include "src/snapshot.h" 7 #include "src/snapshot.h"
8 8
9 #include "src/serialize.h" 9 #include "src/serialize.h"
10 #include "src/snapshot-source-sink.h" 10 #include "src/snapshot-source-sink.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 bool Snapshot::Initialize(Isolate* isolate) { 51 bool Snapshot::Initialize(Isolate* isolate) {
52 if (!HaveASnapshotToStartFrom()) 52 if (!HaveASnapshotToStartFrom())
53 return false; 53 return false;
54 54
55 base::ElapsedTimer timer; 55 base::ElapsedTimer timer;
56 if (FLAG_profile_deserialization) { 56 if (FLAG_profile_deserialization) {
57 timer.Start(); 57 timer.Start();
58 } 58 }
59 SnapshotByteSource source(snapshot_impl_->data, snapshot_impl_->size); 59 SnapshotByteSource source(snapshot_impl_->data, snapshot_impl_->size);
60 Deserializer deserializer(&source); 60 Deserializer deserializer(&source);
61 deserializer.AddReservation(NEW_SPACE, snapshot_impl_->new_space_used); 61 deserializer.set_reservation(NEW_SPACE, snapshot_impl_->new_space_used);
62 deserializer.AddReservation(OLD_POINTER_SPACE, 62 deserializer.set_reservation(OLD_POINTER_SPACE,
63 snapshot_impl_->pointer_space_used); 63 snapshot_impl_->pointer_space_used);
64 deserializer.AddReservation(OLD_DATA_SPACE, snapshot_impl_->data_space_used); 64 deserializer.set_reservation(OLD_DATA_SPACE,
65 deserializer.AddReservation(CODE_SPACE, snapshot_impl_->code_space_used); 65 snapshot_impl_->data_space_used);
66 deserializer.AddReservation(MAP_SPACE, snapshot_impl_->map_space_used); 66 deserializer.set_reservation(CODE_SPACE, snapshot_impl_->code_space_used);
67 deserializer.AddReservation(CELL_SPACE, snapshot_impl_->cell_space_used); 67 deserializer.set_reservation(MAP_SPACE, snapshot_impl_->map_space_used);
68 deserializer.AddReservation(PROPERTY_CELL_SPACE, 68 deserializer.set_reservation(CELL_SPACE, snapshot_impl_->cell_space_used);
69 snapshot_impl_->property_cell_space_used); 69 deserializer.set_reservation(PROPERTY_CELL_SPACE,
70 deserializer.AddReservation(LO_SPACE, snapshot_impl_->lo_space_used); 70 snapshot_impl_->property_cell_space_used);
71 deserializer.set_reservation(LO_SPACE, snapshot_impl_->lo_space_used);
71 bool success = isolate->Init(&deserializer); 72 bool success = isolate->Init(&deserializer);
72 if (FLAG_profile_deserialization) { 73 if (FLAG_profile_deserialization) {
73 double ms = timer.Elapsed().InMillisecondsF(); 74 double ms = timer.Elapsed().InMillisecondsF();
74 PrintF("[Snapshot loading and deserialization took %0.3f ms]\n", ms); 75 PrintF("[Snapshot loading and deserialization took %0.3f ms]\n", ms);
75 } 76 }
76 return success; 77 return success;
77 } 78 }
78 79
79 80
80 Handle<Context> Snapshot::NewContextFromSnapshot(Isolate* isolate) { 81 Handle<Context> Snapshot::NewContextFromSnapshot(Isolate* isolate) {
81 if (!HaveASnapshotToStartFrom()) 82 if (!HaveASnapshotToStartFrom())
82 return Handle<Context>(); 83 return Handle<Context>();
83 84
84 SnapshotByteSource source(snapshot_impl_->context_data, 85 SnapshotByteSource source(snapshot_impl_->context_data,
85 snapshot_impl_->context_size); 86 snapshot_impl_->context_size);
86 Deserializer deserializer(&source); 87 Deserializer deserializer(&source);
87 deserializer.AddReservation(NEW_SPACE, 88 deserializer.set_reservation(NEW_SPACE,
88 snapshot_impl_->context_new_space_used); 89 snapshot_impl_->context_new_space_used);
89 deserializer.AddReservation(OLD_POINTER_SPACE, 90 deserializer.set_reservation(OLD_POINTER_SPACE,
90 snapshot_impl_->context_pointer_space_used); 91 snapshot_impl_->context_pointer_space_used);
91 deserializer.AddReservation(OLD_DATA_SPACE, 92 deserializer.set_reservation(OLD_DATA_SPACE,
92 snapshot_impl_->context_data_space_used); 93 snapshot_impl_->context_data_space_used);
93 deserializer.AddReservation(CODE_SPACE, 94 deserializer.set_reservation(CODE_SPACE,
94 snapshot_impl_->context_code_space_used); 95 snapshot_impl_->context_code_space_used);
95 deserializer.AddReservation(MAP_SPACE, 96 deserializer.set_reservation(MAP_SPACE,
96 snapshot_impl_->context_map_space_used); 97 snapshot_impl_->context_map_space_used);
97 deserializer.AddReservation(CELL_SPACE, 98 deserializer.set_reservation(CELL_SPACE,
98 snapshot_impl_->context_cell_space_used); 99 snapshot_impl_->context_cell_space_used);
99 deserializer.AddReservation(PROPERTY_CELL_SPACE, 100 deserializer.set_reservation(PROPERTY_CELL_SPACE,
100 snapshot_impl_->context_property_cell_space_used); 101 snapshot_impl_->
101 deserializer.AddReservation(LO_SPACE, snapshot_impl_->context_lo_space_used); 102 context_property_cell_space_used);
103 deserializer.set_reservation(LO_SPACE, snapshot_impl_->context_lo_space_used);
102 Object* root; 104 Object* root;
103 deserializer.DeserializePartial(isolate, &root); 105 deserializer.DeserializePartial(isolate, &root);
104 CHECK(root->IsContext()); 106 CHECK(root->IsContext());
105 return Handle<Context>(Context::cast(root)); 107 return Handle<Context>(Context::cast(root));
106 } 108 }
107 109
108 110
109 void SetSnapshotFromFile(StartupData* snapshot_blob) { 111 void SetSnapshotFromFile(StartupData* snapshot_blob) {
110 DCHECK(snapshot_blob); 112 DCHECK(snapshot_blob);
111 DCHECK(snapshot_blob->data); 113 DCHECK(snapshot_blob->data);
(...skipping 22 matching lines...) Expand all
134 snapshot_impl_->context_data_space_used = source.GetInt(); 136 snapshot_impl_->context_data_space_used = source.GetInt();
135 snapshot_impl_->context_code_space_used = source.GetInt(); 137 snapshot_impl_->context_code_space_used = source.GetInt();
136 snapshot_impl_->context_map_space_used = source.GetInt(); 138 snapshot_impl_->context_map_space_used = source.GetInt();
137 snapshot_impl_->context_cell_space_used = source.GetInt(); 139 snapshot_impl_->context_cell_space_used = source.GetInt();
138 snapshot_impl_->context_property_cell_space_used = source.GetInt(); 140 snapshot_impl_->context_property_cell_space_used = source.GetInt();
139 141
140 DCHECK(success); 142 DCHECK(success);
141 } 143 }
142 144
143 } } // namespace v8::internal 145 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/snapshot-common.cc ('k') | src/vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698