| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 362 |
| 363 HashMap* serialization_map_; | 363 HashMap* serialization_map_; |
| 364 AssertNoAllocation* no_allocation_; | 364 AssertNoAllocation* no_allocation_; |
| 365 DISALLOW_COPY_AND_ASSIGN(SerializationAddressMapper); | 365 DISALLOW_COPY_AND_ASSIGN(SerializationAddressMapper); |
| 366 }; | 366 }; |
| 367 | 367 |
| 368 | 368 |
| 369 class Serializer : public SerializerDeserializer { | 369 class Serializer : public SerializerDeserializer { |
| 370 public: | 370 public: |
| 371 explicit Serializer(SnapshotByteSink* sink); | 371 explicit Serializer(SnapshotByteSink* sink); |
| 372 ~Serializer(); |
| 372 void VisitPointers(Object** start, Object** end); | 373 void VisitPointers(Object** start, Object** end); |
| 373 // You can call this after serialization to find out how much space was used | 374 // You can call this after serialization to find out how much space was used |
| 374 // in each space. | 375 // in each space. |
| 375 int CurrentAllocationAddress(int space) { | 376 int CurrentAllocationAddress(int space) { |
| 376 if (SpaceIsLarge(space)) return large_object_total_; | 377 if (SpaceIsLarge(space)) return large_object_total_; |
| 377 return fullness_[space]; | 378 return fullness_[space]; |
| 378 } | 379 } |
| 379 | 380 |
| 380 static void Enable() { | 381 static void Enable() { |
| 381 if (!serialization_enabled_) { | 382 if (!serialization_enabled_) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 537 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } | 538 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } |
| 538 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 539 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
| 539 return false; | 540 return false; |
| 540 } | 541 } |
| 541 }; | 542 }; |
| 542 | 543 |
| 543 | 544 |
| 544 } } // namespace v8::internal | 545 } } // namespace v8::internal |
| 545 | 546 |
| 546 #endif // V8_SERIALIZE_H_ | 547 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |