| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 Instance* Object::sentinel_ = NULL; | 108 Instance* Object::sentinel_ = NULL; |
| 109 Instance* Object::transition_sentinel_ = NULL; | 109 Instance* Object::transition_sentinel_ = NULL; |
| 110 Instance* Object::unknown_constant_ = NULL; | 110 Instance* Object::unknown_constant_ = NULL; |
| 111 Instance* Object::non_constant_ = NULL; | 111 Instance* Object::non_constant_ = NULL; |
| 112 Bool* Object::bool_true_ = NULL; | 112 Bool* Object::bool_true_ = NULL; |
| 113 Bool* Object::bool_false_ = NULL; | 113 Bool* Object::bool_false_ = NULL; |
| 114 Smi* Object::smi_illegal_cid_ = NULL; | 114 Smi* Object::smi_illegal_cid_ = NULL; |
| 115 LanguageError* Object::snapshot_writer_error_ = NULL; | 115 LanguageError* Object::snapshot_writer_error_ = NULL; |
| 116 LanguageError* Object::branch_offset_error_ = NULL; | 116 LanguageError* Object::branch_offset_error_ = NULL; |
| 117 Array* Object::vm_isolate_snapshot_object_table_ = NULL; | 117 Array* Object::vm_isolate_snapshot_object_table_ = NULL; |
| 118 const uint8_t* Object::instructions_snapshot_buffer_ = NULL; |
| 118 | 119 |
| 119 RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL); | 120 RawObject* Object::null_ = reinterpret_cast<RawObject*>(RAW_NULL); |
| 120 RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 121 RawClass* Object::class_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 121 RawClass* Object::dynamic_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 122 RawClass* Object::dynamic_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 122 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 123 RawClass* Object::void_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| 123 RawType* Object::dynamic_type_ = reinterpret_cast<RawType*>(RAW_NULL); | 124 RawType* Object::dynamic_type_ = reinterpret_cast<RawType*>(RAW_NULL); |
| 124 RawType* Object::void_type_ = reinterpret_cast<RawType*>(RAW_NULL); | 125 RawType* Object::void_type_ = reinterpret_cast<RawType*>(RAW_NULL); |
| 125 RawClass* Object::unresolved_class_class_ = | 126 RawClass* Object::unresolved_class_class_ = |
| 126 reinterpret_cast<RawClass*>(RAW_NULL); | 127 reinterpret_cast<RawClass*>(RAW_NULL); |
| 127 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); | 128 RawClass* Object::type_arguments_class_ = reinterpret_cast<RawClass*>(RAW_NULL); |
| (...skipping 10849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10977 } | 10978 } |
| 10978 | 10979 |
| 10979 | 10980 |
| 10980 ObjectPool::EntryType ObjectPool::InfoAt(intptr_t index) const { | 10981 ObjectPool::EntryType ObjectPool::InfoAt(intptr_t index) const { |
| 10981 const TypedData& array = TypedData::Handle(info_array()); | 10982 const TypedData& array = TypedData::Handle(info_array()); |
| 10982 return static_cast<EntryType>(array.GetInt8(index)); | 10983 return static_cast<EntryType>(array.GetInt8(index)); |
| 10983 } | 10984 } |
| 10984 | 10985 |
| 10985 | 10986 |
| 10986 const char* ObjectPool::ToCString() const { | 10987 const char* ObjectPool::ToCString() const { |
| 10987 return "ObjectPool"; | 10988 Zone* zone = Thread::Current()->zone(); |
| 10989 return zone->PrintToString("ObjectPool len:%" Pd, Length()); |
| 10988 } | 10990 } |
| 10989 | 10991 |
| 10990 | 10992 |
| 10991 void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const { | 10993 void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 10992 JSONObject jsobj(stream); | 10994 JSONObject jsobj(stream); |
| 10993 AddCommonObjectProperties(&jsobj, "Object", ref); | 10995 AddCommonObjectProperties(&jsobj, "Object", ref); |
| 10994 jsobj.AddServiceId(*this); | 10996 jsobj.AddServiceId(*this); |
| 10995 jsobj.AddProperty("length", Length()); | 10997 jsobj.AddProperty("length", Length()); |
| 10996 if (ref) { | 10998 if (ref) { |
| 10997 return; | 10999 return; |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11706 result ^= raw; | 11708 result ^= raw; |
| 11707 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers); | 11709 result.StoreNonPointer(&result.raw_ptr()->num_entries_, num_handlers); |
| 11708 } | 11710 } |
| 11709 result.set_handled_types_data(handled_types_data); | 11711 result.set_handled_types_data(handled_types_data); |
| 11710 return result.raw(); | 11712 return result.raw(); |
| 11711 } | 11713 } |
| 11712 | 11714 |
| 11713 | 11715 |
| 11714 const char* ExceptionHandlers::ToCString() const { | 11716 const char* ExceptionHandlers::ToCString() const { |
| 11715 if (num_entries() == 0) { | 11717 if (num_entries() == 0) { |
| 11716 return "No exception handlers\n"; | 11718 return "empty ExceptionHandlers\n"; |
| 11717 } | 11719 } |
| 11718 Array& handled_types = Array::Handle(); | 11720 Array& handled_types = Array::Handle(); |
| 11719 Type& type = Type::Handle(); | 11721 Type& type = Type::Handle(); |
| 11720 RawExceptionHandlers::HandlerInfo info; | 11722 RawExceptionHandlers::HandlerInfo info; |
| 11721 // First compute the buffer size required. | 11723 // First compute the buffer size required. |
| 11722 const char* kFormat = "%" Pd " => %#" Px " (%" Pd | 11724 const char* kFormat = "%" Pd " => %#" Px " (%" Pd |
| 11723 " types) (outer %" Pd ")\n"; | 11725 " types) (outer %" Pd ")\n"; |
| 11724 const char* kFormat2 = " %d. %s\n"; | 11726 const char* kFormat2 = " %d. %s\n"; |
| 11725 intptr_t len = 1; // Trailing '\0'. | 11727 intptr_t len = 1; // Trailing '\0'. |
| 11726 for (intptr_t i = 0; i < num_entries(); i++) { | 11728 for (intptr_t i = 0; i < num_entries(); i++) { |
| (...skipping 9779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 21506 return tag_label.ToCString(); | 21508 return tag_label.ToCString(); |
| 21507 } | 21509 } |
| 21508 | 21510 |
| 21509 | 21511 |
| 21510 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { | 21512 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { |
| 21511 Instance::PrintJSONImpl(stream, ref); | 21513 Instance::PrintJSONImpl(stream, ref); |
| 21512 } | 21514 } |
| 21513 | 21515 |
| 21514 | 21516 |
| 21515 } // namespace dart | 21517 } // namespace dart |
| OLD | NEW |