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

Side by Side Diff: runtime/vm/snapshot.cc

Issue 423193003: - Force growth when allocating objects from a snapshot. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 4 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 | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/snapshot.h" 5 #include "vm/snapshot.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/bigint_operations.h" 8 #include "vm/bigint_operations.h"
9 #include "vm/bootstrap.h" 9 #include "vm/bootstrap.h"
10 #include "vm/class_finalizer.h" 10 #include "vm/class_finalizer.h"
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 return Class::null(); 738 return Class::null();
739 } 739 }
740 740
741 741
742 RawObject* SnapshotReader::AllocateUninitialized(const Class& cls, 742 RawObject* SnapshotReader::AllocateUninitialized(const Class& cls,
743 intptr_t size) { 743 intptr_t size) {
744 ASSERT(isolate()->no_gc_scope_depth() != 0); 744 ASSERT(isolate()->no_gc_scope_depth() != 0);
745 ASSERT(Utils::IsAligned(size, kObjectAlignment)); 745 ASSERT(Utils::IsAligned(size, kObjectAlignment));
746 Heap* heap = isolate()->heap(); 746 Heap* heap = isolate()->heap();
747 747
748 uword address = heap->TryAllocate(size, Heap::kOld); 748 uword address = heap->TryAllocate(size, Heap::kOld, PageSpace::kForceGrowth);
749 if (address == 0) { 749 if (address == 0) {
750 // Use the preallocated out of memory exception to avoid calling 750 // Use the preallocated out of memory exception to avoid calling
751 // into dart code or allocating any code. 751 // into dart code or allocating any code.
752 // We do a longjmp at this point to unwind out of the entire 752 // We do a longjmp at this point to unwind out of the entire
753 // read part and return the error object back. 753 // read part and return the error object back.
754 const UnhandledException& error = UnhandledException::Handle( 754 const UnhandledException& error = UnhandledException::Handle(
755 object_store()->preallocated_unhandled_exception()); 755 object_store()->preallocated_unhandled_exception());
756 Isolate::Current()->long_jump_base()->Jump(1, error); 756 Isolate::Current()->long_jump_base()->Jump(1, error);
757 } 757 }
758 #if defined(DEBUG) 758 #if defined(DEBUG)
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
1635 NoGCScope no_gc; 1635 NoGCScope no_gc;
1636 WriteObject(obj.raw()); 1636 WriteObject(obj.raw());
1637 UnmarkAll(); 1637 UnmarkAll();
1638 } else { 1638 } else {
1639 ThrowException(exception_type(), exception_msg()); 1639 ThrowException(exception_type(), exception_msg());
1640 } 1640 }
1641 } 1641 }
1642 1642
1643 1643
1644 } // namespace dart 1644 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698