| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |