Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: runtime/vm/raw_object.cc

Issue 11437028: Added Uint8ClampedList. COmpielr optimziations to follow in next CL. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
864 intptr_t RawExternalInt16Array::VisitExternalInt16ArrayPointers( 890 intptr_t RawExternalInt16Array::VisitExternalInt16ArrayPointers(
865 RawExternalInt16Array* raw_obj, ObjectPointerVisitor* visitor) { 891 RawExternalInt16Array* raw_obj, ObjectPointerVisitor* visitor) {
866 // Make sure that we got here with the tagged pointer as this. 892 // Make sure that we got here with the tagged pointer as this.
867 ASSERT(raw_obj->IsHeapObject()); 893 ASSERT(raw_obj->IsHeapObject());
868 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 894 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
869 return ExternalInt16Array::InstanceSize(); 895 return ExternalInt16Array::InstanceSize();
870 } 896 }
871 897
872 898
873 intptr_t RawExternalUint16Array::VisitExternalUint16ArrayPointers( 899 intptr_t RawExternalUint16Array::VisitExternalUint16ArrayPointers(
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 988
963 intptr_t RawWeakProperty::VisitWeakPropertyPointers( 989 intptr_t RawWeakProperty::VisitWeakPropertyPointers(
964 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { 990 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) {
965 // Make sure that we got here with the tagged pointer as this. 991 // Make sure that we got here with the tagged pointer as this.
966 ASSERT(raw_obj->IsHeapObject()); 992 ASSERT(raw_obj->IsHeapObject());
967 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 993 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
968 return WeakProperty::InstanceSize(); 994 return WeakProperty::InstanceSize();
969 } 995 }
970 996
971 } // namespace dart 997 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698