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

Side by Side Diff: src/serialize.h

Issue 560031: Create a test that serializes and deserializes a context. Fix... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/partial_snapshots/
Patch Set: Created 10 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/serialize.cc » ('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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 // A bitmask for getting the space out of an instruction. 225 // A bitmask for getting the space out of an instruction.
226 static const int kSpaceMask = 15; 226 static const int kSpaceMask = 15;
227 227
228 static inline bool SpaceIsLarge(int space) { return space >= kLargeData; } 228 static inline bool SpaceIsLarge(int space) { return space >= kLargeData; }
229 static inline bool SpaceIsPaged(int space) { 229 static inline bool SpaceIsPaged(int space) {
230 return space >= FIRST_PAGED_SPACE && space <= LAST_PAGED_SPACE; 230 return space >= FIRST_PAGED_SPACE && space <= LAST_PAGED_SPACE;
231 } 231 }
232 232
233 static int partial_snapshot_cache_length_; 233 static int partial_snapshot_cache_length_;
234 static const int kPartialSnapshotCacheCapacity = 1024; 234 static const int kPartialSnapshotCacheCapacity = 1300;
235 static Object* partial_snapshot_cache_[]; 235 static Object* partial_snapshot_cache_[];
236 static bool tracing_; 236 static bool tracing_;
237 }; 237 };
238 238
239 239
240 int SnapshotByteSource::GetInt() { 240 int SnapshotByteSource::GetInt() {
241 // A little unwind to catch the really small ints. 241 // A little unwind to catch the really small ints.
242 int snapshot_byte = Get(); 242 int snapshot_byte = Get();
243 if ((snapshot_byte & 0x80) == 0) { 243 if ((snapshot_byte & 0x80) == 0) {
244 SerializerDeserializer::Trace("Tag IntLastPart", snapshot_byte); 244 SerializerDeserializer::Trace("Tag IntLastPart", snapshot_byte);
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 515
516 // Serialize the objects reachable from a single object pointer. 516 // Serialize the objects reachable from a single object pointer.
517 virtual void Serialize(Object** o); 517 virtual void Serialize(Object** o);
518 virtual void SerializeObject(Object* o, 518 virtual void SerializeObject(Object* o,
519 ReferenceRepresentation representation); 519 ReferenceRepresentation representation);
520 520
521 protected: 521 protected:
522 virtual int RootIndex(HeapObject* o); 522 virtual int RootIndex(HeapObject* o);
523 virtual int PartialSnapshotCacheIndex(HeapObject* o); 523 virtual int PartialSnapshotCacheIndex(HeapObject* o);
524 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { 524 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) {
525 return o->IsString() || o->IsSharedFunctionInfo(); 525 return o->IsString() || o->IsSharedFunctionInfo() || o->IsHeapNumber();
526 } 526 }
527 527
528 private: 528 private:
529 Serializer* startup_serializer_; 529 Serializer* startup_serializer_;
530 DISALLOW_COPY_AND_ASSIGN(PartialSerializer); 530 DISALLOW_COPY_AND_ASSIGN(PartialSerializer);
531 }; 531 };
532 532
533 533
534 class StartupSerializer : public Serializer { 534 class StartupSerializer : public Serializer {
535 public: 535 public:
(...skipping 21 matching lines...) Expand all
557 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; } 557 virtual int RootIndex(HeapObject* o) { return kInvalidRootIndex; }
558 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) { 558 virtual bool ShouldBeInThePartialSnapshotCache(HeapObject* o) {
559 return false; 559 return false;
560 } 560 }
561 }; 561 };
562 562
563 563
564 } } // namespace v8::internal 564 } } // namespace v8::internal
565 565
566 #endif // V8_SERIALIZE_H_ 566 #endif // V8_SERIALIZE_H_
OLDNEW
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698