Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: src/serialize.h

Issue 390353002: Fix assertion failure. Use Vector instead of List in code deserializer. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: move dispose to the destructor of Deserializer Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698