| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 9638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9649 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); | 9649 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); |
| 9650 return object->PrepareElementsForSort(limit); | 9650 return object->PrepareElementsForSort(limit); |
| 9651 } | 9651 } |
| 9652 | 9652 |
| 9653 | 9653 |
| 9654 // Move contents of argument 0 (an array) to argument 1 (an array) | 9654 // Move contents of argument 0 (an array) to argument 1 (an array) |
| 9655 RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) { | 9655 RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) { |
| 9656 ASSERT(args.length() == 2); | 9656 ASSERT(args.length() == 2); |
| 9657 CONVERT_CHECKED(JSArray, from, args[0]); | 9657 CONVERT_CHECKED(JSArray, from, args[0]); |
| 9658 CONVERT_CHECKED(JSArray, to, args[1]); | 9658 CONVERT_CHECKED(JSArray, to, args[1]); |
| 9659 HeapObject* new_elements = from->elements(); | 9659 FixedArrayBase* new_elements = from->elements(); |
| 9660 MaybeObject* maybe_new_map; | 9660 MaybeObject* maybe_new_map; |
| 9661 if (new_elements->map() == isolate->heap()->fixed_array_map() || | 9661 if (new_elements->map() == isolate->heap()->fixed_array_map() || |
| 9662 new_elements->map() == isolate->heap()->fixed_cow_array_map()) { | 9662 new_elements->map() == isolate->heap()->fixed_cow_array_map()) { |
| 9663 maybe_new_map = to->map()->GetFastElementsMap(); | 9663 maybe_new_map = to->map()->GetFastElementsMap(); |
| 9664 } else if (new_elements->map() == | 9664 } else if (new_elements->map() == |
| 9665 isolate->heap()->fixed_double_array_map()) { | 9665 isolate->heap()->fixed_double_array_map()) { |
| 9666 maybe_new_map = to->map()->GetFastDoubleElementsMap(); | 9666 maybe_new_map = to->map()->GetFastDoubleElementsMap(); |
| 9667 } else { | 9667 } else { |
| 9668 maybe_new_map = to->map()->GetSlowElementsMap(); | 9668 maybe_new_map = to->map()->GetSlowElementsMap(); |
| 9669 } | 9669 } |
| (...skipping 3169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12839 } else { | 12839 } else { |
| 12840 // Handle last resort GC and make sure to allow future allocations | 12840 // Handle last resort GC and make sure to allow future allocations |
| 12841 // to grow the heap without causing GCs (if possible). | 12841 // to grow the heap without causing GCs (if possible). |
| 12842 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12842 isolate->counters()->gc_last_resort_from_js()->Increment(); |
| 12843 isolate->heap()->CollectAllGarbage(false); | 12843 isolate->heap()->CollectAllGarbage(false); |
| 12844 } | 12844 } |
| 12845 } | 12845 } |
| 12846 | 12846 |
| 12847 | 12847 |
| 12848 } } // namespace v8::internal | 12848 } } // namespace v8::internal |
| OLD | NEW |