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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 void RawObject::ValidateOverwrittenSmi(RawSmi* raw) { | 224 void RawObject::ValidateOverwrittenSmi(RawSmi* raw) { |
225 if (FLAG_validate_overwrite && raw->IsHeapObject() && raw != Object::null()) { | 225 if (FLAG_validate_overwrite && raw->IsHeapObject() && raw != Object::null()) { |
226 FATAL1("Expected smi/null, found: %" Px "\n", reinterpret_cast<uword>(raw)); | 226 FATAL1("Expected smi/null, found: %" Px "\n", reinterpret_cast<uword>(raw)); |
227 } | 227 } |
228 } | 228 } |
229 #endif // DEBUG | 229 #endif // DEBUG |
230 | 230 |
231 | 231 |
232 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { | 232 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { |
233 intptr_t size = 0; | 233 intptr_t size = 0; |
234 NoHandleScope no_handles(visitor->isolate()); | |
235 | 234 |
236 // Only reasonable to be called on heap objects. | 235 // Only reasonable to be called on heap objects. |
237 ASSERT(IsHeapObject()); | 236 ASSERT(IsHeapObject()); |
238 | 237 |
239 // Read the necessary data out of the class before visting the class itself. | 238 // Read the necessary data out of the class before visting the class itself. |
240 intptr_t class_id = GetClassId(); | 239 intptr_t class_id = GetClassId(); |
241 | 240 |
242 if (class_id < kNumPredefinedCids) { | 241 if (class_id < kNumPredefinedCids) { |
243 switch (class_id) { | 242 switch (class_id) { |
244 #define RAW_VISITPOINTERS(clazz) \ | 243 #define RAW_VISITPOINTERS(clazz) \ |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 intptr_t RawUserTag::VisitUserTagPointers( | 932 intptr_t RawUserTag::VisitUserTagPointers( |
934 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { | 933 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { |
935 // Make sure that we got here with the tagged pointer as this. | 934 // Make sure that we got here with the tagged pointer as this. |
936 ASSERT(raw_obj->IsHeapObject()); | 935 ASSERT(raw_obj->IsHeapObject()); |
937 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 936 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
938 return UserTag::InstanceSize(); | 937 return UserTag::InstanceSize(); |
939 } | 938 } |
940 | 939 |
941 | 940 |
942 } // namespace dart | 941 } // namespace dart |
OLD | NEW |