| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_SERIALIZE_H_ | 5 #ifndef V8_SERIALIZE_H_ |
| 6 #define V8_SERIALIZE_H_ | 6 #define V8_SERIALIZE_H_ |
| 7 | 7 |
| 8 #include "src/compiler.h" | 8 #include "src/compiler.h" |
| 9 #include "src/hashmap.h" | 9 #include "src/hashmap.h" |
| 10 #include "src/heap-profiler.h" | 10 #include "src/heap-profiler.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 static void* Key(HeapObject* obj) { | 162 static void* Key(HeapObject* obj) { |
| 163 return reinterpret_cast<void*>(obj->address()); | 163 return reinterpret_cast<void*>(obj->address()); |
| 164 } | 164 } |
| 165 }; | 165 }; |
| 166 | 166 |
| 167 | 167 |
| 168 class RootIndexMap : public AddressMapBase { | 168 class RootIndexMap : public AddressMapBase { |
| 169 public: | 169 public: |
| 170 explicit RootIndexMap(Isolate* isolate); | 170 explicit RootIndexMap(Isolate* isolate); |
| 171 | 171 |
| 172 ~RootIndexMap() { delete map_; } |
| 173 |
| 172 static const int kInvalidRootIndex = -1; | 174 static const int kInvalidRootIndex = -1; |
| 173 int Lookup(HeapObject* obj) { | 175 int Lookup(HeapObject* obj) { |
| 174 HashMap::Entry* entry = LookupEntry(map_, obj, false); | 176 HashMap::Entry* entry = LookupEntry(map_, obj, false); |
| 175 if (entry) return GetValue(entry); | 177 if (entry) return GetValue(entry); |
| 176 return kInvalidRootIndex; | 178 return kInvalidRootIndex; |
| 177 } | 179 } |
| 178 | 180 |
| 179 private: | 181 private: |
| 180 HashMap* map_; | 182 HashMap* map_; |
| 181 | 183 |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 // Following the header, we store, in sequential order | 829 // Following the header, we store, in sequential order |
| 828 // - code stub keys | 830 // - code stub keys |
| 829 // - serialization payload | 831 // - serialization payload |
| 830 | 832 |
| 831 ScriptData* script_data_; | 833 ScriptData* script_data_; |
| 832 bool owns_script_data_; | 834 bool owns_script_data_; |
| 833 }; | 835 }; |
| 834 } } // namespace v8::internal | 836 } } // namespace v8::internal |
| 835 | 837 |
| 836 #endif // V8_SERIALIZE_H_ | 838 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |