| 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/raw_object.h" | 5 #include "vm/raw_object.h" |
| 6 | 6 |
| 7 #include "vm/class_table.h" | 7 #include "vm/class_table.h" |
| 8 #include "vm/dart.h" | 8 #include "vm/dart.h" |
| 9 #include "vm/freelist.h" | 9 #include "vm/freelist.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); | 162 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); |
| 163 break; | 163 break; |
| 164 } | 164 } |
| 165 case kExceptionHandlersCid: { | 165 case kExceptionHandlersCid: { |
| 166 const RawExceptionHandlers* raw_handlers = | 166 const RawExceptionHandlers* raw_handlers = |
| 167 reinterpret_cast<const RawExceptionHandlers*>(this); | 167 reinterpret_cast<const RawExceptionHandlers*>(this); |
| 168 intptr_t num_handlers = raw_handlers->ptr()->num_entries_; | 168 intptr_t num_handlers = raw_handlers->ptr()->num_entries_; |
| 169 instance_size = ExceptionHandlers::InstanceSize(num_handlers); | 169 instance_size = ExceptionHandlers::InstanceSize(num_handlers); |
| 170 break; | 170 break; |
| 171 } | 171 } |
| 172 case kDeoptInfoCid: { | |
| 173 const RawDeoptInfo* raw_deopt_info = | |
| 174 reinterpret_cast<const RawDeoptInfo*>(this); | |
| 175 intptr_t num_entries = Smi::Value(raw_deopt_info->ptr()->length_); | |
| 176 instance_size = DeoptInfo::InstanceSize(num_entries); | |
| 177 break; | |
| 178 } | |
| 179 case kJSRegExpCid: { | 172 case kJSRegExpCid: { |
| 180 const RawJSRegExp* raw_jsregexp = | 173 const RawJSRegExp* raw_jsregexp = |
| 181 reinterpret_cast<const RawJSRegExp*>(this); | 174 reinterpret_cast<const RawJSRegExp*>(this); |
| 182 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); | 175 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); |
| 183 instance_size = JSRegExp::InstanceSize(data_length); | 176 instance_size = JSRegExp::InstanceSize(data_length); |
| 184 break; | 177 break; |
| 185 } | 178 } |
| 186 case kFreeListElement: { | 179 case kFreeListElement: { |
| 187 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); | 180 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); |
| 188 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr); | 181 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr); |
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( | 572 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( |
| 580 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { | 573 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { |
| 581 RawExceptionHandlers* obj = raw_obj->ptr(); | 574 RawExceptionHandlers* obj = raw_obj->ptr(); |
| 582 intptr_t len = obj->num_entries_; | 575 intptr_t len = obj->num_entries_; |
| 583 visitor->VisitPointer( | 576 visitor->VisitPointer( |
| 584 reinterpret_cast<RawObject**>(&obj->handled_types_data_)); | 577 reinterpret_cast<RawObject**>(&obj->handled_types_data_)); |
| 585 return ExceptionHandlers::InstanceSize(len); | 578 return ExceptionHandlers::InstanceSize(len); |
| 586 } | 579 } |
| 587 | 580 |
| 588 | 581 |
| 589 intptr_t RawDeoptInfo::VisitDeoptInfoPointers( | |
| 590 RawDeoptInfo* raw_obj, ObjectPointerVisitor* visitor) { | |
| 591 RawDeoptInfo* obj = raw_obj->ptr(); | |
| 592 intptr_t length = Smi::Value(obj->length_); | |
| 593 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); | |
| 594 return DeoptInfo::InstanceSize(length); | |
| 595 } | |
| 596 | |
| 597 | |
| 598 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, | 582 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, |
| 599 ObjectPointerVisitor* visitor) { | 583 ObjectPointerVisitor* visitor) { |
| 600 intptr_t num_variables = raw_obj->ptr()->num_variables_; | 584 intptr_t num_variables = raw_obj->ptr()->num_variables_; |
| 601 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables)); | 585 visitor->VisitPointers(raw_obj->from(), raw_obj->to(num_variables)); |
| 602 return Context::InstanceSize(num_variables); | 586 return Context::InstanceSize(num_variables); |
| 603 } | 587 } |
| 604 | 588 |
| 605 | 589 |
| 606 intptr_t RawContextScope::VisitContextScopePointers( | 590 intptr_t RawContextScope::VisitContextScopePointers( |
| 607 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) { | 591 RawContextScope* raw_obj, ObjectPointerVisitor* visitor) { |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 intptr_t RawUserTag::VisitUserTagPointers( | 915 intptr_t RawUserTag::VisitUserTagPointers( |
| 932 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { | 916 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { |
| 933 // Make sure that we got here with the tagged pointer as this. | 917 // Make sure that we got here with the tagged pointer as this. |
| 934 ASSERT(raw_obj->IsHeapObject()); | 918 ASSERT(raw_obj->IsHeapObject()); |
| 935 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 919 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 936 return UserTag::InstanceSize(); | 920 return UserTag::InstanceSize(); |
| 937 } | 921 } |
| 938 | 922 |
| 939 | 923 |
| 940 } // namespace dart | 924 } // namespace dart |
| OLD | NEW |