| 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/symbols.h" | 12 #include "vm/symbols.h" |
| 13 #include "vm/visitor.h" | 13 #include "vm/visitor.h" |
| 14 | 14 |
| 15 namespace dart { | 15 namespace dart { |
| 16 | 16 |
| 17 ObjectStore::ObjectStore() | 17 ObjectStore::ObjectStore() |
| 18 : object_class_(Class::null()), | 18 : object_class_(Class::null()), |
| 19 object_type_(Type::null()), | 19 object_type_(Type::null()), |
| 20 null_class_(Class::null()), | 20 null_class_(Class::null()), |
| 21 null_type_(Type::null()), | 21 null_type_(Type::null()), |
| 22 function_type_(Type::null()), | 22 function_type_(Type::null()), |
| 23 function_impl_type_(Type::null()), | 23 function_impl_type_(Type::null()), |
| 24 number_type_(Type::null()), | 24 number_type_(Type::null()), |
| 25 int_type_(Type::null()), | 25 int_type_(Type::null()), |
| 26 integer_implementation_class_(Class::null()), | 26 integer_implementation_class_(Class::null()), |
| 27 smi_class_(Class::null()), | 27 smi_class_(Class::null()), |
| 28 smi_type_(Type::null()), |
| 28 mint_class_(Class::null()), | 29 mint_class_(Class::null()), |
| 30 mint_type_(Type::null()), |
| 31 bigint_class_(Class::null()), |
| 29 double_class_(Class::null()), | 32 double_class_(Class::null()), |
| 33 double_type_(Type::null()), |
| 30 float32x4_type_(Type::null()), | 34 float32x4_type_(Type::null()), |
| 31 int32x4_type_(Type::null()), | 35 int32x4_type_(Type::null()), |
| 32 float64x2_type_(Type::null()), | 36 float64x2_type_(Type::null()), |
| 33 string_type_(Type::null()), | 37 string_type_(Type::null()), |
| 34 one_byte_string_class_(Class::null()), | 38 one_byte_string_class_(Class::null()), |
| 35 two_byte_string_class_(Class::null()), | 39 two_byte_string_class_(Class::null()), |
| 36 external_one_byte_string_class_(Class::null()), | 40 external_one_byte_string_class_(Class::null()), |
| 37 external_two_byte_string_class_(Class::null()), | 41 external_two_byte_string_class_(Class::null()), |
| 38 bool_type_(Type::null()), | 42 bool_type_(Type::null()), |
| 39 bool_class_(Class::null()), | 43 bool_class_(Class::null()), |
| 40 array_class_(Class::null()), | 44 array_class_(Class::null()), |
| 41 array_type_(Type::null()), | 45 array_type_(Type::null()), |
| 42 immutable_array_class_(Class::null()), | 46 immutable_array_class_(Class::null()), |
| 43 growable_object_array_class_(Class::null()), | 47 growable_object_array_class_(Class::null()), |
| 44 linked_hash_map_class_(Class::null()), | 48 linked_hash_map_class_(Class::null()), |
| 45 float32x4_class_(Class::null()), | 49 float32x4_class_(Class::null()), |
| 46 int32x4_class_(Class::null()), | 50 int32x4_class_(Class::null()), |
| 47 float64x2_class_(Class::null()), | 51 float64x2_class_(Class::null()), |
| 48 error_class_(Class::null()), | 52 error_class_(Class::null()), |
| 49 weak_property_class_(Class::null()), | 53 weak_property_class_(Class::null()), |
| 50 symbol_table_(Array::null()), | 54 symbol_table_(Array::null()), |
| 51 canonical_type_arguments_(Array::null()), | 55 canonical_type_arguments_(Array::null()), |
| 52 async_library_(Library::null()), | 56 async_library_(Library::null()), |
| 53 builtin_library_(Library::null()), | 57 builtin_library_(Library::null()), |
| 54 core_library_(Library::null()), | 58 core_library_(Library::null()), |
| 59 collection_library_(Library::null()), |
| 60 convert_library_(Library::null()), |
| 61 internal_library_(Library::null()), |
| 55 isolate_library_(Library::null()), | 62 isolate_library_(Library::null()), |
| 56 math_library_(Library::null()), | 63 math_library_(Library::null()), |
| 57 mirrors_library_(Library::null()), | 64 mirrors_library_(Library::null()), |
| 58 native_wrappers_library_(Library::null()), | 65 native_wrappers_library_(Library::null()), |
| 59 root_library_(Library::null()), | 66 root_library_(Library::null()), |
| 60 typed_data_library_(Library::null()), | 67 typed_data_library_(Library::null()), |
| 68 profiler_library_(Library::null()), |
| 61 libraries_(GrowableObjectArray::null()), | 69 libraries_(GrowableObjectArray::null()), |
| 62 pending_classes_(GrowableObjectArray::null()), | 70 pending_classes_(GrowableObjectArray::null()), |
| 63 pending_functions_(GrowableObjectArray::null()), | 71 pending_functions_(GrowableObjectArray::null()), |
| 72 pending_deferred_loads_(GrowableObjectArray::null()), |
| 64 resume_capabilities_(GrowableObjectArray::null()), | 73 resume_capabilities_(GrowableObjectArray::null()), |
| 65 sticky_error_(Error::null()), | 74 sticky_error_(Error::null()), |
| 66 unhandled_exception_handler_(String::null()), | 75 unhandled_exception_handler_(String::null()), |
| 67 empty_context_(Context::null()), | 76 empty_context_(Context::null()), |
| 68 stack_overflow_(Instance::null()), | 77 stack_overflow_(Instance::null()), |
| 69 out_of_memory_(Instance::null()), | 78 out_of_memory_(Instance::null()), |
| 79 preallocated_unhandled_exception_(UnhandledException::null()), |
| 70 preallocated_stack_trace_(Stacktrace::null()), | 80 preallocated_stack_trace_(Stacktrace::null()), |
| 71 lookup_port_handler_(Function::null()), | 81 lookup_port_handler_(Function::null()), |
| 72 empty_uint32_array_(TypedData::null()), | 82 empty_uint32_array_(TypedData::null()), |
| 73 handle_message_function_(Function::null()), | 83 handle_message_function_(Function::null()), |
| 74 library_load_error_table_(Array::null()) { | 84 library_load_error_table_(Array::null()) { |
| 85 for (RawObject** current = from(); current <= to(); current++) { |
| 86 ASSERT(*current == Object::null()); |
| 87 } |
| 75 } | 88 } |
| 76 | 89 |
| 77 | 90 |
| 78 ObjectStore::~ObjectStore() { | 91 ObjectStore::~ObjectStore() { |
| 79 } | 92 } |
| 80 | 93 |
| 81 | 94 |
| 82 void ObjectStore::VisitObjectPointers(ObjectPointerVisitor* visitor) { | 95 void ObjectStore::VisitObjectPointers(ObjectPointerVisitor* visitor) { |
| 83 ASSERT(visitor != NULL); | 96 ASSERT(visitor != NULL); |
| 84 visitor->VisitPointers(from(), to()); | 97 visitor->VisitPointers(from(), to()); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); | 160 Stacktrace::Handle(Stacktrace::New(code_array, pc_offset_array)); |
| 148 // Expansion of inlined functions requires additional memory at run time, | 161 // Expansion of inlined functions requires additional memory at run time, |
| 149 // avoid it. | 162 // avoid it. |
| 150 stack_trace.set_expand_inlined(false); | 163 stack_trace.set_expand_inlined(false); |
| 151 set_preallocated_stack_trace(stack_trace); | 164 set_preallocated_stack_trace(stack_trace); |
| 152 | 165 |
| 153 return true; | 166 return true; |
| 154 } | 167 } |
| 155 | 168 |
| 156 } // namespace dart | 169 } // namespace dart |
| OLD | NEW |