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

Side by Side Diff: runtime/vm/object_store.h

Issue 8823001: Use preallocated StackOverflowException (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years 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
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_OBJECT_STORE_H_ 5 #ifndef VM_OBJECT_STORE_H_
6 #define VM_OBJECT_STORE_H_ 6 #define VM_OBJECT_STORE_H_
7 7
8 #include "vm/object.h" 8 #include "vm/object.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 void set_false_value(const Bool& value) { false_value_ = value.raw(); } 272 void set_false_value(const Bool& value) { false_value_ = value.raw(); }
273 273
274 RawArray* empty_array() const { return empty_array_; } 274 RawArray* empty_array() const { return empty_array_; }
275 void set_empty_array(const Array& value) { empty_array_ = value.raw(); } 275 void set_empty_array(const Array& value) { empty_array_ = value.raw(); }
276 276
277 RawContext* empty_context() const { return empty_context_; } 277 RawContext* empty_context() const { return empty_context_; }
278 void set_empty_context(const Context& value) { 278 void set_empty_context(const Context& value) {
279 empty_context_ = value.raw(); 279 empty_context_ = value.raw();
280 } 280 }
281 281
282 RawInstance* stack_overflow() const { return stack_overflow_; }
283 void set_stack_overflow(const Instance& value) {
284 stack_overflow_ = value.raw();
285 }
286
282 // Visit all object pointers. 287 // Visit all object pointers.
283 void VisitObjectPointers(ObjectPointerVisitor* visitor); 288 void VisitObjectPointers(ObjectPointerVisitor* visitor);
284 289
285 RawClass* GetClass(int index); 290 RawClass* GetClass(int index);
286 int GetClassIndex(const RawClass* raw_class); 291 int GetClassIndex(const RawClass* raw_class);
287 RawType* GetType(int index); 292 RawType* GetType(int index);
288 int GetTypeIndex(const RawType* raw_type); 293 int GetTypeIndex(const RawType* raw_type);
289 294
295 // Called to initialize objects required by the vm but which invoke
296 // dart code.
297 void PreallocateObjects();
298
290 static void Init(Isolate* isolate); 299 static void Init(Isolate* isolate);
291 300
292 private: 301 private:
293 ObjectStore(); 302 ObjectStore();
294 303
295 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); } 304 RawObject** from() { return reinterpret_cast<RawObject**>(&object_class_); }
296 RawClass* object_class_; 305 RawClass* object_class_;
297 RawType* object_type_; 306 RawType* object_type_;
298 RawType* null_type_; 307 RawType* null_type_;
299 RawType* dynamic_type_; 308 RawType* dynamic_type_;
(...skipping 27 matching lines...) Expand all
327 RawArray* empty_array_; 336 RawArray* empty_array_;
328 RawArray* symbol_table_; 337 RawArray* symbol_table_;
329 RawLibrary* core_library_; 338 RawLibrary* core_library_;
330 RawLibrary* core_impl_library_; 339 RawLibrary* core_impl_library_;
331 RawLibrary* native_wrappers_library_; 340 RawLibrary* native_wrappers_library_;
332 RawLibrary* root_library_; 341 RawLibrary* root_library_;
333 RawLibrary* registered_libraries_; 342 RawLibrary* registered_libraries_;
334 RawArray* pending_classes_; 343 RawArray* pending_classes_;
335 RawString* sticky_error_; 344 RawString* sticky_error_;
336 RawContext* empty_context_; 345 RawContext* empty_context_;
337 RawObject** to() { return reinterpret_cast<RawObject**>(&empty_context_); } 346 RawInstance* stack_overflow_;
347 RawObject** to() { return reinterpret_cast<RawObject**>(&stack_overflow_); }
348
349 bool preallocate_objects_called_;
338 350
339 friend class SnapshotReader; 351 friend class SnapshotReader;
340 352
341 DISALLOW_COPY_AND_ASSIGN(ObjectStore); 353 DISALLOW_COPY_AND_ASSIGN(ObjectStore);
342 }; 354 };
343 355
344 } // namespace dart 356 } // namespace dart
345 357
346 #endif // VM_OBJECT_STORE_H_ 358 #endif // VM_OBJECT_STORE_H_
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object_store.cc » ('j') | runtime/vm/object_store.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698