OLD | NEW |
---|---|
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/object_store.h" | 5 #include "vm/object_store.h" |
6 | 6 |
7 #include "vm/exceptions.h" | 7 #include "vm/exceptions.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
10 #include "vm/object.h" | 10 #include "vm/object.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 set_stack_overflow(Instance::Cast(result)); | 125 set_stack_overflow(Instance::Cast(result)); |
126 | 126 |
127 result = DartLibraryCalls::InstanceCreate(library, | 127 result = DartLibraryCalls::InstanceCreate(library, |
128 Symbols::OutOfMemoryError(), | 128 Symbols::OutOfMemoryError(), |
129 Symbols::Dot(), | 129 Symbols::Dot(), |
130 Object::empty_array()); | 130 Object::empty_array()); |
131 if (result.IsError()) { | 131 if (result.IsError()) { |
132 return false; | 132 return false; |
133 } | 133 } |
134 set_out_of_memory(Instance::Cast(result)); | 134 set_out_of_memory(Instance::Cast(result)); |
135 | |
136 const UnhandledException& unhandled_exception = UnhandledException::Handle( | |
137 UnhandledException::New(Instance::Cast(result), Instance::Handle())); | |
siva
2014/07/16 01:00:13
maybe add a comment here that the preallocated unh
Florian Schneider
2014/07/16 11:15:42
Done.
| |
138 set_preallocated_unhandled_exception(unhandled_exception); | |
139 | |
135 const Array& code_array = Array::Handle( | 140 const Array& code_array = Array::Handle( |
136 isolate, | 141 isolate, |
137 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); | 142 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
138 const Array& pc_offset_array = Array::Handle( | 143 const Array& pc_offset_array = Array::Handle( |
139 isolate, | 144 isolate, |
140 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); | 145 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
141 const Stacktrace& stack_trace = | 146 const Stacktrace& stack_trace = |
142 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); | 147 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); |
143 // Expansion of inlined functions requires additional memory at run time, | 148 // Expansion of inlined functions requires additional memory at run time, |
144 // avoid it. | 149 // avoid it. |
145 stack_trace.set_expand_inlined(false); | 150 stack_trace.set_expand_inlined(false); |
146 set_preallocated_stack_trace(stack_trace); | 151 set_preallocated_stack_trace(stack_trace); |
147 | 152 |
148 return true; | 153 return true; |
149 } | 154 } |
150 | 155 |
151 } // namespace dart | 156 } // namespace dart |
OLD | NEW |