| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 | 332 |
| 333 void set_reservation(int space_number, int reservation) { | 333 void set_reservation(int space_number, int reservation) { |
| 334 ASSERT(space_number >= 0); | 334 ASSERT(space_number >= 0); |
| 335 ASSERT(space_number <= LAST_SPACE); | 335 ASSERT(space_number <= LAST_SPACE); |
| 336 reservations_[space_number] = reservation; | 336 reservations_[space_number] = reservation; |
| 337 } | 337 } |
| 338 | 338 |
| 339 private: | 339 private: |
| 340 virtual void VisitPointers(Object** start, Object** end); | 340 virtual void VisitPointers(Object** start, Object** end); |
| 341 | 341 |
| 342 virtual void VisitAllocationSite(HeapObject* site); |
| 343 |
| 342 virtual void VisitExternalReferences(Address* start, Address* end) { | 344 virtual void VisitExternalReferences(Address* start, Address* end) { |
| 343 UNREACHABLE(); | 345 UNREACHABLE(); |
| 344 } | 346 } |
| 345 | 347 |
| 346 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { | 348 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { |
| 347 UNREACHABLE(); | 349 UNREACHABLE(); |
| 348 } | 350 } |
| 349 | 351 |
| 350 // Fills in some heap data in an area from start to end (non-inclusive). The | 352 // Fills in some heap data in an area from start to end (non-inclusive). The |
| 351 // space id is used for the write barrier. The object_address is the address | 353 // space id is used for the write barrier. The object_address is the address |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // going on. | 482 // going on. |
| 481 static void TooLateToEnableNow() { too_late_to_enable_now_ = true; } | 483 static void TooLateToEnableNow() { too_late_to_enable_now_ = true; } |
| 482 static bool enabled() { return serialization_enabled_; } | 484 static bool enabled() { return serialization_enabled_; } |
| 483 SerializationAddressMapper* address_mapper() { return &address_mapper_; } | 485 SerializationAddressMapper* address_mapper() { return &address_mapper_; } |
| 484 void PutRoot(int index, | 486 void PutRoot(int index, |
| 485 HeapObject* object, | 487 HeapObject* object, |
| 486 HowToCode how, | 488 HowToCode how, |
| 487 WhereToPoint where, | 489 WhereToPoint where, |
| 488 int skip); | 490 int skip); |
| 489 | 491 |
| 492 Isolate* isolate() { return isolate_; } |
| 493 |
| 490 protected: | 494 protected: |
| 491 static const int kInvalidRootIndex = -1; | 495 static const int kInvalidRootIndex = -1; |
| 492 | 496 |
| 493 int RootIndex(HeapObject* heap_object, HowToCode from); | 497 int RootIndex(HeapObject* heap_object, HowToCode from); |
| 494 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) = 0; | 498 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) = 0; |
| 495 intptr_t root_index_wave_front() { return root_index_wave_front_; } | 499 intptr_t root_index_wave_front() { return root_index_wave_front_; } |
| 496 void set_root_index_wave_front(intptr_t value) { | 500 void set_root_index_wave_front(intptr_t value) { |
| 497 ASSERT(value >= root_index_wave_front_); | 501 ASSERT(value >= root_index_wave_front_); |
| 498 root_index_wave_front_ = value; | 502 root_index_wave_front_ = value; |
| 499 } | 503 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 511 reference_representation_(how_to_code + where_to_point), | 515 reference_representation_(how_to_code + where_to_point), |
| 512 bytes_processed_so_far_(0), | 516 bytes_processed_so_far_(0), |
| 513 code_object_(o->IsCode()), | 517 code_object_(o->IsCode()), |
| 514 code_has_been_output_(false) { } | 518 code_has_been_output_(false) { } |
| 515 void Serialize(); | 519 void Serialize(); |
| 516 void VisitPointers(Object** start, Object** end); | 520 void VisitPointers(Object** start, Object** end); |
| 517 void VisitEmbeddedPointer(RelocInfo* target); | 521 void VisitEmbeddedPointer(RelocInfo* target); |
| 518 void VisitExternalReferences(Address* start, Address* end); | 522 void VisitExternalReferences(Address* start, Address* end); |
| 519 void VisitExternalReference(RelocInfo* rinfo); | 523 void VisitExternalReference(RelocInfo* rinfo); |
| 520 void VisitCodeTarget(RelocInfo* target); | 524 void VisitCodeTarget(RelocInfo* target); |
| 525 void VisitAllocationSite(HeapObject* site); |
| 521 void VisitCodeEntry(Address entry_address); | 526 void VisitCodeEntry(Address entry_address); |
| 522 void VisitCell(RelocInfo* rinfo); | 527 void VisitCell(RelocInfo* rinfo); |
| 523 void VisitRuntimeEntry(RelocInfo* reloc); | 528 void VisitRuntimeEntry(RelocInfo* reloc); |
| 524 // Used for seralizing the external strings that hold the natives source. | 529 // Used for seralizing the external strings that hold the natives source. |
| 525 void VisitExternalAsciiString( | 530 void VisitExternalAsciiString( |
| 526 v8::String::ExternalAsciiStringResource** resource); | 531 v8::String::ExternalAsciiStringResource** resource); |
| 527 // We can't serialize a heap with external two byte strings. | 532 // We can't serialize a heap with external two byte strings. |
| 528 void VisitExternalTwoByteString( | 533 void VisitExternalTwoByteString( |
| 529 v8::String::ExternalStringResource** resource) { | 534 v8::String::ExternalStringResource** resource) { |
| 530 UNREACHABLE(); | 535 UNREACHABLE(); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 653 private: | 658 private: |
| 654 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 659 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
| 655 return false; | 660 return false; |
| 656 } | 661 } |
| 657 }; | 662 }; |
| 658 | 663 |
| 659 | 664 |
| 660 } } // namespace v8::internal | 665 } } // namespace v8::internal |
| 661 | 666 |
| 662 #endif // V8_SERIALIZE_H_ | 667 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |