| 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_H_ | 5 #ifndef V8_SNAPSHOT_SERIALIZER_H_ |
| 6 #define V8_SNAPSHOT_SERIALIZER_H_ | 6 #define V8_SNAPSHOT_SERIALIZER_H_ |
| 7 | 7 |
| 8 #include "src/isolate.h" | 8 #include "src/isolate.h" |
| 9 #include "src/log.h" | 9 #include "src/log.h" |
| 10 #include "src/objects.h" | 10 #include "src/objects.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 void CodeDisableOptEvent(AbstractCode* code, | 31 void CodeDisableOptEvent(AbstractCode* code, |
| 32 SharedFunctionInfo* shared) override {} | 32 SharedFunctionInfo* shared) override {} |
| 33 | 33 |
| 34 const char* Lookup(Address address) { | 34 const char* Lookup(Address address) { |
| 35 return address_to_name_map_.Lookup(address); | 35 return address_to_name_map_.Lookup(address); |
| 36 } | 36 } |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 class NameMap { | 39 class NameMap { |
| 40 public: | 40 public: |
| 41 NameMap() : impl_(base::HashMap::PointersMatch) {} | 41 NameMap() : impl_() {} |
| 42 | 42 |
| 43 ~NameMap() { | 43 ~NameMap() { |
| 44 for (base::HashMap::Entry* p = impl_.Start(); p != NULL; | 44 for (base::HashMap::Entry* p = impl_.Start(); p != NULL; |
| 45 p = impl_.Next(p)) { | 45 p = impl_.Next(p)) { |
| 46 DeleteArray(static_cast<const char*>(p->value)); | 46 DeleteArray(static_cast<const char*>(p->value)); |
| 47 } | 47 } |
| 48 } | 48 } |
| 49 | 49 |
| 50 void Insert(Address code_address, const char* name, int name_size) { | 50 void Insert(Address code_address, const char* name, int name_size) { |
| 51 base::HashMap::Entry* entry = FindOrCreateEntry(code_address); | 51 base::HashMap::Entry* entry = FindOrCreateEntry(code_address); |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 SnapshotByteSink* sink_; | 323 SnapshotByteSink* sink_; |
| 324 int reference_representation_; | 324 int reference_representation_; |
| 325 int bytes_processed_so_far_; | 325 int bytes_processed_so_far_; |
| 326 bool code_has_been_output_; | 326 bool code_has_been_output_; |
| 327 }; | 327 }; |
| 328 | 328 |
| 329 } // namespace internal | 329 } // namespace internal |
| 330 } // namespace v8 | 330 } // namespace v8 |
| 331 | 331 |
| 332 #endif // V8_SNAPSHOT_SERIALIZER_H_ | 332 #endif // V8_SNAPSHOT_SERIALIZER_H_ |
| OLD | NEW |