| 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 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 explicit StartupSerializer(SnapshotByteSink* sink) : Serializer(sink) { | 631 explicit StartupSerializer(SnapshotByteSink* sink) : Serializer(sink) { |
| 632 // Clear the cache of objects used by the partial snapshot. After the | 632 // Clear the cache of objects used by the partial snapshot. After the |
| 633 // strong roots have been serialized we can create a partial snapshot | 633 // strong roots have been serialized we can create a partial snapshot |
| 634 // which will repopulate the cache with objects needed by that partial | 634 // which will repopulate the cache with objects needed by that partial |
| 635 // snapshot. | 635 // snapshot. |
| 636 Isolate::Current()->set_serialize_partial_snapshot_cache_length(0); | 636 Isolate::Current()->set_serialize_partial_snapshot_cache_length(0); |
| 637 } | 637 } |
| 638 // Serialize the current state of the heap. The order is: | 638 // Serialize the current state of the heap. The order is: |
| 639 // 1) Strong references. | 639 // 1) Strong references. |
| 640 // 2) Partial snapshot cache. | 640 // 2) Partial snapshot cache. |
| 641 // 3) Weak references (e.g. the symbol table). | 641 // 3) Weak references (e.g. the string table). |
| 642 virtual void SerializeStrongReferences(); | 642 virtual void SerializeStrongReferences(); |
| 643 virtual void SerializeObject(Object* o, | 643 virtual void SerializeObject(Object* o, |
| 644 HowToCode how_to_code, | 644 HowToCode how_to_code, |
| 645 WhereToPoint where_to_point, | 645 WhereToPoint where_to_point, |
| 646 int skip); | 646 int skip); |
| 647 void SerializeWeakReferences(); | 647 void SerializeWeakReferences(); |
| 648 void Serialize() { | 648 void Serialize() { |
| 649 SerializeStrongReferences(); | 649 SerializeStrongReferences(); |
| 650 SerializeWeakReferences(); | 650 SerializeWeakReferences(); |
| 651 Pad(); | 651 Pad(); |
| 652 } | 652 } |
| 653 | 653 |
| 654 private: | 654 private: |
| 655 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 655 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
| 656 return false; | 656 return false; |
| 657 } | 657 } |
| 658 }; | 658 }; |
| 659 | 659 |
| 660 | 660 |
| 661 } } // namespace v8::internal | 661 } } // namespace v8::internal |
| 662 | 662 |
| 663 #endif // V8_SERIALIZE_H_ | 663 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |