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 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 sink_->Put(kPartialSnapshotCache + how_to_code + where_to_point, | 1348 sink_->Put(kPartialSnapshotCache + how_to_code + where_to_point, |
1349 "PartialSnapshotCache"); | 1349 "PartialSnapshotCache"); |
1350 sink_->PutInt(cache_index, "partial_snapshot_cache_index"); | 1350 sink_->PutInt(cache_index, "partial_snapshot_cache_index"); |
1351 return; | 1351 return; |
1352 } | 1352 } |
1353 | 1353 |
1354 // Pointers from the partial snapshot to the objects in the startup snapshot | 1354 // Pointers from the partial snapshot to the objects in the startup snapshot |
1355 // should go through the root array or through the partial snapshot cache. | 1355 // should go through the root array or through the partial snapshot cache. |
1356 // If this is not the case you may have to add something to the root array. | 1356 // If this is not the case you may have to add something to the root array. |
1357 ASSERT(!startup_serializer_->address_mapper()->IsMapped(heap_object)); | 1357 ASSERT(!startup_serializer_->address_mapper()->IsMapped(heap_object)); |
1358 // All the symbols that the partial snapshot needs should be either in the | 1358 // All the internalized strings that the partial snapshot needs should be |
1359 // root table or in the partial snapshot cache. | 1359 // either in the root table or in the partial snapshot cache. |
1360 ASSERT(!heap_object->IsSymbol()); | 1360 ASSERT(!heap_object->IsInternalizedString()); |
1361 | 1361 |
1362 if (address_mapper_.IsMapped(heap_object)) { | 1362 if (address_mapper_.IsMapped(heap_object)) { |
1363 int space = SpaceOfObject(heap_object); | 1363 int space = SpaceOfObject(heap_object); |
1364 int address = address_mapper_.MappedTo(heap_object); | 1364 int address = address_mapper_.MappedTo(heap_object); |
1365 SerializeReferenceToPreviousObject(space, | 1365 SerializeReferenceToPreviousObject(space, |
1366 address, | 1366 address, |
1367 how_to_code, | 1367 how_to_code, |
1368 where_to_point, | 1368 where_to_point, |
1369 skip); | 1369 skip); |
1370 } else { | 1370 } else { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1651 | 1651 |
1652 bool SnapshotByteSource::AtEOF() { | 1652 bool SnapshotByteSource::AtEOF() { |
1653 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; | 1653 if (0u + length_ - position_ > 2 * sizeof(uint32_t)) return false; |
1654 for (int x = position_; x < length_; x++) { | 1654 for (int x = position_; x < length_; x++) { |
1655 if (data_[x] != SerializerDeserializer::nop()) return false; | 1655 if (data_[x] != SerializerDeserializer::nop()) return false; |
1656 } | 1656 } |
1657 return true; | 1657 return true; |
1658 } | 1658 } |
1659 | 1659 |
1660 } } // namespace v8::internal | 1660 } } // namespace v8::internal |
OLD | NEW |