Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: src/js/array.js

Issue 1932163002: Reland of move more dead code after Object.observe removal (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: don't throw on error Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/isolate-inl.h ('k') | src/js/macros.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after
1017 // The specification allows "implementation dependent" behavior 1017 // The specification allows "implementation dependent" behavior
1018 // if an element on the prototype chain has an element that 1018 // if an element on the prototype chain has an element that
1019 // might interact with sorting. 1019 // might interact with sorting.
1020 max_prototype_element = CopyFromPrototype(array, length); 1020 max_prototype_element = CopyFromPrototype(array, length);
1021 } 1021 }
1022 1022
1023 // %RemoveArrayHoles returns -1 if fast removal is not supported. 1023 // %RemoveArrayHoles returns -1 if fast removal is not supported.
1024 var num_non_undefined = %RemoveArrayHoles(array, length); 1024 var num_non_undefined = %RemoveArrayHoles(array, length);
1025 1025
1026 if (num_non_undefined == -1) { 1026 if (num_non_undefined == -1) {
1027 // The array is observed, or there were indexed accessors in the array. 1027 // There were indexed accessors in the array.
1028 // Move array holes and undefineds to the end using a Javascript function 1028 // Move array holes and undefineds to the end using a Javascript function
1029 // that is safe in the presence of accessors and is observable. 1029 // that is safe in the presence of accessors.
1030 num_non_undefined = SafeRemoveArrayHoles(array); 1030 num_non_undefined = SafeRemoveArrayHoles(array);
1031 } 1031 }
1032 1032
1033 QuickSort(array, 0, num_non_undefined); 1033 QuickSort(array, 0, num_non_undefined);
1034 1034
1035 if (!is_array && (num_non_undefined + 1 < max_prototype_element)) { 1035 if (!is_array && (num_non_undefined + 1 < max_prototype_element)) {
1036 // For compatibility with JSC, we shadow any elements in the prototype 1036 // For compatibility with JSC, we shadow any elements in the prototype
1037 // chain that has become exposed by sort moving a hole to its position. 1037 // chain that has become exposed by sort moving a hole to its position.
1038 ShadowPrototypeElements(array, num_non_undefined, max_prototype_element); 1038 ShadowPrototypeElements(array, num_non_undefined, max_prototype_element);
1039 } 1039 }
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1794 %InstallToContext([ 1794 %InstallToContext([
1795 "array_pop", ArrayPop, 1795 "array_pop", ArrayPop,
1796 "array_push", ArrayPush, 1796 "array_push", ArrayPush,
1797 "array_shift", ArrayShift, 1797 "array_shift", ArrayShift,
1798 "array_splice", ArraySplice, 1798 "array_splice", ArraySplice,
1799 "array_slice", ArraySlice, 1799 "array_slice", ArraySlice,
1800 "array_unshift", ArrayUnshift, 1800 "array_unshift", ArrayUnshift,
1801 ]); 1801 ]);
1802 1802
1803 }); 1803 });
OLDNEW
« no previous file with comments | « src/isolate-inl.h ('k') | src/js/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698