OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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.h" | 5 #include "vm/object.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 Instance* Object::sentinel_ = NULL; | 107 Instance* Object::sentinel_ = NULL; |
108 Instance* Object::transition_sentinel_ = NULL; | 108 Instance* Object::transition_sentinel_ = NULL; |
109 Instance* Object::unknown_constant_ = NULL; | 109 Instance* Object::unknown_constant_ = NULL; |
110 Instance* Object::non_constant_ = NULL; | 110 Instance* Object::non_constant_ = NULL; |
111 Bool* Object::bool_true_ = NULL; | 111 Bool* Object::bool_true_ = NULL; |
112 Bool* Object::bool_false_ = NULL; | 112 Bool* Object::bool_false_ = NULL; |
113 Smi* Object::smi_illegal_cid_ = NULL; | 113 Smi* Object::smi_illegal_cid_ = NULL; |
114 LanguageError* Object::snapshot_writer_error_ = NULL; | 114 LanguageError* Object::snapshot_writer_error_ = NULL; |
115 LanguageError* Object::branch_offset_error_ = NULL; | 115 LanguageError* Object::branch_offset_error_ = NULL; |
116 Array* Object::vm_isolate_snapshot_object_table_ = NULL; | 116 Array* Object::vm_isolate_snapshot_object_table_ = NULL; |
| 117 const uint8_t* Object::instructions_snapshot_buffer_ = NULL; |
117 | 118 |
118 RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL); | 119 RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL); |
119 RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 120 RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
120 RawClass* Object::dynamic_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 121 RawClass* Object::dynamic_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
121 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 122 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
122 RawType* Object::dynamic_type_ = reinterpret_cast<RawType*>(RAW_NULL); | 123 RawType* Object::dynamic_type_ = reinterpret_cast<RawType*>(RAW_NULL); |
123 RawType* Object::void_type_ = reinterpret_cast<RawType*>(RAW_NULL); | 124 RawType* Object::void_type_ = reinterpret_cast<RawType*>(RAW_NULL); |
124 RawClass* Object::unresolved_class_class_ = | 125 RawClass* Object::unresolved_class_class_ = |
125 reinterpret_cast<RawClass*>(RAW_NULL); | 126 reinterpret_cast<RawClass*>(RAW_NULL); |
126 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 127 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
(...skipping 10832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10959 } | 10960 } |
10960 | 10961 |
10961 | 10962 |
10962 ObjectPool::EntryType ObjectPool::InfoAt(intptr_t index) const { | 10963 ObjectPool::EntryType ObjectPool::InfoAt(intptr_t index) const { |
10963 const TypedData& array = TypedData::Handle(info_array()); | 10964 const TypedData& array = TypedData::Handle(info_array()); |
10964 return static_cast<EntryType>(array.GetInt8(index)); | 10965 return static_cast<EntryType>(array.GetInt8(index)); |
10965 } | 10966 } |
10966 | 10967 |
10967 | 10968 |
10968 const char* ObjectPool::ToCString() const { | 10969 const char* ObjectPool::ToCString() const { |
10969 return "ObjectPool"; | 10970 Zone* zone = Thread::Current()->zone(); |
| 10971 return zone->PrintToString("ObjectPool len:%" Pd, Length()); |
10970 } | 10972 } |
10971 | 10973 |
10972 | 10974 |
10973 void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const { | 10975 void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const { |
10974 JSONObject jsobj(stream); | 10976 JSONObject jsobj(stream); |
10975 AddCommonObjectProperties(&jsobj, "Object", ref); | 10977 AddCommonObjectProperties(&jsobj, "Object", ref); |
10976 jsobj.AddServiceId(*this); | 10978 jsobj.AddServiceId(*this); |
10977 jsobj.AddProperty("length", Length()); | 10979 jsobj.AddProperty("length", Length()); |
10978 if (ref) { | 10980 if (ref) { |
10979 return; | 10981 return; |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11660 result ^= raw; | 11662 result ^= raw; |
11661 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers); | 11663 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers); |
11662 } | 11664 } |
11663 result.set_handled_types_data(handled_types_data); | 11665 result.set_handled_types_data(handled_types_data); |
11664 return result.raw(); | 11666 return result.raw(); |
11665 } | 11667 } |
11666 | 11668 |
11667 | 11669 |
11668 const char* ExceptionHandlers::ToCString() const { | 11670 const char* ExceptionHandlers::ToCString() const { |
11669 if (num_entries() == 0) { | 11671 if (num_entries() == 0) { |
11670 return "No exception handlers\n"; | 11672 return "empty ExceptionHandlers\n"; |
11671 } | 11673 } |
11672 Array& handled_types = Array::Handle(); | 11674 Array& handled_types = Array::Handle(); |
11673 Type& type = Type::Handle(); | 11675 Type& type = Type::Handle(); |
11674 RawExceptionHandlers::HandlerInfo info; | 11676 RawExceptionHandlers::HandlerInfo info; |
11675 // First compute the buffer size required. | 11677 // First compute the buffer size required. |
11676 const char* kFormat = "%" Pd " => %#" Px " (%" Pd | 11678 const char* kFormat = "%" Pd " => %#" Px " (%" Pd |
11677 " types) (outer %" Pd ")\n"; | 11679 " types) (outer %" Pd ")\n"; |
11678 const char* kFormat2 = " %d. %s\n"; | 11680 const char* kFormat2 = " %d. %s\n"; |
11679 intptr_t len = 1; // Trailing '\0'. | 11681 intptr_t len = 1; // Trailing '\0'. |
11680 for (intptr_t i = 0; i < num_entries(); i++) { | 11682 for (intptr_t i = 0; i < num_entries(); i++) { |
(...skipping 9751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
21432 return tag_label.ToCString(); | 21434 return tag_label.ToCString(); |
21433 } | 21435 } |
21434 | 21436 |
21435 | 21437 |
21436 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21438 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
21437 Instance::PrintJSONImpl(stream, ref); | 21439 Instance::PrintJSONImpl(stream, ref); |
21438 } | 21440 } |
21439 | 21441 |
21440 | 21442 |
21441 } // namespace dart | 21443 } // namespace dart |
OLD | NEW |