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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 | 831 |
832 if (item_count < actual_delete_count) { | 832 if (item_count < actual_delete_count) { |
833 // Shrink the array. | 833 // Shrink the array. |
834 const bool trim_array = !heap->lo_space()->Contains(elms) && | 834 const bool trim_array = !heap->lo_space()->Contains(elms) && |
835 ((actual_start + item_count) < | 835 ((actual_start + item_count) < |
836 (len - actual_delete_count - actual_start)); | 836 (len - actual_delete_count - actual_start)); |
837 if (trim_array) { | 837 if (trim_array) { |
838 const int delta = actual_delete_count - item_count; | 838 const int delta = actual_delete_count - item_count; |
839 | 839 |
840 if (actual_start > 0) { | 840 if (actual_start > 0) { |
841 Object** start = elms->data_start(); | 841 AssertNoAllocation no_gc; |
842 memmove(start + delta, start, actual_start * kPointerSize); | 842 MoveElements(heap, &no_gc, elms, delta, elms, 0, actual_start); |
843 } | 843 } |
844 | 844 |
845 elms = LeftTrimFixedArray(heap, elms, delta); | 845 elms = LeftTrimFixedArray(heap, elms, delta); |
846 array->set_elements(elms, SKIP_WRITE_BARRIER); | 846 array->set_elements(elms, SKIP_WRITE_BARRIER); |
847 } else { | 847 } else { |
848 AssertNoAllocation no_gc; | 848 AssertNoAllocation no_gc; |
849 MoveElements(heap, &no_gc, | 849 MoveElements(heap, &no_gc, |
850 elms, actual_start + item_count, | 850 elms, actual_start + item_count, |
851 elms, actual_start + actual_delete_count, | 851 elms, actual_start + actual_delete_count, |
852 (len - actual_delete_count - actual_start)); | 852 (len - actual_delete_count - actual_start)); |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1699 return Handle<Code>(code_address); \ | 1699 return Handle<Code>(code_address); \ |
1700 } | 1700 } |
1701 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) | 1701 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) |
1702 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) | 1702 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) |
1703 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 1703 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
1704 #undef DEFINE_BUILTIN_ACCESSOR_C | 1704 #undef DEFINE_BUILTIN_ACCESSOR_C |
1705 #undef DEFINE_BUILTIN_ACCESSOR_A | 1705 #undef DEFINE_BUILTIN_ACCESSOR_A |
1706 | 1706 |
1707 | 1707 |
1708 } } // namespace v8::internal | 1708 } } // namespace v8::internal |
OLD | NEW |