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 9662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9673 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); | 9673 CONVERT_NUMBER_CHECKED(uint32_t, limit, Uint32, args[1]); |
9674 return object->PrepareElementsForSort(limit); | 9674 return object->PrepareElementsForSort(limit); |
9675 } | 9675 } |
9676 | 9676 |
9677 | 9677 |
9678 // Move contents of argument 0 (an array) to argument 1 (an array) | 9678 // Move contents of argument 0 (an array) to argument 1 (an array) |
9679 RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) { | 9679 RUNTIME_FUNCTION(MaybeObject*, Runtime_MoveArrayContents) { |
9680 ASSERT(args.length() == 2); | 9680 ASSERT(args.length() == 2); |
9681 CONVERT_CHECKED(JSArray, from, args[0]); | 9681 CONVERT_CHECKED(JSArray, from, args[0]); |
9682 CONVERT_CHECKED(JSArray, to, args[1]); | 9682 CONVERT_CHECKED(JSArray, to, args[1]); |
9683 HeapObject* new_elements = from->elements(); | 9683 FixedArrayBase* new_elements = from->elements(); |
9684 MaybeObject* maybe_new_map; | 9684 MaybeObject* maybe_new_map; |
9685 if (new_elements->map() == isolate->heap()->fixed_array_map() || | 9685 if (new_elements->map() == isolate->heap()->fixed_array_map() || |
9686 new_elements->map() == isolate->heap()->fixed_cow_array_map()) { | 9686 new_elements->map() == isolate->heap()->fixed_cow_array_map()) { |
9687 maybe_new_map = to->map()->GetFastElementsMap(); | 9687 maybe_new_map = to->map()->GetFastElementsMap(); |
9688 } else if (new_elements->map() == | 9688 } else if (new_elements->map() == |
9689 isolate->heap()->fixed_double_array_map()) { | 9689 isolate->heap()->fixed_double_array_map()) { |
9690 maybe_new_map = to->map()->GetFastDoubleElementsMap(); | 9690 maybe_new_map = to->map()->GetFastDoubleElementsMap(); |
9691 } else { | 9691 } else { |
9692 maybe_new_map = to->map()->GetSlowElementsMap(); | 9692 maybe_new_map = to->map()->GetSlowElementsMap(); |
9693 } | 9693 } |
(...skipping 3211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12905 } else { | 12905 } else { |
12906 // Handle last resort GC and make sure to allow future allocations | 12906 // Handle last resort GC and make sure to allow future allocations |
12907 // to grow the heap without causing GCs (if possible). | 12907 // to grow the heap without causing GCs (if possible). |
12908 isolate->counters()->gc_last_resort_from_js()->Increment(); | 12908 isolate->counters()->gc_last_resort_from_js()->Increment(); |
12909 isolate->heap()->CollectAllGarbage(false); | 12909 isolate->heap()->CollectAllGarbage(false); |
12910 } | 12910 } |
12911 } | 12911 } |
12912 | 12912 |
12913 | 12913 |
12914 } } // namespace v8::internal | 12914 } } // namespace v8::internal |
OLD | NEW |