OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 #endif | 147 #endif |
148 | 148 |
149 static bool enabled() { return serialization_enabled_; } | 149 static bool enabled() { return serialization_enabled_; } |
150 | 150 |
151 static void Enable() { serialization_enabled_ = true; } | 151 static void Enable() { serialization_enabled_ = true; } |
152 static void Disable() { serialization_enabled_ = false; } | 152 static void Disable() { serialization_enabled_ = false; } |
153 | 153 |
154 private: | 154 private: |
155 friend class ReferenceUpdater; | 155 friend class ReferenceUpdater; |
156 | 156 |
| 157 virtual void BeginCodeIteration(Code* code) { } |
157 virtual void VisitPointers(Object** start, Object** end); | 158 virtual void VisitPointers(Object** start, Object** end); |
158 | 159 virtual void VisitCodeTarget(RelocInfo* rinfo); |
159 bool IsVisited(HeapObject* obj); | 160 bool IsVisited(HeapObject* obj); |
160 | 161 |
161 Address GetSavedAddress(HeapObject* obj); | 162 Address GetSavedAddress(HeapObject* obj); |
162 | 163 |
163 void SaveAddress(HeapObject* obj, Address addr); | 164 void SaveAddress(HeapObject* obj, Address addr); |
164 | 165 |
165 void PutEncodedAddress(Address addr); | 166 void PutEncodedAddress(Address addr); |
166 // Write the global flags into the file. | 167 // Write the global flags into the file. |
167 void PutFlags(); | 168 void PutFlags(); |
168 // Write global information into the header of the file. | 169 // Write global information into the header of the file. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 int roots() { return roots_; } | 283 int roots() { return roots_; } |
283 int objects() { return objects_; } | 284 int objects() { return objects_; } |
284 | 285 |
285 #ifdef DEBUG | 286 #ifdef DEBUG |
286 // Check for the presence of "tag" in the serialized stream | 287 // Check for the presence of "tag" in the serialized stream |
287 virtual void Synchronize(const char* tag); | 288 virtual void Synchronize(const char* tag); |
288 #endif | 289 #endif |
289 | 290 |
290 private: | 291 private: |
291 virtual void VisitPointers(Object** start, Object** end); | 292 virtual void VisitPointers(Object** start, Object** end); |
| 293 virtual void BeginCodeIteration(Code* code) { } |
| 294 virtual void VisitCodeTarget(RelocInfo* rinfo); |
292 virtual void VisitExternalReferences(Address* start, Address* end); | 295 virtual void VisitExternalReferences(Address* start, Address* end); |
293 virtual void VisitRuntimeEntry(RelocInfo* rinfo); | 296 virtual void VisitRuntimeEntry(RelocInfo* rinfo); |
294 | 297 |
295 Address GetEncodedAddress(); | 298 Address GetEncodedAddress(); |
296 | 299 |
297 // Read other global information (except flags) from the header of the file. | 300 // Read other global information (except flags) from the header of the file. |
298 void GetHeader(); | 301 void GetHeader(); |
299 // Read a stack of handles from the file bottom first. | 302 // Read a stack of handles from the file bottom first. |
300 void GetGlobalHandleStack(List<Handle<Object> >* stack); | 303 void GetGlobalHandleStack(List<Handle<Object> >* stack); |
301 // Read the context stack from the file. | 304 // Read the context stack from the file. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 #ifdef DEBUG | 337 #ifdef DEBUG |
335 bool expect_debug_information_; | 338 bool expect_debug_information_; |
336 #endif | 339 #endif |
337 | 340 |
338 DISALLOW_COPY_AND_ASSIGN(Deserializer); | 341 DISALLOW_COPY_AND_ASSIGN(Deserializer); |
339 }; | 342 }; |
340 | 343 |
341 } } // namespace v8::internal | 344 } } // namespace v8::internal |
342 | 345 |
343 #endif // V8_SERIALIZE_H_ | 346 #endif // V8_SERIALIZE_H_ |
OLD | NEW |