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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 uword tags = ptr()->tags_; | 250 uword tags = ptr()->tags_; |
251 ASSERT((instance_size == SizeTag::decode(tags)) || | 251 ASSERT((instance_size == SizeTag::decode(tags)) || |
252 (SizeTag::decode(tags) == 0) || | 252 (SizeTag::decode(tags) == 0) || |
253 FreeBit::decode(tags)); | 253 FreeBit::decode(tags)); |
254 return instance_size; | 254 return instance_size; |
255 } | 255 } |
256 | 256 |
257 | 257 |
258 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { | 258 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { |
259 intptr_t size = 0; | 259 intptr_t size = 0; |
260 NoHandleScope no_handles(Isolate::Current()); | 260 NoHandleScope no_handles(visitor->isolate()); |
261 | 261 |
262 // Only reasonable to be called on heap objects. | 262 // Only reasonable to be called on heap objects. |
263 ASSERT(IsHeapObject()); | 263 ASSERT(IsHeapObject()); |
264 | 264 |
265 // Read the necessary data out of the class before visting the class itself. | 265 // Read the necessary data out of the class before visting the class itself. |
266 RawClass* raw_class = ptr()->class_; | 266 RawClass* raw_class = ptr()->class_; |
267 ObjectKind kind = raw_class->ptr()->instance_kind_; | 267 ObjectKind kind = raw_class->ptr()->instance_kind_; |
268 | 268 |
269 // Visit the class before visting the fields. | 269 // Visit the class before visting the fields. |
270 visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_)); | 270 visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_)); |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
936 ObjectPointerVisitor* visitor) { | 936 ObjectPointerVisitor* visitor) { |
937 // Make sure that we got here with the tagged pointer as this. | 937 // Make sure that we got here with the tagged pointer as this. |
938 ASSERT(raw_obj->IsHeapObject()); | 938 ASSERT(raw_obj->IsHeapObject()); |
939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
940 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 940 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
941 return JSRegExp::InstanceSize(length); | 941 return JSRegExp::InstanceSize(length); |
942 } | 942 } |
943 | 943 |
944 } // namespace dart | 944 } // namespace dart |
OLD | NEW |