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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 | 496 |
497 protected: | 497 protected: |
498 virtual int RootIndex(HeapObject* o); | 498 virtual int RootIndex(HeapObject* o); |
499 virtual int PartialSnapshotCacheIndex(HeapObject* o); | 499 virtual int PartialSnapshotCacheIndex(HeapObject* o); |
500 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 500 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
501 // Scripts should be referred only through shared function infos. We can't | 501 // Scripts should be referred only through shared function infos. We can't |
502 // allow them to be part of the partial snapshot because they contain a | 502 // allow them to be part of the partial snapshot because they contain a |
503 // unique ID, and deserializing several partial snapshots containing script | 503 // unique ID, and deserializing several partial snapshots containing script |
504 // would cause dupes. | 504 // would cause dupes. |
505 ASSERT(!o->IsScript()); | 505 ASSERT(!o->IsScript()); |
506 return o->IsString() || o->IsSharedFunctionInfo() || o->IsHeapNumber(); | 506 return o->IsString() || o->IsSharedFunctionInfo() || |
| 507 o->IsHeapNumber() || o->IsCode(); |
507 } | 508 } |
508 | 509 |
509 private: | 510 private: |
510 Serializer* startup_serializer_; | 511 Serializer* startup_serializer_; |
511 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); | 512 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); |
512 }; | 513 }; |
513 | 514 |
514 | 515 |
515 class StartupSerializer : public Serializer { | 516 class StartupSerializer : public Serializer { |
516 public: | 517 public: |
(...skipping 21 matching lines...) Expand all Loading... |
538 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } | 539 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } |
539 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { | 540 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { |
540 return false; | 541 return false; |
541 } | 542 } |
542 }; | 543 }; |
543 | 544 |
544 | 545 |
545 } } // namespace v8::internal | 546 } } // namespace v8::internal |
546 | 547 |
547 #endif // V8_SERIALIZE_H_ | 548 #endif // V8_SERIALIZE_H_ |
OLD | NEW |