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 VisitExternalReferences(Address* start, Address* end) { | |
343 UNREACHABLE(); | |
344 } | |
345 | |
346 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { | 342 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { |
347 UNREACHABLE(); | 343 UNREACHABLE(); |
348 } | 344 } |
349 | 345 |
350 // Allocation sites are present in the snapshot, and must be linked into | 346 // Allocation sites are present in the snapshot, and must be linked into |
351 // a list at deserialization time. | 347 // a list at deserialization time. |
352 void RelinkAllocationSite(AllocationSite* site); | 348 void RelinkAllocationSite(AllocationSite* site); |
353 | 349 |
354 // Fills in some heap data in an area from start to end (non-inclusive). The | 350 // Fills in some heap data in an area from start to end (non-inclusive). The |
355 // space id is used for the write barrier. The object_address is the address | 351 // space id is used for the write barrier. The object_address is the address |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 : serializer_(serializer), | 510 : serializer_(serializer), |
515 object_(HeapObject::cast(o)), | 511 object_(HeapObject::cast(o)), |
516 sink_(sink), | 512 sink_(sink), |
517 reference_representation_(how_to_code + where_to_point), | 513 reference_representation_(how_to_code + where_to_point), |
518 bytes_processed_so_far_(0), | 514 bytes_processed_so_far_(0), |
519 code_object_(o->IsCode()), | 515 code_object_(o->IsCode()), |
520 code_has_been_output_(false) { } | 516 code_has_been_output_(false) { } |
521 void Serialize(); | 517 void Serialize(); |
522 void VisitPointers(Object** start, Object** end); | 518 void VisitPointers(Object** start, Object** end); |
523 void VisitEmbeddedPointer(RelocInfo* target); | 519 void VisitEmbeddedPointer(RelocInfo* target); |
524 void VisitExternalReferences(Address* start, Address* end); | 520 void VisitExternalReference(Address* p); |
525 void VisitExternalReference(RelocInfo* rinfo); | 521 void VisitExternalReference(RelocInfo* rinfo); |
526 void VisitCodeTarget(RelocInfo* target); | 522 void VisitCodeTarget(RelocInfo* target); |
527 void VisitCodeEntry(Address entry_address); | 523 void VisitCodeEntry(Address entry_address); |
528 void VisitCell(RelocInfo* rinfo); | 524 void VisitCell(RelocInfo* rinfo); |
529 void VisitRuntimeEntry(RelocInfo* reloc); | 525 void VisitRuntimeEntry(RelocInfo* reloc); |
530 // Used for seralizing the external strings that hold the natives source. | 526 // Used for seralizing the external strings that hold the natives source. |
531 void VisitExternalAsciiString( | 527 void VisitExternalAsciiString( |
532 v8::String::ExternalAsciiStringResource** resource); | 528 v8::String::ExternalAsciiStringResource** resource); |
533 // We can't serialize a heap with external two byte strings. | 529 // We can't serialize a heap with external two byte strings. |
534 void VisitExternalTwoByteString( | 530 void VisitExternalTwoByteString( |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 private: | 663 private: |
668 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 664 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
669 return false; | 665 return false; |
670 } | 666 } |
671 }; | 667 }; |
672 | 668 |
673 | 669 |
674 } } // namespace v8::internal | 670 } } // namespace v8::internal |
675 | 671 |
676 #endif // V8_SERIALIZE_H_ | 672 #endif // V8_SERIALIZE_H_ |
OLD | NEW |