Chromium Code Reviews| Index: runtime/vm/raw_object.cc |
| diff --git a/runtime/vm/raw_object.cc b/runtime/vm/raw_object.cc |
| index 04378e71a9bef9fdda6a42bda2119b5fb7c44436..f151f1ff47a3584f06bfaa946774559fd80bcc53 100644 |
| --- a/runtime/vm/raw_object.cc |
| +++ b/runtime/vm/raw_object.cc |
| @@ -115,6 +115,13 @@ intptr_t RawObject::SizeFromClass() const { |
| instance_size = Array::InstanceSize(array_length); |
| break; |
| } |
| + case kObjectPoolCid: { |
| + const RawObjectPool* raw_object_pool = |
| + reinterpret_cast<const RawObjectPool*>(this); |
| + intptr_t len = raw_object_pool->ptr()->length_; |
| + instance_size = ObjectPool::InstanceSize(len); |
| + break; |
| + } |
| #define SIZE_FROM_CLASS(clazz) \ |
| case kTypedData##clazz##Cid: |
| CLASS_LIST_TYPED_DATA(SIZE_FROM_CLASS) { |
| @@ -523,6 +530,24 @@ intptr_t RawCode::VisitCodePointers(RawCode* raw_obj, |
| } |
| +intptr_t RawObjectPool::VisitObjectPoolPointers( |
| + RawObjectPool* raw_obj, ObjectPointerVisitor* visitor) { |
| + visitor->VisitPointer( |
| + reinterpret_cast<RawObject**>(&raw_obj->ptr()->info_array_)); |
| + intptr_t len = raw_obj->ptr()->length_; |
|
srdjan
2015/06/09 21:49:47
const
|
| + RawTypedData* info_array = raw_obj->ptr()->info_array_->ptr(); |
| + Entry* first = raw_obj->first_entry(); |
| + for (intptr_t i = 0; i < len; ++i) { |
| + ObjectPool::EntryType entry_type = |
| + static_cast<ObjectPool::EntryType>(info_array->data()[i]); |
| + if (entry_type == ObjectPool::kTaggedObject) { |
| + visitor->VisitPointer(&(first + i)->raw_obj_); |
| + } |
| + } |
| + return ObjectPool::InstanceSize(raw_obj->ptr()->length_); |
| +} |
| + |
| + |
| intptr_t RawInstructions::VisitInstructionsPointers( |
| RawInstructions* raw_obj, ObjectPointerVisitor* visitor) { |
| RawInstructions* obj = raw_obj->ptr(); |