OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 break; | 125 break; |
126 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 126 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
127 ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayVerify(); | 127 ExternalUnsignedIntArray::cast(this)->ExternalUnsignedIntArrayVerify(); |
128 break; | 128 break; |
129 case EXTERNAL_FLOAT_ARRAY_TYPE: | 129 case EXTERNAL_FLOAT_ARRAY_TYPE: |
130 ExternalFloatArray::cast(this)->ExternalFloatArrayVerify(); | 130 ExternalFloatArray::cast(this)->ExternalFloatArrayVerify(); |
131 break; | 131 break; |
132 case EXTERNAL_DOUBLE_ARRAY_TYPE: | 132 case EXTERNAL_DOUBLE_ARRAY_TYPE: |
133 ExternalDoubleArray::cast(this)->ExternalDoubleArrayVerify(); | 133 ExternalDoubleArray::cast(this)->ExternalDoubleArrayVerify(); |
134 break; | 134 break; |
| 135 case FIXED_UINT8_ARRAY_TYPE: |
| 136 FixedUint8Array::cast(this)->FixedTypedArrayVerify(); |
| 137 break; |
| 138 case FIXED_INT8_ARRAY_TYPE: |
| 139 FixedInt8Array::cast(this)->FixedTypedArrayVerify(); |
| 140 break; |
| 141 case FIXED_UINT16_ARRAY_TYPE: |
| 142 FixedUint16Array::cast(this)->FixedTypedArrayVerify(); |
| 143 break; |
| 144 case FIXED_INT16_ARRAY_TYPE: |
| 145 FixedInt16Array::cast(this)->FixedTypedArrayVerify(); |
| 146 break; |
| 147 case FIXED_UINT32_ARRAY_TYPE: |
| 148 FixedUint32Array::cast(this)->FixedTypedArrayVerify(); |
| 149 break; |
| 150 case FIXED_INT32_ARRAY_TYPE: |
| 151 FixedInt32Array::cast(this)->FixedTypedArrayVerify(); |
| 152 break; |
| 153 case FIXED_FLOAT32_ARRAY_TYPE: |
| 154 FixedFloat32Array::cast(this)->FixedTypedArrayVerify(); |
| 155 break; |
| 156 case FIXED_FLOAT64_ARRAY_TYPE: |
| 157 FixedFloat64Array::cast(this)->FixedTypedArrayVerify(); |
| 158 break; |
| 159 case FIXED_UINT8_CLAMPED_ARRAY_TYPE: |
| 160 FixedUint8ClampedArray::cast(this)->FixedTypedArrayVerify(); |
| 161 break; |
135 case CODE_TYPE: | 162 case CODE_TYPE: |
136 Code::cast(this)->CodeVerify(); | 163 Code::cast(this)->CodeVerify(); |
137 break; | 164 break; |
138 case ODDBALL_TYPE: | 165 case ODDBALL_TYPE: |
139 Oddball::cast(this)->OddballVerify(); | 166 Oddball::cast(this)->OddballVerify(); |
140 break; | 167 break; |
141 case JS_OBJECT_TYPE: | 168 case JS_OBJECT_TYPE: |
142 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 169 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
143 JSObject::cast(this)->JSObjectVerify(); | 170 JSObject::cast(this)->JSObjectVerify(); |
144 break; | 171 break; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 void ExternalFloatArray::ExternalFloatArrayVerify() { | 327 void ExternalFloatArray::ExternalFloatArrayVerify() { |
301 CHECK(IsExternalFloatArray()); | 328 CHECK(IsExternalFloatArray()); |
302 } | 329 } |
303 | 330 |
304 | 331 |
305 void ExternalDoubleArray::ExternalDoubleArrayVerify() { | 332 void ExternalDoubleArray::ExternalDoubleArrayVerify() { |
306 CHECK(IsExternalDoubleArray()); | 333 CHECK(IsExternalDoubleArray()); |
307 } | 334 } |
308 | 335 |
309 | 336 |
| 337 template <class Traits> |
| 338 void FixedTypedArray<Traits>::FixedTypedArrayVerify() { |
| 339 CHECK(IsHeapObject() && |
| 340 HeapObject::cast(this)->map()->instance_type() == |
| 341 Traits::kInstanceType); |
| 342 } |
| 343 |
| 344 |
310 bool JSObject::ElementsAreSafeToExamine() { | 345 bool JSObject::ElementsAreSafeToExamine() { |
311 return (FLAG_use_gvn && FLAG_use_allocation_folding) || | 346 return (FLAG_use_gvn && FLAG_use_allocation_folding) || |
312 reinterpret_cast<Map*>(elements()) != | 347 reinterpret_cast<Map*>(elements()) != |
313 GetHeap()->one_pointer_filler_map(); | 348 GetHeap()->one_pointer_filler_map(); |
314 } | 349 } |
315 | 350 |
316 | 351 |
317 void JSObject::JSObjectVerify() { | 352 void JSObject::JSObjectVerify() { |
318 VerifyHeapPointer(properties()); | 353 VerifyHeapPointer(properties()); |
319 VerifyHeapPointer(elements()); | 354 VerifyHeapPointer(elements()); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 break; | 1115 break; |
1081 } | 1116 } |
1082 case EXTERNAL_BYTE_ELEMENTS: | 1117 case EXTERNAL_BYTE_ELEMENTS: |
1083 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: | 1118 case EXTERNAL_UNSIGNED_BYTE_ELEMENTS: |
1084 case EXTERNAL_SHORT_ELEMENTS: | 1119 case EXTERNAL_SHORT_ELEMENTS: |
1085 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: | 1120 case EXTERNAL_UNSIGNED_SHORT_ELEMENTS: |
1086 case EXTERNAL_INT_ELEMENTS: | 1121 case EXTERNAL_INT_ELEMENTS: |
1087 case EXTERNAL_UNSIGNED_INT_ELEMENTS: | 1122 case EXTERNAL_UNSIGNED_INT_ELEMENTS: |
1088 case EXTERNAL_FLOAT_ELEMENTS: | 1123 case EXTERNAL_FLOAT_ELEMENTS: |
1089 case EXTERNAL_DOUBLE_ELEMENTS: | 1124 case EXTERNAL_DOUBLE_ELEMENTS: |
1090 case EXTERNAL_PIXEL_ELEMENTS: { | 1125 case EXTERNAL_PIXEL_ELEMENTS: |
| 1126 case UINT8_ELEMENTS: |
| 1127 case INT8_ELEMENTS: |
| 1128 case UINT16_ELEMENTS: |
| 1129 case INT16_ELEMENTS: |
| 1130 case UINT32_ELEMENTS: |
| 1131 case INT32_ELEMENTS: |
| 1132 case FLOAT32_ELEMENTS: |
| 1133 case FLOAT64_ELEMENTS: |
| 1134 case UINT8_CLAMPED_ELEMENTS: { |
1091 info->number_of_objects_with_fast_elements_++; | 1135 info->number_of_objects_with_fast_elements_++; |
1092 ExternalPixelArray* e = ExternalPixelArray::cast(elements()); | 1136 FixedArrayBase* e = FixedArrayBase::cast(elements()); |
1093 info->number_of_fast_used_elements_ += e->length(); | 1137 info->number_of_fast_used_elements_ += e->length(); |
1094 break; | 1138 break; |
1095 } | 1139 } |
1096 case DICTIONARY_ELEMENTS: { | 1140 case DICTIONARY_ELEMENTS: { |
1097 SeededNumberDictionary* dict = element_dictionary(); | 1141 SeededNumberDictionary* dict = element_dictionary(); |
1098 info->number_of_slow_used_elements_ += dict->NumberOfElements(); | 1142 info->number_of_slow_used_elements_ += dict->NumberOfElements(); |
1099 info->number_of_slow_unused_elements_ += | 1143 info->number_of_slow_unused_elements_ += |
1100 dict->Capacity() - dict->NumberOfElements(); | 1144 dict->Capacity() - dict->NumberOfElements(); |
1101 break; | 1145 break; |
1102 } | 1146 } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1197 for (int i = 0; i < number_of_transitions(); ++i) { | 1241 for (int i = 0; i < number_of_transitions(); ++i) { |
1198 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; | 1242 if (!CheckOneBackPointer(current_map, GetTarget(i))) return false; |
1199 } | 1243 } |
1200 return true; | 1244 return true; |
1201 } | 1245 } |
1202 | 1246 |
1203 | 1247 |
1204 #endif // DEBUG | 1248 #endif // DEBUG |
1205 | 1249 |
1206 } } // namespace v8::internal | 1250 } } // namespace v8::internal |
OLD | NEW |