Chromium Code Reviews| Index: runtime/vm/raw_object.cc |
| =================================================================== |
| --- runtime/vm/raw_object.cc (revision 14777) |
| +++ runtime/vm/raw_object.cc (working copy) |
| @@ -593,13 +593,17 @@ |
| ObjectPointerVisitor* visitor) { |
| // Make sure that we got here with the tagged pointer as this. |
| ASSERT(raw_obj->IsHeapObject()); |
| - RawClass* cls = visitor->isolate()->class_table()->At(raw_obj->GetClassId()); |
| - intptr_t instance_size = cls->ptr()->instance_size_; |
| - intptr_t num_native_fields = cls->ptr()->num_native_fields_; |
| + uword tags = raw_obj->ptr()->tags_; |
|
cshapiro
2012/11/12 18:48:45
Any reason we are not just using RawObject::Size()
Ivan Posva
2012/11/12 22:01:03
I tried to keep it as similar as possible to the o
|
| + intptr_t instance_size = SizeTag::decode(tags); |
| + if (instance_size == 0) { |
| + RawClass* cls = |
| + visitor->isolate()->class_table()->At(raw_obj->GetClassId()); |
| + instance_size = cls->ptr()->instance_size_; |
| + } |
| // Calculate the first and last raw object pointer fields. |
| uword obj_addr = RawObject::ToAddr(raw_obj); |
| - uword from = obj_addr + sizeof(RawObject) + num_native_fields * kWordSize; |
| + uword from = obj_addr + sizeof(RawObject); |
| uword to = obj_addr + instance_size - kWordSize; |
| visitor->VisitPointers(reinterpret_cast<RawObject**>(from), |
| reinterpret_cast<RawObject**>(to)); |