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 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 int skip); | 606 int skip); |
607 | 607 |
608 protected: | 608 protected: |
609 virtual int PartialSnapshotCacheIndex(HeapObject* o); | 609 virtual int PartialSnapshotCacheIndex(HeapObject* o); |
610 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 610 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
611 // Scripts should be referred only through shared function infos. We can't | 611 // Scripts should be referred only through shared function infos. We can't |
612 // allow them to be part of the partial snapshot because they contain a | 612 // allow them to be part of the partial snapshot because they contain a |
613 // unique ID, and deserializing several partial snapshots containing script | 613 // unique ID, and deserializing several partial snapshots containing script |
614 // would cause dupes. | 614 // would cause dupes. |
615 ASSERT(!o->IsScript()); | 615 ASSERT(!o->IsScript()); |
616 return o->IsString() || o->IsSharedFunctionInfo() || | 616 return o->IsName() || o->IsSharedFunctionInfo() || |
617 o->IsHeapNumber() || o->IsCode() || | 617 o->IsHeapNumber() || o->IsCode() || |
618 o->IsScopeInfo() || | 618 o->IsScopeInfo() || |
619 o->map() == HEAP->fixed_cow_array_map(); | 619 o->map() == HEAP->fixed_cow_array_map(); |
620 } | 620 } |
621 | 621 |
622 private: | 622 private: |
623 Serializer* startup_serializer_; | 623 Serializer* startup_serializer_; |
624 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); | 624 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); |
625 }; | 625 }; |
626 | 626 |
(...skipping 26 matching lines...) Expand all Loading... |
653 private: | 653 private: |
654 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 654 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
655 return false; | 655 return false; |
656 } | 656 } |
657 }; | 657 }; |
658 | 658 |
659 | 659 |
660 } } // namespace v8::internal | 660 } } // namespace v8::internal |
661 | 661 |
662 #endif // V8_SERIALIZE_H_ | 662 #endif // V8_SERIALIZE_H_ |
OLD | NEW |