| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1231 info->number_of_slow_unused_properties_ += | 1231 info->number_of_slow_unused_properties_ += |
| 1232 dict->Capacity() - dict->NumberOfElements(); | 1232 dict->Capacity() - dict->NumberOfElements(); |
| 1233 } | 1233 } |
| 1234 // Indexed properties | 1234 // Indexed properties |
| 1235 switch (GetElementsKind()) { | 1235 switch (GetElementsKind()) { |
| 1236 case FAST_ELEMENTS: { | 1236 case FAST_ELEMENTS: { |
| 1237 info->number_of_objects_with_fast_elements_++; | 1237 info->number_of_objects_with_fast_elements_++; |
| 1238 int holes = 0; | 1238 int holes = 0; |
| 1239 FixedArray* e = FixedArray::cast(elements()); | 1239 FixedArray* e = FixedArray::cast(elements()); |
| 1240 int len = e->length(); | 1240 int len = e->length(); |
| 1241 Heap* heap = HEAP; |
| 1241 for (int i = 0; i < len; i++) { | 1242 for (int i = 0; i < len; i++) { |
| 1242 if (e->get(i) == HEAP->the_hole_value()) holes++; | 1243 if (e->get(i) == heap->the_hole_value()) holes++; |
| 1243 } | 1244 } |
| 1244 info->number_of_fast_used_elements_ += len - holes; | 1245 info->number_of_fast_used_elements_ += len - holes; |
| 1245 info->number_of_fast_unused_elements_ += holes; | 1246 info->number_of_fast_unused_elements_ += holes; |
| 1246 break; | 1247 break; |
| 1247 } | 1248 } |
| 1248 case PIXEL_ELEMENTS: { | 1249 case PIXEL_ELEMENTS: { |
| 1249 info->number_of_objects_with_fast_elements_++; | 1250 info->number_of_objects_with_fast_elements_++; |
| 1250 PixelArray* e = PixelArray::cast(elements()); | 1251 PixelArray* e = PixelArray::cast(elements()); |
| 1251 info->number_of_fast_used_elements_ += e->length(); | 1252 info->number_of_fast_used_elements_ += e->length(); |
| 1252 break; | 1253 break; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 ASSERT(get(i)->IsTheHole()); | 1358 ASSERT(get(i)->IsTheHole()); |
| 1358 get(i)->Verify(); | 1359 get(i)->Verify(); |
| 1359 } | 1360 } |
| 1360 } | 1361 } |
| 1361 } | 1362 } |
| 1362 | 1363 |
| 1363 | 1364 |
| 1364 #endif // DEBUG | 1365 #endif // DEBUG |
| 1365 | 1366 |
| 1366 } } // namespace v8::internal | 1367 } } // namespace v8::internal |
| OLD | NEW |