| OLD | NEW |
| 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 Loading... |
| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 bool owns_data_; | 306 bool owns_data_; |
| 306 | 307 |
| 307 private: | 308 private: |
| 308 DISALLOW_COPY_AND_ASSIGN(SerializedData); | 309 DISALLOW_COPY_AND_ASSIGN(SerializedData); |
| 309 }; | 310 }; |
| 310 | 311 |
| 311 } // namespace internal | 312 } // namespace internal |
| 312 } // namespace v8 | 313 } // namespace v8 |
| 313 | 314 |
| 314 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ | 315 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ |
| OLD | NEW |