| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 175         instance_size = Int64Array::InstanceSize(byte_array_length); | 175         instance_size = Int64Array::InstanceSize(byte_array_length); | 
| 176         break; | 176         break; | 
| 177       } | 177       } | 
| 178       case kUint64ArrayCid: { | 178       case kUint64ArrayCid: { | 
| 179         const RawUint64Array* raw_byte_array = | 179         const RawUint64Array* raw_byte_array = | 
| 180             reinterpret_cast<const RawUint64Array*>(this); | 180             reinterpret_cast<const RawUint64Array*>(this); | 
| 181         intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 181         intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 
| 182         instance_size = Uint64Array::InstanceSize(byte_array_length); | 182         instance_size = Uint64Array::InstanceSize(byte_array_length); | 
| 183         break; | 183         break; | 
| 184       } | 184       } | 
|  | 185       case kFloat32x4ArrayCid: { | 
|  | 186         const RawFloat32x4Array* raw_byte_array = | 
|  | 187             reinterpret_cast<const RawFloat32x4Array*>(this); | 
|  | 188         intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 
|  | 189         instance_size = Float32x4Array::InstanceSize(byte_array_length); | 
|  | 190         break; | 
|  | 191       } | 
| 185       case kFloat32ArrayCid: { | 192       case kFloat32ArrayCid: { | 
| 186         const RawFloat32Array* raw_byte_array = | 193         const RawFloat32Array* raw_byte_array = | 
| 187             reinterpret_cast<const RawFloat32Array*>(this); | 194             reinterpret_cast<const RawFloat32Array*>(this); | 
| 188         intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 195         intptr_t byte_array_length = Smi::Value(raw_byte_array->ptr()->length_); | 
| 189         instance_size = Float32Array::InstanceSize(byte_array_length); | 196         instance_size = Float32Array::InstanceSize(byte_array_length); | 
| 190         break; | 197         break; | 
| 191       } | 198       } | 
| 192       case kFloat64ArrayCid: { | 199       case kFloat64ArrayCid: { | 
| 193         const RawFloat64Array* raw_byte_array = | 200         const RawFloat64Array* raw_byte_array = | 
| 194             reinterpret_cast<const RawFloat64Array*>(this); | 201             reinterpret_cast<const RawFloat64Array*>(this); | 
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 754 } | 761 } | 
| 755 | 762 | 
| 756 | 763 | 
| 757 intptr_t RawGrowableObjectArray::VisitGrowableObjectArrayPointers( | 764 intptr_t RawGrowableObjectArray::VisitGrowableObjectArrayPointers( | 
| 758     RawGrowableObjectArray* raw_obj, ObjectPointerVisitor* visitor) { | 765     RawGrowableObjectArray* raw_obj, ObjectPointerVisitor* visitor) { | 
| 759   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 766   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 760   return GrowableObjectArray::InstanceSize(); | 767   return GrowableObjectArray::InstanceSize(); | 
| 761 } | 768 } | 
| 762 | 769 | 
| 763 | 770 | 
|  | 771 intptr_t RawFloat32x4::VisitFloat32x4Pointers( | 
|  | 772     RawFloat32x4* raw_obj, | 
|  | 773     ObjectPointerVisitor* visitor) { | 
|  | 774     ASSERT(raw_obj->IsHeapObject()); | 
|  | 775     return Float32x4::InstanceSize(); | 
|  | 776 } | 
|  | 777 | 
|  | 778 | 
|  | 779 intptr_t RawUint32x4::VisitUint32x4Pointers( | 
|  | 780     RawUint32x4* raw_obj, | 
|  | 781     ObjectPointerVisitor* visitor) { | 
|  | 782     ASSERT(raw_obj->IsHeapObject()); | 
|  | 783     return Uint32x4::InstanceSize(); | 
|  | 784 } | 
|  | 785 | 
|  | 786 | 
| 764 intptr_t RawByteArray::VisitByteArrayPointers(RawByteArray* raw_obj, | 787 intptr_t RawByteArray::VisitByteArrayPointers(RawByteArray* raw_obj, | 
| 765                                               ObjectPointerVisitor* visitor) { | 788                                               ObjectPointerVisitor* visitor) { | 
| 766   // ByteArray is an abstract class. | 789   // ByteArray is an abstract class. | 
| 767   UNREACHABLE(); | 790   UNREACHABLE(); | 
| 768   return 0; | 791   return 0; | 
| 769 } | 792 } | 
| 770 | 793 | 
| 771 | 794 | 
| 772 intptr_t RawInt8Array::VisitInt8ArrayPointers( | 795 intptr_t RawInt8Array::VisitInt8ArrayPointers( | 
| 773     RawInt8Array *raw_obj, ObjectPointerVisitor* visitor) { | 796     RawInt8Array *raw_obj, ObjectPointerVisitor* visitor) { | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 852 intptr_t RawUint64Array::VisitUint64ArrayPointers( | 875 intptr_t RawUint64Array::VisitUint64ArrayPointers( | 
| 853     RawUint64Array *raw_obj, ObjectPointerVisitor* visitor) { | 876     RawUint64Array *raw_obj, ObjectPointerVisitor* visitor) { | 
| 854   // Make sure that we got here with the tagged pointer as this. | 877   // Make sure that we got here with the tagged pointer as this. | 
| 855   ASSERT(raw_obj->IsHeapObject()); | 878   ASSERT(raw_obj->IsHeapObject()); | 
| 856   intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 879   intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 
| 857   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 880   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 858   return Uint64Array::InstanceSize(length); | 881   return Uint64Array::InstanceSize(length); | 
| 859 } | 882 } | 
| 860 | 883 | 
| 861 | 884 | 
|  | 885 intptr_t RawFloat32x4Array::VisitFloat32x4ArrayPointers( | 
|  | 886     RawFloat32x4Array *raw_obj, ObjectPointerVisitor* visitor) { | 
|  | 887   // Make sure that we got here with the tagged pointer as this. | 
|  | 888   ASSERT(raw_obj->IsHeapObject()); | 
|  | 889   intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 
|  | 890   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
|  | 891   return Float32x4Array::InstanceSize(length); | 
|  | 892 } | 
|  | 893 | 
| 862 intptr_t RawFloat32Array::VisitFloat32ArrayPointers( | 894 intptr_t RawFloat32Array::VisitFloat32ArrayPointers( | 
| 863     RawFloat32Array *raw_obj, ObjectPointerVisitor* visitor) { | 895     RawFloat32Array *raw_obj, ObjectPointerVisitor* visitor) { | 
| 864   // Make sure that we got here with the tagged pointer as this. | 896   // Make sure that we got here with the tagged pointer as this. | 
| 865   ASSERT(raw_obj->IsHeapObject()); | 897   ASSERT(raw_obj->IsHeapObject()); | 
| 866   intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 898   intptr_t length = Smi::Value(raw_obj->ptr()->length_); | 
| 867   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 899   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 868   return Float32Array::InstanceSize(length); | 900   return Float32Array::InstanceSize(length); | 
| 869 } | 901 } | 
| 870 | 902 | 
| 871 | 903 | 
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 953 | 985 | 
| 954 intptr_t RawExternalUint64Array::VisitExternalUint64ArrayPointers( | 986 intptr_t RawExternalUint64Array::VisitExternalUint64ArrayPointers( | 
| 955     RawExternalUint64Array* raw_obj, ObjectPointerVisitor* visitor) { | 987     RawExternalUint64Array* raw_obj, ObjectPointerVisitor* visitor) { | 
| 956   // Make sure that we got here with the tagged pointer as this. | 988   // Make sure that we got here with the tagged pointer as this. | 
| 957   ASSERT(raw_obj->IsHeapObject()); | 989   ASSERT(raw_obj->IsHeapObject()); | 
| 958   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 990   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 959   return ExternalUint64Array::InstanceSize(); | 991   return ExternalUint64Array::InstanceSize(); | 
| 960 } | 992 } | 
| 961 | 993 | 
| 962 | 994 | 
|  | 995 intptr_t | 
|  | 996     RawExternalFloat32x4Array::VisitExternalFloat32x4ArrayPointers( | 
|  | 997     RawExternalFloat32x4Array* raw_obj, ObjectPointerVisitor* visitor) { | 
|  | 998   // Make sure that we got here with the tagged pointer as this. | 
|  | 999   ASSERT(raw_obj->IsHeapObject()); | 
|  | 1000   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
|  | 1001   return ExternalFloat32x4Array::InstanceSize(); | 
|  | 1002 } | 
|  | 1003 | 
|  | 1004 | 
| 963 intptr_t RawExternalFloat32Array::VisitExternalFloat32ArrayPointers( | 1005 intptr_t RawExternalFloat32Array::VisitExternalFloat32ArrayPointers( | 
| 964     RawExternalFloat32Array* raw_obj, ObjectPointerVisitor* visitor) { | 1006     RawExternalFloat32Array* raw_obj, ObjectPointerVisitor* visitor) { | 
| 965   // Make sure that we got here with the tagged pointer as this. | 1007   // Make sure that we got here with the tagged pointer as this. | 
| 966   ASSERT(raw_obj->IsHeapObject()); | 1008   ASSERT(raw_obj->IsHeapObject()); | 
| 967   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 1009   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 968   return ExternalFloat32Array::InstanceSize(); | 1010   return ExternalFloat32Array::InstanceSize(); | 
| 969 } | 1011 } | 
| 970 | 1012 | 
| 971 | 1013 | 
| 972 intptr_t RawExternalFloat64Array::VisitExternalFloat64ArrayPointers( | 1014 intptr_t RawExternalFloat64Array::VisitExternalFloat64ArrayPointers( | 
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1007 | 1049 | 
| 1008 intptr_t RawWeakProperty::VisitWeakPropertyPointers( | 1050 intptr_t RawWeakProperty::VisitWeakPropertyPointers( | 
| 1009     RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { | 1051     RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { | 
| 1010   // Make sure that we got here with the tagged pointer as this. | 1052   // Make sure that we got here with the tagged pointer as this. | 
| 1011   ASSERT(raw_obj->IsHeapObject()); | 1053   ASSERT(raw_obj->IsHeapObject()); | 
| 1012   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 1054   visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 
| 1013   return WeakProperty::InstanceSize(); | 1055   return WeakProperty::InstanceSize(); | 
| 1014 } | 1056 } | 
| 1015 | 1057 | 
| 1016 }  // namespace dart | 1058 }  // namespace dart | 
| OLD | NEW | 
|---|