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/become.h" | 7 #include "vm/become.h" |
8 #include "vm/class_table.h" | 8 #include "vm/class_table.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/freelist.h" | 10 #include "vm/freelist.h" |
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 // String is an abstract class. | 814 // String is an abstract class. |
815 UNREACHABLE(); | 815 UNREACHABLE(); |
816 return 0; | 816 return 0; |
817 } | 817 } |
818 | 818 |
819 | 819 |
820 intptr_t RawOneByteString::VisitOneByteStringPointers( | 820 intptr_t RawOneByteString::VisitOneByteStringPointers( |
821 RawOneByteString* raw_obj, | 821 RawOneByteString* raw_obj, |
822 ObjectPointerVisitor* visitor) { | 822 ObjectPointerVisitor* visitor) { |
823 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); | 823 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); |
824 #if !defined(HASH_IN_OBJECT_HEADER) | |
825 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); | 824 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); |
826 #endif | |
827 intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 825 intptr_t length = Smi::Value(raw_obj->ptr()->length_); |
828 return OneByteString::InstanceSize(length); | 826 return OneByteString::InstanceSize(length); |
829 } | 827 } |
830 | 828 |
831 | 829 |
832 intptr_t RawTwoByteString::VisitTwoByteStringPointers( | 830 intptr_t RawTwoByteString::VisitTwoByteStringPointers( |
833 RawTwoByteString* raw_obj, | 831 RawTwoByteString* raw_obj, |
834 ObjectPointerVisitor* visitor) { | 832 ObjectPointerVisitor* visitor) { |
835 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); | 833 ASSERT(!raw_obj->ptr()->length_->IsHeapObject()); |
836 #if !defined(HASH_IN_OBJECT_HEADER) | |
837 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); | 834 ASSERT(!raw_obj->ptr()->hash_->IsHeapObject()); |
838 #endif | |
839 intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 835 intptr_t length = Smi::Value(raw_obj->ptr()->length_); |
840 return TwoByteString::InstanceSize(length); | 836 return TwoByteString::InstanceSize(length); |
841 } | 837 } |
842 | 838 |
843 | 839 |
844 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers( | 840 intptr_t RawExternalOneByteString::VisitExternalOneByteStringPointers( |
845 RawExternalOneByteString* raw_obj, | 841 RawExternalOneByteString* raw_obj, |
846 ObjectPointerVisitor* visitor) { | 842 ObjectPointerVisitor* visitor) { |
847 // Make sure that we got here with the tagged pointer as this. | 843 // Make sure that we got here with the tagged pointer as this. |
848 ASSERT(raw_obj->IsHeapObject()); | 844 ASSERT(raw_obj->IsHeapObject()); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 intptr_t RawUserTag::VisitUserTagPointers(RawUserTag* raw_obj, | 1004 intptr_t RawUserTag::VisitUserTagPointers(RawUserTag* raw_obj, |
1009 ObjectPointerVisitor* visitor) { | 1005 ObjectPointerVisitor* visitor) { |
1010 // Make sure that we got here with the tagged pointer as this. | 1006 // Make sure that we got here with the tagged pointer as this. |
1011 ASSERT(raw_obj->IsHeapObject()); | 1007 ASSERT(raw_obj->IsHeapObject()); |
1012 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 1008 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
1013 return UserTag::InstanceSize(); | 1009 return UserTag::InstanceSize(); |
1014 } | 1010 } |
1015 | 1011 |
1016 | 1012 |
1017 } // namespace dart | 1013 } // namespace dart |
OLD | NEW |