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/isolate.h" | 8 #include "vm/isolate.h" |
9 #include "vm/object.h" | 9 #include "vm/object.h" |
10 #include "vm/raw_object.h" | 10 #include "vm/raw_object.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 scalarlist_library_(Library::null()), | 80 scalarlist_library_(Library::null()), |
81 uri_library_(Library::null()), | 81 uri_library_(Library::null()), |
82 utf_library_(Library::null()), | 82 utf_library_(Library::null()), |
83 libraries_(GrowableObjectArray::null()), | 83 libraries_(GrowableObjectArray::null()), |
84 pending_classes_(GrowableObjectArray::null()), | 84 pending_classes_(GrowableObjectArray::null()), |
85 sticky_error_(Error::null()), | 85 sticky_error_(Error::null()), |
86 unhandled_exception_handler_(String::null()), | 86 unhandled_exception_handler_(String::null()), |
87 empty_context_(Context::null()), | 87 empty_context_(Context::null()), |
88 stack_overflow_(Instance::null()), | 88 stack_overflow_(Instance::null()), |
89 out_of_memory_(Instance::null()), | 89 out_of_memory_(Instance::null()), |
| 90 preallocated_stack_trace_(Stacktrace::null()), |
90 keyword_symbols_(Array::null()), | 91 keyword_symbols_(Array::null()), |
91 receive_port_create_function_(Function::null()), | 92 receive_port_create_function_(Function::null()), |
92 lookup_receive_port_function_(Function::null()), | 93 lookup_receive_port_function_(Function::null()), |
93 handle_message_function_(Function::null()) { | 94 handle_message_function_(Function::null()) { |
94 } | 95 } |
95 | 96 |
96 | 97 |
97 ObjectStore::~ObjectStore() { | 98 ObjectStore::~ObjectStore() { |
98 } | 99 } |
99 | 100 |
(...skipping 29 matching lines...) Expand all Loading... |
129 if (result.IsError()) { | 130 if (result.IsError()) { |
130 return false; | 131 return false; |
131 } | 132 } |
132 set_stack_overflow(Instance::Cast(result)); | 133 set_stack_overflow(Instance::Cast(result)); |
133 | 134 |
134 result = Exceptions::Create(Exceptions::kOutOfMemory, Object::empty_array()); | 135 result = Exceptions::Create(Exceptions::kOutOfMemory, Object::empty_array()); |
135 if (result.IsError()) { | 136 if (result.IsError()) { |
136 return false; | 137 return false; |
137 } | 138 } |
138 set_out_of_memory(Instance::Cast(result)); | 139 set_out_of_memory(Instance::Cast(result)); |
| 140 const Array& func_array = Array::Handle( |
| 141 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
| 142 const Array& code_array = Array::Handle( |
| 143 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
| 144 const Array& pc_offset_array = Array::Handle( |
| 145 Array::New(Stacktrace::kPreallocatedStackdepth, Heap::kOld)); |
| 146 result = Stacktrace::New(func_array, code_array, pc_offset_array); |
| 147 set_preallocated_stack_trace(Stacktrace::Cast(result)); |
139 #endif | 148 #endif |
140 return true; | 149 return true; |
141 } | 150 } |
142 | 151 |
143 | 152 |
144 void ObjectStore::InitKeywordTable() { | 153 void ObjectStore::InitKeywordTable() { |
145 // Set up the keywords symbol array so that we can access it while scanning. | 154 // Set up the keywords symbol array so that we can access it while scanning. |
146 Array& keywords = Array::Handle(keyword_symbols()); | 155 Array& keywords = Array::Handle(keyword_symbols()); |
147 ASSERT(keywords.IsNull()); | 156 ASSERT(keywords.IsNull()); |
148 keywords = Array::New(Token::numKeywords, Heap::kOld); | 157 keywords = Array::New(Token::numKeywords, Heap::kOld); |
149 ASSERT(!keywords.IsError() && !keywords.IsNull()); | 158 ASSERT(!keywords.IsError() && !keywords.IsNull()); |
150 set_keyword_symbols(keywords); | 159 set_keyword_symbols(keywords); |
151 } | 160 } |
152 | 161 |
153 } // namespace dart | 162 } // namespace dart |
OLD | NEW |