OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 8256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8267 ExternalUnsignedIntArray::cast(object->elements())->length(); | 8267 ExternalUnsignedIntArray::cast(object->elements())->length(); |
8268 break; | 8268 break; |
8269 } | 8269 } |
8270 case JSObject::EXTERNAL_FLOAT_ELEMENTS: { | 8270 case JSObject::EXTERNAL_FLOAT_ELEMENTS: { |
8271 dense_elements_length = | 8271 dense_elements_length = |
8272 ExternalFloatArray::cast(object->elements())->length(); | 8272 ExternalFloatArray::cast(object->elements())->length(); |
8273 break; | 8273 break; |
8274 } | 8274 } |
8275 default: | 8275 default: |
8276 UNREACHABLE(); | 8276 UNREACHABLE(); |
| 8277 dense_elements_length = 0; |
8277 break; | 8278 break; |
8278 } | 8279 } |
8279 uint32_t length = static_cast<uint32_t>(dense_elements_length); | 8280 uint32_t length = static_cast<uint32_t>(dense_elements_length); |
8280 if (range <= length) { | 8281 if (range <= length) { |
8281 length = range; | 8282 length = range; |
8282 // We will add all indices, so we might as well clear it first | 8283 // We will add all indices, so we might as well clear it first |
8283 // and avoid duplicates. | 8284 // and avoid duplicates. |
8284 indices->Clear(); | 8285 indices->Clear(); |
8285 } | 8286 } |
8286 for (uint32_t i = 0; i < length; i++) { | 8287 for (uint32_t i = 0; i < length; i++) { |
(...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11291 } else { | 11292 } else { |
11292 // Handle last resort GC and make sure to allow future allocations | 11293 // Handle last resort GC and make sure to allow future allocations |
11293 // to grow the heap without causing GCs (if possible). | 11294 // to grow the heap without causing GCs (if possible). |
11294 Counters::gc_last_resort_from_js.Increment(); | 11295 Counters::gc_last_resort_from_js.Increment(); |
11295 Heap::CollectAllGarbage(false); | 11296 Heap::CollectAllGarbage(false); |
11296 } | 11297 } |
11297 } | 11298 } |
11298 | 11299 |
11299 | 11300 |
11300 } } // namespace v8::internal | 11301 } } // namespace v8::internal |
OLD | NEW |