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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 protected: | 529 protected: |
530 virtual int RootIndex(HeapObject* o); | 530 virtual int RootIndex(HeapObject* o); |
531 virtual int PartialSnapshotCacheIndex(HeapObject* o); | 531 virtual int PartialSnapshotCacheIndex(HeapObject* o); |
532 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 532 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
533 // Scripts should be referred only through shared function infos. We can't | 533 // Scripts should be referred only through shared function infos. We can't |
534 // allow them to be part of the partial snapshot because they contain a | 534 // allow them to be part of the partial snapshot because they contain a |
535 // unique ID, and deserializing several partial snapshots containing script | 535 // unique ID, and deserializing several partial snapshots containing script |
536 // would cause dupes. | 536 // would cause dupes. |
537 ASSERT(!o->IsScript()); | 537 ASSERT(!o->IsScript()); |
538 return o->IsString() || o->IsSharedFunctionInfo() || | 538 return o->IsString() || o->IsSharedFunctionInfo() || |
539 o->IsHeapNumber() || o->IsCode(); | 539 o->IsHeapNumber() || o->IsCode() || |
| 540 o->map() == Heap::fixed_cow_array_map(); |
540 } | 541 } |
541 | 542 |
542 private: | 543 private: |
543 Serializer* startup_serializer_; | 544 Serializer* startup_serializer_; |
544 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); | 545 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); |
545 }; | 546 }; |
546 | 547 |
547 | 548 |
548 class StartupSerializer : public Serializer { | 549 class StartupSerializer : public Serializer { |
549 public: | 550 public: |
(...skipping 22 matching lines...) Expand all Loading... |
572 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } | 573 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } |
573 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 574 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
574 return false; | 575 return false; |
575 } | 576 } |
576 }; | 577 }; |
577 | 578 |
578 | 579 |
579 } } // namespace v8::internal | 580 } } // namespace v8::internal |
580 | 581 |
581 #endif // V8_SERIALIZE_H_ | 582 #endif // V8_SERIALIZE_H_ |
OLD | NEW |