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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 protected: | 601 protected: |
602 virtual int PartialSnapshotCacheIndex(HeapObject* o); | 602 virtual int PartialSnapshotCacheIndex(HeapObject* o); |
603 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 603 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
604 // Scripts should be referred only through shared function infos. We can't | 604 // Scripts should be referred only through shared function infos. We can't |
605 // allow them to be part of the partial snapshot because they contain a | 605 // allow them to be part of the partial snapshot because they contain a |
606 // unique ID, and deserializing several partial snapshots containing script | 606 // unique ID, and deserializing several partial snapshots containing script |
607 // would cause dupes. | 607 // would cause dupes. |
608 ASSERT(!o->IsScript()); | 608 ASSERT(!o->IsScript()); |
609 return o->IsString() || o->IsSharedFunctionInfo() || | 609 return o->IsString() || o->IsSharedFunctionInfo() || |
610 o->IsHeapNumber() || o->IsCode() || | 610 o->IsHeapNumber() || o->IsCode() || |
611 o->IsSerializedScopeInfo() || | 611 o->IsScopeInfo() || |
612 o->map() == HEAP->fixed_cow_array_map(); | 612 o->map() == HEAP->fixed_cow_array_map(); |
613 } | 613 } |
614 | 614 |
615 private: | 615 private: |
616 Serializer* startup_serializer_; | 616 Serializer* startup_serializer_; |
617 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); | 617 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); |
618 }; | 618 }; |
619 | 619 |
620 | 620 |
621 class StartupSerializer : public Serializer { | 621 class StartupSerializer : public Serializer { |
(...skipping 22 matching lines...) Expand all Loading... |
644 private: | 644 private: |
645 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 645 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
646 return false; | 646 return false; |
647 } | 647 } |
648 }; | 648 }; |
649 | 649 |
650 | 650 |
651 } } // namespace v8::internal | 651 } } // namespace v8::internal |
652 | 652 |
653 #endif // V8_SERIALIZE_H_ | 653 #endif // V8_SERIALIZE_H_ |
OLD | NEW |