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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 virtual int PartialSnapshotCacheIndex(HeapObject* o); | 613 virtual int PartialSnapshotCacheIndex(HeapObject* o); |
614 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 614 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
615 // Scripts should be referred only through shared function infos. We can't | 615 // Scripts should be referred only through shared function infos. We can't |
616 // allow them to be part of the partial snapshot because they contain a | 616 // allow them to be part of the partial snapshot because they contain a |
617 // unique ID, and deserializing several partial snapshots containing script | 617 // unique ID, and deserializing several partial snapshots containing script |
618 // would cause dupes. | 618 // would cause dupes. |
619 ASSERT(!o->IsScript()); | 619 ASSERT(!o->IsScript()); |
620 return o->IsName() || o->IsSharedFunctionInfo() || | 620 return o->IsName() || o->IsSharedFunctionInfo() || |
621 o->IsHeapNumber() || o->IsCode() || | 621 o->IsHeapNumber() || o->IsCode() || |
622 o->IsScopeInfo() || | 622 o->IsScopeInfo() || |
623 o->map() == HEAP->fixed_cow_array_map(); | 623 o->map() == |
| 624 startup_serializer_->isolate()->heap()->fixed_cow_array_map(); |
624 } | 625 } |
625 | 626 |
626 private: | 627 private: |
627 Serializer* startup_serializer_; | 628 Serializer* startup_serializer_; |
628 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); | 629 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); |
629 }; | 630 }; |
630 | 631 |
631 | 632 |
632 class StartupSerializer : public Serializer { | 633 class StartupSerializer : public Serializer { |
633 public: | 634 public: |
(...skipping 24 matching lines...) Expand all Loading... |
658 private: | 659 private: |
659 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 660 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
660 return false; | 661 return false; |
661 } | 662 } |
662 }; | 663 }; |
663 | 664 |
664 | 665 |
665 } } // namespace v8::internal | 666 } } // namespace v8::internal |
666 | 667 |
667 #endif // V8_SERIALIZE_H_ | 668 #endif // V8_SERIALIZE_H_ |
OLD | NEW |