| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 set_stack_overflow(Instance::Cast(result)); | 122 set_stack_overflow(Instance::Cast(result)); |
| 123 | 123 |
| 124 result = DartLibraryCalls::InstanceCreate(library, | 124 result = DartLibraryCalls::InstanceCreate(library, |
| 125 Symbols::OutOfMemoryError(), | 125 Symbols::OutOfMemoryError(), |
| 126 Symbols::Dot(), | 126 Symbols::Dot(), |
| 127 Object::empty_array()); | 127 Object::empty_array()); |
| 128 if (result.IsError()) { | 128 if (result.IsError()) { |
| 129 return false; | 129 return false; |
| 130 } | 130 } |
| 131 set_out_of_memory(Instance::Cast(result)); | 131 set_out_of_memory(Instance::Cast(result)); |
| 132 const Array& func_array = Array::Handle( | |
| 133 isolate, | |
| 134 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); | |
| 135 const Array& code_array = Array::Handle( | 132 const Array& code_array = Array::Handle( |
| 136 isolate, | 133 isolate, |
| 137 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); | 134 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
| 138 const Array& pc_offset_array = Array::Handle( | 135 const Array& pc_offset_array = Array::Handle( |
| 139 isolate, | 136 isolate, |
| 140 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); | 137 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
| 141 result = Stacktrace::New(func_array, code_array, pc_offset_array); | 138 const Stacktrace& stack_trace = |
| 142 set_preallocated_stack_trace(Stacktrace::Cast(result)); | 139 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); |
| 140 // Expansion of inlined functions requires additional memory at run time, |
| 141 // avoid it. |
| 142 stack_trace.set_expand_inlined(false); |
| 143 set_preallocated_stack_trace(stack_trace); |
| 143 | 144 |
| 144 return true; | 145 return true; |
| 145 } | 146 } |
| 146 | 147 |
| 147 | 148 |
| 148 void ObjectStore::InitKeywordTable() { | 149 void ObjectStore::InitKeywordTable() { |
| 149 // Set up the keywords symbol array so that we can access it while scanning. | 150 // Set up the keywords symbol array so that we can access it while scanning. |
| 150 Array& keywords = Array::Handle(keyword_symbols()); | 151 Array& keywords = Array::Handle(keyword_symbols()); |
| 151 ASSERT(keywords.IsNull()); | 152 ASSERT(keywords.IsNull()); |
| 152 keywords = Array::New(Token::numKeywords, Heap::kOld); | 153 keywords = Array::New(Token::numKeywords, Heap::kOld); |
| 153 ASSERT(!keywords.IsError() && !keywords.IsNull()); | 154 ASSERT(!keywords.IsError() && !keywords.IsNull()); |
| 154 set_keyword_symbols(keywords); | 155 set_keyword_symbols(keywords); |
| 155 } | 156 } |
| 156 | 157 |
| 157 } // namespace dart | 158 } // namespace dart |
| OLD | NEW |