| 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 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 | 14 |
| 15 class Isolate; | 15 class Isolate; |
| 16 | 16 |
| 17 class ExternalReferenceEncoder { | 17 class ExternalReferenceEncoder { |
| 18 public: | 18 public: |
| 19 explicit ExternalReferenceEncoder(Isolate* isolate); | 19 explicit ExternalReferenceEncoder(Isolate* isolate); |
| 20 | 20 |
| 21 uint32_t Encode(Address key) const; | 21 uint32_t Encode(Address key) const; |
| 22 | 22 |
| 23 const char* NameOfAddress(Isolate* isolate, Address address) const; | 23 const char* NameOfAddress(Isolate* isolate, Address address) const; |
| 24 | 24 |
| 25 private: | 25 private: |
| 26 static uint32_t Hash(Address key) { | 26 AddressToIndexHashMap* map_; |
| 27 return static_cast<uint32_t>(reinterpret_cast<uintptr_t>(key) >> | |
| 28 kPointerSizeLog2); | |
| 29 } | |
| 30 | |
| 31 base::HashMap* map_; | |
| 32 | 27 |
| 33 DISALLOW_COPY_AND_ASSIGN(ExternalReferenceEncoder); | 28 DISALLOW_COPY_AND_ASSIGN(ExternalReferenceEncoder); |
| 34 }; | 29 }; |
| 35 | 30 |
| 36 class HotObjectsList { | 31 class HotObjectsList { |
| 37 public: | 32 public: |
| 38 HotObjectsList() : index_(0) { | 33 HotObjectsList() : index_(0) { |
| 39 for (int i = 0; i < kSize; i++) circular_queue_[i] = NULL; | 34 for (int i = 0; i < kSize; i++) circular_queue_[i] = NULL; |
| 40 } | 35 } |
| 41 | 36 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 275 |
| 281 byte* data_; | 276 byte* data_; |
| 282 int size_; | 277 int size_; |
| 283 bool owns_data_; | 278 bool owns_data_; |
| 284 }; | 279 }; |
| 285 | 280 |
| 286 } // namespace internal | 281 } // namespace internal |
| 287 } // namespace v8 | 282 } // namespace v8 |
| 288 | 283 |
| 289 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ | 284 #endif // V8_SNAPSHOT_SERIALIZER_COMMON_H_ |
| OLD | NEW |