Chromium Code Reviews| 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/freelist.h" | 8 #include "vm/freelist.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 286 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { | 286 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { |
| 287 intptr_t size = 0; | 287 intptr_t size = 0; |
| 288 NoHandleScope no_handles(visitor->isolate()); | 288 NoHandleScope no_handles(visitor->isolate()); |
| 289 | 289 |
| 290 // Only reasonable to be called on heap objects. | 290 // Only reasonable to be called on heap objects. |
| 291 ASSERT(IsHeapObject()); | 291 ASSERT(IsHeapObject()); |
| 292 | 292 |
| 293 // Read the necessary data out of the class before visting the class itself. | 293 // Read the necessary data out of the class before visting the class itself. |
| 294 intptr_t class_id = GetClassId(); | 294 intptr_t class_id = GetClassId(); |
| 295 | 295 |
| 296 if (class_id < kNumPredefinedCids) { | 296 if (class_id < kNumPredefinedCids && |
| 297 !RawObject::IsTypedDataViewClassId(class_id)) { | |
|
Ivan Posva
2013/03/22 04:50:01
We should not add an extra test into this time cri
siva
2013/03/25 17:20:35
I have removed this extra check and instead moved
| |
| 297 switch (class_id) { | 298 switch (class_id) { |
| 298 #define RAW_VISITPOINTERS(clazz) \ | 299 #define RAW_VISITPOINTERS(clazz) \ |
| 299 case clazz::kClassId: { \ | 300 case clazz::kClassId: { \ |
| 300 Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(this); \ | 301 Raw##clazz* raw_obj = reinterpret_cast<Raw##clazz*>(this); \ |
| 301 size = Raw##clazz::Visit##clazz##Pointers(raw_obj, visitor); \ | 302 size = Raw##clazz::Visit##clazz##Pointers(raw_obj, visitor); \ |
| 302 break; \ | 303 break; \ |
| 303 } | 304 } |
| 304 CLASS_LIST_NO_OBJECT(RAW_VISITPOINTERS) | 305 CLASS_LIST_NO_OBJECT(RAW_VISITPOINTERS) |
| 305 #undef RAW_VISITPOINTERS | 306 #undef RAW_VISITPOINTERS |
| 306 #define RAW_VISITPOINTERS(clazz) \ | 307 #define RAW_VISITPOINTERS(clazz) \ |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1113 | 1114 |
| 1114 intptr_t RawWeakProperty::VisitWeakPropertyPointers( | 1115 intptr_t RawWeakProperty::VisitWeakPropertyPointers( |
| 1115 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { | 1116 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { |
| 1116 // Make sure that we got here with the tagged pointer as this. | 1117 // Make sure that we got here with the tagged pointer as this. |
| 1117 ASSERT(raw_obj->IsHeapObject()); | 1118 ASSERT(raw_obj->IsHeapObject()); |
| 1118 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 1119 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 1119 return WeakProperty::InstanceSize(); | 1120 return WeakProperty::InstanceSize(); |
| 1120 } | 1121 } |
| 1121 | 1122 |
| 1122 } // namespace dart | 1123 } // namespace dart |
| OLD | NEW |