Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(602)

Side by Side Diff: src/serialize.h

Issue 3144002: Copy-on-write arrays. (Closed)
Patch Set: Review fixes. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/runtime.cc ('k') | src/v8-counters.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | src/v8-counters.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698