| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 explicit Deserializer(SnapshotByteSource* source); | 334 explicit Deserializer(SnapshotByteSource* source); |
| 335 | 335 |
| 336 virtual ~Deserializer(); | 336 virtual ~Deserializer(); |
| 337 | 337 |
| 338 // Deserialize the snapshot into an empty heap. | 338 // Deserialize the snapshot into an empty heap. |
| 339 void Deserialize(); | 339 void Deserialize(); |
| 340 | 340 |
| 341 // Deserialize a single object and the objects reachable from it. | 341 // Deserialize a single object and the objects reachable from it. |
| 342 void DeserializePartial(Object** root); | 342 void DeserializePartial(Object** root); |
| 343 | 343 |
| 344 #ifdef DEBUG | |
| 345 virtual void Synchronize(const char* tag); | |
| 346 #endif | |
| 347 | |
| 348 private: | 344 private: |
| 349 virtual void VisitPointers(Object** start, Object** end); | 345 virtual void VisitPointers(Object** start, Object** end); |
| 350 | 346 |
| 351 virtual void VisitExternalReferences(Address* start, Address* end) { | 347 virtual void VisitExternalReferences(Address* start, Address* end) { |
| 352 UNREACHABLE(); | 348 UNREACHABLE(); |
| 353 } | 349 } |
| 354 | 350 |
| 355 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { | 351 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { |
| 356 UNREACHABLE(); | 352 UNREACHABLE(); |
| 357 } | 353 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 478 } | 474 } |
| 479 | 475 |
| 480 static void Disable() { serialization_enabled_ = false; } | 476 static void Disable() { serialization_enabled_ = false; } |
| 481 // Call this when you have made use of the fact that there is no serialization | 477 // Call this when you have made use of the fact that there is no serialization |
| 482 // going on. | 478 // going on. |
| 483 static void TooLateToEnableNow() { too_late_to_enable_now_ = true; } | 479 static void TooLateToEnableNow() { too_late_to_enable_now_ = true; } |
| 484 static bool enabled() { return serialization_enabled_; } | 480 static bool enabled() { return serialization_enabled_; } |
| 485 SerializationAddressMapper* address_mapper() { return &address_mapper_; } | 481 SerializationAddressMapper* address_mapper() { return &address_mapper_; } |
| 486 void PutRoot( | 482 void PutRoot( |
| 487 int index, HeapObject* object, HowToCode how, WhereToPoint where); | 483 int index, HeapObject* object, HowToCode how, WhereToPoint where); |
| 488 #ifdef DEBUG | |
| 489 virtual void Synchronize(const char* tag); | |
| 490 #endif | |
| 491 | 484 |
| 492 protected: | 485 protected: |
| 493 static const int kInvalidRootIndex = -1; | 486 static const int kInvalidRootIndex = -1; |
| 494 | 487 |
| 495 int RootIndex(HeapObject* heap_object); | 488 int RootIndex(HeapObject* heap_object); |
| 496 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) = 0; | 489 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) = 0; |
| 497 intptr_t root_index_wave_front() { return root_index_wave_front_; } | 490 intptr_t root_index_wave_front() { return root_index_wave_front_; } |
| 498 void set_root_index_wave_front(intptr_t value) { | 491 void set_root_index_wave_front(intptr_t value) { |
| 499 ASSERT(value >= root_index_wave_front_); | 492 ASSERT(value >= root_index_wave_front_); |
| 500 root_index_wave_front_ = value; | 493 root_index_wave_front_ = value; |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 private: | 640 private: |
| 648 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 641 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
| 649 return false; | 642 return false; |
| 650 } | 643 } |
| 651 }; | 644 }; |
| 652 | 645 |
| 653 | 646 |
| 654 } } // namespace v8::internal | 647 } } // namespace v8::internal |
| 655 | 648 |
| 656 #endif // V8_SERIALIZE_H_ | 649 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |