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" |
11 #include "vm/raw_object.h" | 11 #include "vm/raw_object.h" |
| 12 #include "vm/resolver.h" |
12 #include "vm/symbols.h" | 13 #include "vm/symbols.h" |
13 #include "vm/visitor.h" | 14 #include "vm/visitor.h" |
14 | 15 |
15 namespace dart { | 16 namespace dart { |
16 | 17 |
17 ObjectStore::ObjectStore() | 18 ObjectStore::ObjectStore() |
18 : object_class_(Class::null()), | 19 : object_class_(Class::null()), |
19 object_type_(Type::null()), | 20 object_type_(Type::null()), |
20 null_class_(Class::null()), | 21 null_class_(Class::null()), |
21 null_type_(Type::null()), | 22 null_type_(Type::null()), |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 stack_overflow_(Instance::null()), | 87 stack_overflow_(Instance::null()), |
87 out_of_memory_(Instance::null()), | 88 out_of_memory_(Instance::null()), |
88 preallocated_unhandled_exception_(UnhandledException::null()), | 89 preallocated_unhandled_exception_(UnhandledException::null()), |
89 preallocated_stack_trace_(StackTrace::null()), | 90 preallocated_stack_trace_(StackTrace::null()), |
90 lookup_port_handler_(Function::null()), | 91 lookup_port_handler_(Function::null()), |
91 empty_uint32_array_(TypedData::null()), | 92 empty_uint32_array_(TypedData::null()), |
92 handle_message_function_(Function::null()), | 93 handle_message_function_(Function::null()), |
93 simple_instance_of_function_(Function::null()), | 94 simple_instance_of_function_(Function::null()), |
94 simple_instance_of_true_function_(Function::null()), | 95 simple_instance_of_true_function_(Function::null()), |
95 simple_instance_of_false_function_(Function::null()), | 96 simple_instance_of_false_function_(Function::null()), |
| 97 async_clear_thread_stack_trace_(Function::null()), |
| 98 async_set_thread_stack_trace_(Function::null()), |
96 library_load_error_table_(Array::null()), | 99 library_load_error_table_(Array::null()), |
97 unique_dynamic_targets_(Array::null()), | 100 unique_dynamic_targets_(Array::null()), |
98 token_objects_(GrowableObjectArray::null()), | 101 token_objects_(GrowableObjectArray::null()), |
99 token_objects_map_(Array::null()), | 102 token_objects_map_(Array::null()), |
100 megamorphic_cache_table_(GrowableObjectArray::null()), | 103 megamorphic_cache_table_(GrowableObjectArray::null()), |
101 megamorphic_miss_code_(Code::null()), | 104 megamorphic_miss_code_(Code::null()), |
102 megamorphic_miss_function_(Function::null()) { | 105 megamorphic_miss_function_(Function::null()) { |
103 for (RawObject** current = from(); current <= to(); current++) { | 106 for (RawObject** current = from(); current <= to(); current++) { |
104 ASSERT(*current == Object::null()); | 107 ASSERT(*current == Object::null()); |
105 } | 108 } |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 cls = async_lib.LookupClass(Symbols::Future()); | 233 cls = async_lib.LookupClass(Symbols::Future()); |
231 ASSERT(!cls.IsNull()); | 234 ASSERT(!cls.IsNull()); |
232 set_future_class(cls); | 235 set_future_class(cls); |
233 cls = async_lib.LookupClass(Symbols::Completer()); | 236 cls = async_lib.LookupClass(Symbols::Completer()); |
234 ASSERT(!cls.IsNull()); | 237 ASSERT(!cls.IsNull()); |
235 set_completer_class(cls); | 238 set_completer_class(cls); |
236 cls = async_lib.LookupClass(Symbols::StreamIterator()); | 239 cls = async_lib.LookupClass(Symbols::StreamIterator()); |
237 ASSERT(!cls.IsNull()); | 240 ASSERT(!cls.IsNull()); |
238 set_stream_iterator_class(cls); | 241 set_stream_iterator_class(cls); |
239 | 242 |
| 243 String& function_name = String::Handle(zone); |
| 244 Function& function = Function::Handle(zone); |
| 245 function_name ^= async_lib.PrivateName(Symbols::SetAsyncThreadStackTrace()); |
| 246 ASSERT(!function_name.IsNull()); |
| 247 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(), |
| 248 function_name, 1, Object::null_array()); |
| 249 set_async_set_thread_stack_trace(function); |
| 250 |
| 251 function_name ^= async_lib.PrivateName(Symbols::ClearAsyncThreadStackTrace()); |
| 252 ASSERT(!function_name.IsNull()); |
| 253 function ^= Resolver::ResolveStatic(async_lib, Object::null_string(), |
| 254 function_name, 0, Object::null_array()); |
| 255 ASSERT(!function.IsNull()); |
| 256 set_async_clear_thread_stack_trace(function); |
| 257 |
240 const Library& internal_lib = Library::Handle(_internal_library()); | 258 const Library& internal_lib = Library::Handle(_internal_library()); |
241 cls = internal_lib.LookupClass(Symbols::Symbol()); | 259 cls = internal_lib.LookupClass(Symbols::Symbol()); |
242 set_symbol_class(cls); | 260 set_symbol_class(cls); |
243 | 261 |
244 const Library& core_lib = Library::Handle(core_library()); | 262 const Library& core_lib = Library::Handle(core_library()); |
245 cls = core_lib.LookupClassAllowPrivate(Symbols::_CompileTimeError()); | 263 cls = core_lib.LookupClassAllowPrivate(Symbols::_CompileTimeError()); |
246 ASSERT(!cls.IsNull()); | 264 ASSERT(!cls.IsNull()); |
247 set_compiletime_error_class(cls); | 265 set_compiletime_error_class(cls); |
248 | 266 |
249 // Cache the core private functions used for fast instance of checks. | 267 // Cache the core private functions used for fast instance of checks. |
250 simple_instance_of_function_ = | 268 simple_instance_of_function_ = |
251 PrivateObjectLookup(Symbols::_simpleInstanceOf()); | 269 PrivateObjectLookup(Symbols::_simpleInstanceOf()); |
252 simple_instance_of_true_function_ = | 270 simple_instance_of_true_function_ = |
253 PrivateObjectLookup(Symbols::_simpleInstanceOfTrue()); | 271 PrivateObjectLookup(Symbols::_simpleInstanceOfTrue()); |
254 simple_instance_of_false_function_ = | 272 simple_instance_of_false_function_ = |
255 PrivateObjectLookup(Symbols::_simpleInstanceOfFalse()); | 273 PrivateObjectLookup(Symbols::_simpleInstanceOfFalse()); |
256 #endif | 274 #endif |
257 } | 275 } |
258 | 276 |
259 } // namespace dart | 277 } // namespace dart |
OLD | NEW |