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

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

Issue 614373003: Bump-pointer allocation when reading snapshot; 10-15% faster isolate creation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 2 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 | 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/bootstrap.h" 8 #include "vm/bootstrap.h"
9 #include "vm/class_finalizer.h" 9 #include "vm/class_finalizer.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 } 822 }
823 return Class::null(); 823 return Class::null();
824 } 824 }
825 825
826 826
827 RawObject* SnapshotReader::AllocateUninitialized(intptr_t class_id, 827 RawObject* SnapshotReader::AllocateUninitialized(intptr_t class_id,
828 intptr_t size) { 828 intptr_t size) {
829 ASSERT(isolate()->no_gc_scope_depth() != 0); 829 ASSERT(isolate()->no_gc_scope_depth() != 0);
830 ASSERT(Utils::IsAligned(size, kObjectAlignment)); 830 ASSERT(Utils::IsAligned(size, kObjectAlignment));
831 831
832 uword address = old_space()->TryAllocateDataLocked(size, 832 uword address =
833 PageSpace::kForceGrowth); 833 old_space()->TryAllocateDataBumpLocked(size, PageSpace::kForceGrowth);
834 if (address == 0) { 834 if (address == 0) {
835 // Use the preallocated out of memory exception to avoid calling 835 // Use the preallocated out of memory exception to avoid calling
836 // into dart code or allocating any code. 836 // into dart code or allocating any code.
837 // We do a longjmp at this point to unwind out of the entire 837 // We do a longjmp at this point to unwind out of the entire
838 // read part and return the error object back. 838 // read part and return the error object back.
839 const UnhandledException& error = UnhandledException::Handle( 839 const UnhandledException& error = UnhandledException::Handle(
840 object_store()->preallocated_unhandled_exception()); 840 object_store()->preallocated_unhandled_exception());
841 Isolate::Current()->long_jump_base()->Jump(1, error); 841 Isolate::Current()->long_jump_base()->Jump(1, error);
842 } 842 }
843 #if defined(DEBUG) 843 #if defined(DEBUG)
(...skipping 921 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 NoGCScope no_gc; 1765 NoGCScope no_gc;
1766 WriteObject(obj.raw()); 1766 WriteObject(obj.raw());
1767 UnmarkAll(); 1767 UnmarkAll();
1768 } else { 1768 } else {
1769 ThrowException(exception_type(), exception_msg()); 1769 ThrowException(exception_type(), exception_msg());
1770 } 1770 }
1771 } 1771 }
1772 1772
1773 1773
1774 } // namespace dart 1774 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698