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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 instance_size = Int8Array::InstanceSize(byte_array_length); | 116 instance_size = Int8Array::InstanceSize(byte_array_length); |
117 break; | 117 break; |
118 } | 118 } |
119 case kUint8ArrayCid: { | 119 case kUint8ArrayCid: { |
120 const RawUint8Array* raw_byte_array = | 120 const RawUint8Array* raw_byte_array = |
121 reinterpret_cast<const RawUint8Array*>(this); | 121 reinterpret_cast<const RawUint8Array*>(this); |
122 intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 122 intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); |
123 instance_size = Uint8Array::InstanceSize(byte_array_length); | 123 instance_size = Uint8Array::InstanceSize(byte_array_length); |
124 break; | 124 break; |
125 } | 125 } |
126 case kUint8ClampedArrayCid: { | |
127 const RawUint8ClampedArray* raw_byte_array = | |
128 reinterpret_cast<const RawUint8ClampedArray*>(this); | |
129 intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | |
130 instance_size = Uint8ClampedArray::InstanceSize(byte_array_length); | |
131 break; | |
132 } | |
126 case kInt16ArrayCid: { | 133 case kInt16ArrayCid: { |
127 const RawInt16Array* raw_byte_array = | 134 const RawInt16Array* raw_byte_array = |
128 reinterpret_cast<const RawInt16Array*>(this); | 135 reinterpret_cast<const RawInt16Array*>(this); |
129 intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 136 intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); |
130 instance_size = Int16Array::InstanceSize(byte_array_length); | 137 instance_size = Int16Array::InstanceSize(byte_array_length); |
131 break; | 138 break; |
132 } | 139 } |
133 case kUint16ArrayCid: { | 140 case kUint16ArrayCid: { |
134 const RawUint16Array* raw_byte_array = | 141 const RawUint16Array* raw_byte_array = |
135 reinterpret_cast<const RawUint16Array*>(this); | 142 reinterpret_cast<const RawUint16Array*>(this); |
(...skipping 620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 intptr_t RawUint8Array::VisitUint8ArrayPointers( | 763 intptr_t RawUint8Array::VisitUint8ArrayPointers( |
757 RawUint8Array *raw_obj, ObjectPointerVisitor* visitor) { | 764 RawUint8Array *raw_obj, ObjectPointerVisitor* visitor) { |
758 // Make sure that we got here with the tagged pointer as this. | 765 // Make sure that we got here with the tagged pointer as this. |
759 ASSERT(raw_obj->IsHeapObject()); | 766 ASSERT(raw_obj->IsHeapObject()); |
760 intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 767 intptr_t length = Smi::Value(raw_obj->ptr()->length_); |
761 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 768 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
762 return Uint8Array::InstanceSize(length); | 769 return Uint8Array::InstanceSize(length); |
763 } | 770 } |
764 | 771 |
765 | 772 |
773 intptr_t RawUint8ClampedArray::VisitUint8ClampedArrayPointers( | |
774 RawUint8ClampedArray *raw_obj, ObjectPointerVisitor* visitor) { | |
775 // Make sure that we got here with the tagged pointer as this. | |
776 ASSERT(raw_obj->IsHeapObject()); | |
777 intptr_t length = Smi::Value(raw_obj->ptr()->length_); | |
778 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | |
779 return Uint8ClampedArray::InstanceSize(length); | |
780 } | |
781 | |
782 | |
766 intptr_t RawInt16Array::VisitInt16ArrayPointers( | 783 intptr_t RawInt16Array::VisitInt16ArrayPointers( |
767 RawInt16Array *raw_obj, ObjectPointerVisitor* visitor) { | 784 RawInt16Array *raw_obj, ObjectPointerVisitor* visitor) { |
768 // Make sure that we got here with the tagged pointer as this. | 785 // Make sure that we got here with the tagged pointer as this. |
769 ASSERT(raw_obj->IsHeapObject()); | 786 ASSERT(raw_obj->IsHeapObject()); |
770 intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 787 intptr_t length = Smi::Value(raw_obj->ptr()->length_); |
771 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 788 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
772 return Int16Array::InstanceSize(length); | 789 return Int16Array::InstanceSize(length); |
773 } | 790 } |
774 | 791 |
775 | 792 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
854 | 871 |
855 intptr_t RawExternalUint8Array::VisitExternalUint8ArrayPointers( | 872 intptr_t RawExternalUint8Array::VisitExternalUint8ArrayPointers( |
856 RawExternalUint8Array* raw_obj, ObjectPointerVisitor* visitor) { | 873 RawExternalUint8Array* raw_obj, ObjectPointerVisitor* visitor) { |
857 // Make sure that we got here with the tagged pointer as this. | 874 // Make sure that we got here with the tagged pointer as this. |
858 ASSERT(raw_obj->IsHeapObject()); | 875 ASSERT(raw_obj->IsHeapObject()); |
859 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 876 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
860 return ExternalUint8Array::InstanceSize(); | 877 return ExternalUint8Array::InstanceSize(); |
861 } | 878 } |
862 | 879 |
863 | 880 |
881 intptr_t RawExternalUint8ClampedArray::VisitExternalUint8ClampedArrayPointers( | |
882 RawExternalUint8ClampedArray* raw_obj, ObjectPointerVisitor* visitor) { | |
883 // Make sure that we got here with the tagged pointer as this. | |
884 ASSERT(raw_obj->IsHeapObject()); | |
885 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | |
886 return ExternalUint8ClampedArray::InstanceSize(); | |
887 } | |
888 | |
889 | |
890 | |
cshapiro
2012/12/05 23:01:49
extra blank line
srdjan
2012/12/06 19:23:14
Done.
| |
864 intptr_t RawExternalInt16Array::VisitExternalInt16ArrayPointers( | 891 intptr_t RawExternalInt16Array::VisitExternalInt16ArrayPointers( |
865 RawExternalInt16Array* raw_obj, ObjectPointerVisitor* visitor) { | 892 RawExternalInt16Array* raw_obj, ObjectPointerVisitor* visitor) { |
866 // Make sure that we got here with the tagged pointer as this. | 893 // Make sure that we got here with the tagged pointer as this. |
867 ASSERT(raw_obj->IsHeapObject()); | 894 ASSERT(raw_obj->IsHeapObject()); |
868 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 895 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
869 return ExternalInt16Array::InstanceSize(); | 896 return ExternalInt16Array::InstanceSize(); |
870 } | 897 } |
871 | 898 |
872 | 899 |
873 intptr_t RawExternalUint16Array::VisitExternalUint16ArrayPointers( | 900 intptr_t RawExternalUint16Array::VisitExternalUint16ArrayPointers( |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
962 | 989 |
963 intptr_t RawWeakProperty::VisitWeakPropertyPointers( | 990 intptr_t RawWeakProperty::VisitWeakPropertyPointers( |
964 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { | 991 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { |
965 // Make sure that we got here with the tagged pointer as this. | 992 // Make sure that we got here with the tagged pointer as this. |
966 ASSERT(raw_obj->IsHeapObject()); | 993 ASSERT(raw_obj->IsHeapObject()); |
967 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 994 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
968 return WeakProperty::InstanceSize(); | 995 return WeakProperty::InstanceSize(); |
969 } | 996 } |
970 | 997 |
971 } // namespace dart | 998 } // namespace dart |
OLD | NEW |