| 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void set_reservation(int space_number, int reservation) { | 247 void set_reservation(int space_number, int reservation) { |
| 248 ASSERT(space_number >= 0); | 248 ASSERT(space_number >= 0); |
| 249 ASSERT(space_number <= LAST_SPACE); | 249 ASSERT(space_number <= LAST_SPACE); |
| 250 reservations_[space_number] = reservation; | 250 reservations_[space_number] = reservation; |
| 251 } | 251 } |
| 252 | 252 |
| 253 void FlushICacheForNewCodeObjects(); | 253 void FlushICacheForNewCodeObjects(); |
| 254 | 254 |
| 255 // Serialized user code reference certain objects that are provided in a list | 255 // Serialized user code reference certain objects that are provided in a list |
| 256 // By calling this method, we assume that we are deserializing user code. | 256 // By calling this method, we assume that we are deserializing user code. |
| 257 void SetAttachedObjects(List<Object*>* attached_objects) { | 257 void SetAttachedObjects(Vector<Object*>* attached_objects) { |
| 258 attached_objects_ = attached_objects; | 258 attached_objects_ = attached_objects; |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool deserializing_user_code() { return attached_objects_ != NULL; } | 261 bool deserializing_user_code() { return attached_objects_ != NULL; } |
| 262 | 262 |
| 263 private: | 263 private: |
| 264 virtual void VisitPointers(Object** start, Object** end); | 264 virtual void VisitPointers(Object** start, Object** end); |
| 265 | 265 |
| 266 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { | 266 virtual void VisitRuntimeEntry(RelocInfo* rinfo) { |
| 267 UNREACHABLE(); | 267 UNREACHABLE(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 296 HeapObject* GetAddressFromEnd(int space) { | 296 HeapObject* GetAddressFromEnd(int space) { |
| 297 int offset = source_->GetInt(); | 297 int offset = source_->GetInt(); |
| 298 offset <<= kObjectAlignmentBits; | 298 offset <<= kObjectAlignmentBits; |
| 299 return HeapObject::FromAddress(high_water_[space] - offset); | 299 return HeapObject::FromAddress(high_water_[space] - offset); |
| 300 } | 300 } |
| 301 | 301 |
| 302 // Cached current isolate. | 302 // Cached current isolate. |
| 303 Isolate* isolate_; | 303 Isolate* isolate_; |
| 304 | 304 |
| 305 // Objects from the attached object descriptions in the serialized user code. | 305 // Objects from the attached object descriptions in the serialized user code. |
| 306 List<Object*>* attached_objects_; | 306 Vector<Object*>* attached_objects_; |
| 307 | 307 |
| 308 SnapshotByteSource* source_; | 308 SnapshotByteSource* source_; |
| 309 // This is the address of the next object that will be allocated in each | 309 // This is the address of the next object that will be allocated in each |
| 310 // space. It is used to calculate the addresses of back-references. | 310 // space. It is used to calculate the addresses of back-references. |
| 311 Address high_water_[LAST_SPACE + 1]; | 311 Address high_water_[LAST_SPACE + 1]; |
| 312 | 312 |
| 313 int reservations_[LAST_SPACE + 1]; | 313 int reservations_[LAST_SPACE + 1]; |
| 314 static const intptr_t kUninitializedReservation = -1; | 314 static const intptr_t kUninitializedReservation = -1; |
| 315 | 315 |
| 316 ExternalReferenceDecoder* external_reference_decoder_; | 316 ExternalReferenceDecoder* external_reference_decoder_; |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 static const int kVersionHashOffset = 0; | 657 static const int kVersionHashOffset = 0; |
| 658 static const int kReservationsOffset = 1; | 658 static const int kReservationsOffset = 1; |
| 659 static const int kHeaderEntries = 8; | 659 static const int kHeaderEntries = 8; |
| 660 | 660 |
| 661 ScriptData* script_data_; | 661 ScriptData* script_data_; |
| 662 bool owns_script_data_; | 662 bool owns_script_data_; |
| 663 }; | 663 }; |
| 664 } } // namespace v8::internal | 664 } } // namespace v8::internal |
| 665 | 665 |
| 666 #endif // V8_SERIALIZE_H_ | 666 #endif // V8_SERIALIZE_H_ |
| OLD | NEW |