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 10490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10501 } | 10501 } |
10502 return string; | 10502 return string; |
10503 } | 10503 } |
10504 | 10504 |
10505 | 10505 |
10506 // Moves all own elements of an object, that are below a limit, to positions | 10506 // Moves all own elements of an object, that are below a limit, to positions |
10507 // starting at zero. All undefined values are placed after non-undefined values, | 10507 // starting at zero. All undefined values are placed after non-undefined values, |
10508 // and are followed by non-existing element. Does not change the length | 10508 // and are followed by non-existing element. Does not change the length |
10509 // property. | 10509 // property. |
10510 // Returns the number of non-undefined elements collected. | 10510 // Returns the number of non-undefined elements collected. |
| 10511 // Returns -1 if hole removal is not supported by this method. |
10511 RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) { | 10512 RUNTIME_FUNCTION(MaybeObject*, Runtime_RemoveArrayHoles) { |
10512 HandleScope scope(isolate); | 10513 HandleScope scope(isolate); |
10513 ASSERT(args.length() == 2); | 10514 ASSERT(args.length() == 2); |
10514 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); | 10515 CONVERT_ARG_HANDLE_CHECKED(JSObject, object, 0); |
10515 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); | 10516 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); |
10516 return *JSObject::PrepareElementsForSort(object, limit); | 10517 return *JSObject::PrepareElementsForSort(object, limit); |
10517 } | 10518 } |
10518 | 10519 |
10519 | 10520 |
10520 // Move contents of argument 0 (an array) to argument 1 (an array) | 10521 // Move contents of argument 0 (an array) to argument 1 (an array) |
(...skipping 4449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14970 // Handle last resort GC and make sure to allow future allocations | 14971 // Handle last resort GC and make sure to allow future allocations |
14971 // to grow the heap without causing GCs (if possible). | 14972 // to grow the heap without causing GCs (if possible). |
14972 isolate->counters()->gc_last_resort_from_js()->Increment(); | 14973 isolate->counters()->gc_last_resort_from_js()->Increment(); |
14973 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, | 14974 isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, |
14974 "Runtime::PerformGC"); | 14975 "Runtime::PerformGC"); |
14975 } | 14976 } |
14976 } | 14977 } |
14977 | 14978 |
14978 | 14979 |
14979 } } // namespace v8::internal | 14980 } } // namespace v8::internal |
OLD | NEW |