| OLD | NEW | 
|---|
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 43 | 43 | 
| 44 bool Snapshot::HaveASnapshotToStartFrom() { | 44 bool Snapshot::HaveASnapshotToStartFrom() { | 
| 45   return snapshot_impl_ != NULL; | 45   return snapshot_impl_ != NULL; | 
| 46 } | 46 } | 
| 47 | 47 | 
| 48 | 48 | 
| 49 bool Snapshot::Initialize() { | 49 bool Snapshot::Initialize() { | 
| 50   if (!HaveASnapshotToStartFrom()) | 50   if (!HaveASnapshotToStartFrom()) | 
| 51     return false; | 51     return false; | 
| 52 | 52 | 
| 53   ElapsedTimer timer; | 53   base::ElapsedTimer timer; | 
| 54   if (FLAG_profile_deserialization) { | 54   if (FLAG_profile_deserialization) { | 
| 55     timer.Start(); | 55     timer.Start(); | 
| 56   } | 56   } | 
| 57   SnapshotByteSource source(snapshot_impl_->data, snapshot_impl_->size); | 57   SnapshotByteSource source(snapshot_impl_->data, snapshot_impl_->size); | 
| 58   Deserializer deserializer(&source); | 58   Deserializer deserializer(&source); | 
| 59   deserializer.set_reservation(NEW_SPACE, snapshot_impl_->new_space_used); | 59   deserializer.set_reservation(NEW_SPACE, snapshot_impl_->new_space_used); | 
| 60   deserializer.set_reservation(OLD_POINTER_SPACE, | 60   deserializer.set_reservation(OLD_POINTER_SPACE, | 
| 61                                snapshot_impl_->pointer_space_used); | 61                                snapshot_impl_->pointer_space_used); | 
| 62   deserializer.set_reservation(OLD_DATA_SPACE, | 62   deserializer.set_reservation(OLD_DATA_SPACE, | 
| 63                                snapshot_impl_->data_space_used); | 63                                snapshot_impl_->data_space_used); | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 131   snapshot_impl_->context_data_space_used = source.GetInt(); | 131   snapshot_impl_->context_data_space_used = source.GetInt(); | 
| 132   snapshot_impl_->context_code_space_used = source.GetInt(); | 132   snapshot_impl_->context_code_space_used = source.GetInt(); | 
| 133   snapshot_impl_->context_map_space_used = source.GetInt(); | 133   snapshot_impl_->context_map_space_used = source.GetInt(); | 
| 134   snapshot_impl_->context_cell_space_used = source.GetInt(); | 134   snapshot_impl_->context_cell_space_used = source.GetInt(); | 
| 135   snapshot_impl_->context_property_cell_space_used = source.GetInt(); | 135   snapshot_impl_->context_property_cell_space_used = source.GetInt(); | 
| 136 | 136 | 
| 137   ASSERT(success); | 137   ASSERT(success); | 
| 138 } | 138 } | 
| 139 | 139 | 
| 140 } }  // namespace v8::internal | 140 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|