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

Side by Side Diff: src/snapshot/serializer-common.h

Issue 2801073006: Decouple root visitors from object visitors. (Closed)
Patch Set: rebase Created 3 years, 7 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/snapshot/serializer.cc ('k') | src/snapshot/serializer-common.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 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_SNAPSHOT_SERIALIZER_COMMON_H_ 5 #ifndef V8_SNAPSHOT_SERIALIZER_COMMON_H_
6 #define V8_SNAPSHOT_SERIALIZER_COMMON_H_ 6 #define V8_SNAPSHOT_SERIALIZER_COMMON_H_
7 7
8 #include "src/address-map.h" 8 #include "src/address-map.h"
9 #include "src/external-reference-table.h" 9 #include "src/external-reference-table.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
11 #include "src/visitors.h"
11 12
12 namespace v8 { 13 namespace v8 {
13 namespace internal { 14 namespace internal {
14 15
15 class Isolate; 16 class Isolate;
16 17
17 class ExternalReferenceEncoder { 18 class ExternalReferenceEncoder {
18 public: 19 public:
19 explicit ExternalReferenceEncoder(Isolate* isolate); 20 explicit ExternalReferenceEncoder(Isolate* isolate);
20 21
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 static const int kSizeMask = kSize - 1; 67 static const int kSizeMask = kSize - 1;
67 HeapObject* circular_queue_[kSize]; 68 HeapObject* circular_queue_[kSize];
68 int index_; 69 int index_;
69 70
70 DISALLOW_COPY_AND_ASSIGN(HotObjectsList); 71 DISALLOW_COPY_AND_ASSIGN(HotObjectsList);
71 }; 72 };
72 73
73 // The Serializer/Deserializer class is a common superclass for Serializer and 74 // The Serializer/Deserializer class is a common superclass for Serializer and
74 // Deserializer which is used to store common constants and methods used by 75 // Deserializer which is used to store common constants and methods used by
75 // both. 76 // both.
76 class SerializerDeserializer : public ObjectVisitor { 77 class SerializerDeserializer : public RootVisitor {
77 public: 78 public:
78 static void Iterate(Isolate* isolate, ObjectVisitor* visitor); 79 static void Iterate(Isolate* isolate, RootVisitor* visitor);
79 80
80 // No reservation for large object space necessary. 81 // No reservation for large object space necessary.
81 // We also handle map space differenly. 82 // We also handle map space differenly.
82 STATIC_ASSERT(MAP_SPACE == CODE_SPACE + 1); 83 STATIC_ASSERT(MAP_SPACE == CODE_SPACE + 1);
83 static const int kNumberOfPreallocatedSpaces = CODE_SPACE + 1; 84 static const int kNumberOfPreallocatedSpaces = CODE_SPACE + 1;
84 static const int kNumberOfSpaces = LAST_SPACE + 1; 85 static const int kNumberOfSpaces = LAST_SPACE + 1;
85 86
86 protected: 87 protected:
87 static bool CanBeDeferred(HeapObject* o); 88 static bool CanBeDeferred(HeapObject* o);
88 89
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 bool owns_data_; 300 bool owns_data_;
300 301
301 private: 302 private:
302 DISALLOW_COPY_AND_ASSIGN(SerializedData); 303 DISALLOW_COPY_AND_ASSIGN(SerializedData);
303 }; 304 };
304 305
305 } // namespace internal 306 } // namespace internal
306 } // namespace v8 307 } // namespace v8
307 308
308 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ 309 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_
OLDNEW
« no previous file with comments | « src/snapshot/serializer.cc ('k') | src/snapshot/serializer-common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698