OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1319 isolate->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG); | 1319 isolate->heap()->IterateStrongRoots(this, VISIT_ONLY_STRONG); |
1320 } | 1320 } |
1321 | 1321 |
1322 | 1322 |
1323 void PartialSerializer::Serialize(Object** object) { | 1323 void PartialSerializer::Serialize(Object** object) { |
1324 this->VisitPointer(object); | 1324 this->VisitPointer(object); |
1325 Pad(); | 1325 Pad(); |
1326 } | 1326 } |
1327 | 1327 |
1328 | 1328 |
| 1329 bool Serializer::ShouldBeSkipped(Object** current) { |
| 1330 Object** roots = isolate()->heap()->roots_array_start(); |
| 1331 return current == &roots[Heap::kStoreBufferTopRootIndex] |
| 1332 || current == &roots[Heap::kStackLimitRootIndex] |
| 1333 || current == &roots[Heap::kRealStackLimitRootIndex]; |
| 1334 } |
| 1335 |
| 1336 |
1329 void Serializer::VisitPointers(Object** start, Object** end) { | 1337 void Serializer::VisitPointers(Object** start, Object** end) { |
1330 Isolate* isolate = this->isolate();; | 1338 Isolate* isolate = this->isolate();; |
1331 | 1339 |
1332 for (Object** current = start; current < end; current++) { | 1340 for (Object** current = start; current < end; current++) { |
1333 if (start == isolate->heap()->roots_array_start()) { | 1341 if (start == isolate->heap()->roots_array_start()) { |
1334 root_index_wave_front_ = | 1342 root_index_wave_front_ = |
1335 Max(root_index_wave_front_, static_cast<intptr_t>(current - start)); | 1343 Max(root_index_wave_front_, static_cast<intptr_t>(current - start)); |
1336 } | 1344 } |
1337 if (reinterpret_cast<Address>(current) == | 1345 if (ShouldBeSkipped(current)) { |
1338 isolate->heap()->store_buffer()->TopAddress()) { | |
1339 sink_->Put(kSkip, "Skip"); | 1346 sink_->Put(kSkip, "Skip"); |
1340 sink_->PutInt(kPointerSize, "SkipOneWord"); | 1347 sink_->PutInt(kPointerSize, "SkipOneWord"); |
1341 } else if ((*current)->IsSmi()) { | 1348 } else if ((*current)->IsSmi()) { |
1342 sink_->Put(kRawData + 1, "Smi"); | 1349 sink_->Put(kRawData + 1, "Smi"); |
1343 for (int i = 0; i < kPointerSize; i++) { | 1350 for (int i = 0; i < kPointerSize; i++) { |
1344 sink_->Put(reinterpret_cast<byte*>(current)[i], "Byte"); | 1351 sink_->Put(reinterpret_cast<byte*>(current)[i], "Byte"); |
1345 } | 1352 } |
1346 } else { | 1353 } else { |
1347 SerializeObject(*current, kPlain, kStartOfObject, 0); | 1354 SerializeObject(*current, kPlain, kStartOfObject, 0); |
1348 } | 1355 } |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1865 | 1872 |
1866 bool SnapshotByteSource::AtEOF() { | 1873 bool SnapshotByteSource::AtEOF() { |
1867 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; | 1874 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; |
1868 for (int x = position_; x < length_; x++) { | 1875 for (int x = position_; x < length_; x++) { |
1869 if (data_[x] != SerializerDeserializer::nop()) return false; | 1876 if (data_[x] != SerializerDeserializer::nop()) return false; |
1870 } | 1877 } |
1871 return true; | 1878 return true; |
1872 } | 1879 } |
1873 | 1880 |
1874 } } // namespace v8::internal | 1881 } } // namespace v8::internal |
OLD | NEW |