Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 165 FlushICacheForNewCodeObjectsAndRecordEmbeddedObjects(); | 165 FlushICacheForNewCodeObjectsAndRecordEmbeddedObjects(); |
| 166 result = Handle<HeapObject>(HeapObject::cast(root)); | 166 result = Handle<HeapObject>(HeapObject::cast(root)); |
| 167 isolate->heap()->RegisterReservationsForBlackAllocation(reservations_); | 167 isolate->heap()->RegisterReservationsForBlackAllocation(reservations_); |
| 168 } | 168 } |
| 169 CommitPostProcessedObjects(isolate); | 169 CommitPostProcessedObjects(isolate); |
| 170 return scope.CloseAndEscape(result); | 170 return scope.CloseAndEscape(result); |
| 171 } | 171 } |
| 172 } | 172 } |
| 173 | 173 |
| 174 Deserializer::~Deserializer() { | 174 Deserializer::~Deserializer() { |
| 175 // TODO(svenpanne) Re-enable this assertion when v8 initialization is fixed. | |
| 176 // DCHECK(source_.AtEOF()); | |
| 177 #ifdef DEBUG | 175 #ifdef DEBUG |
| 176 // Do not perform checks if we aborted deserialization. | |
| 177 if (source_.position() == 0) return; | |
| 178 while (source_.HasMore()) { | |
| 179 byte next = source_.Get(); | |
| 180 CHECK_EQ(kNop, next); | |
|
vogelheim
2017/03/09 12:21:27
For my understanding: This loop is meant to compen
Yang
2017/03/09 12:22:24
Yes.
| |
| 181 } | |
| 178 for (int space = 0; space < kNumberOfPreallocatedSpaces; space++) { | 182 for (int space = 0; space < kNumberOfPreallocatedSpaces; space++) { |
| 179 int chunk_index = current_chunk_[space]; | 183 int chunk_index = current_chunk_[space]; |
| 180 CHECK_EQ(reservations_[space].length(), chunk_index + 1); | 184 CHECK_EQ(reservations_[space].length(), chunk_index + 1); |
| 181 CHECK_EQ(reservations_[space][chunk_index].end, high_water_[space]); | 185 CHECK_EQ(reservations_[space][chunk_index].end, high_water_[space]); |
| 182 } | 186 } |
| 183 CHECK_EQ(allocated_maps_.length(), next_map_index_); | 187 CHECK_EQ(allocated_maps_.length(), next_map_index_); |
| 184 #endif // DEBUG | 188 #endif // DEBUG |
| 185 } | 189 } |
| 186 | 190 |
| 187 // This is called on the roots. It is the driver of the deserialization | 191 // This is called on the roots. It is the driver of the deserialization |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 | 869 |
| 866 default: | 870 default: |
| 867 CHECK(false); | 871 CHECK(false); |
| 868 } | 872 } |
| 869 } | 873 } |
| 870 CHECK_EQ(limit, current); | 874 CHECK_EQ(limit, current); |
| 871 return true; | 875 return true; |
| 872 } | 876 } |
| 873 } // namespace internal | 877 } // namespace internal |
| 874 } // namespace v8 | 878 } // namespace v8 |
| OLD | NEW |