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

Side by Side Diff: src/array.js

Issue 11175007: Always invoke the default Array.sort functions from builtin functions, part 2. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-builtin-array-op.js » ('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 // 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } else { 55 } else {
56 // The case where key is undefined also ends here. 56 // The case where key is undefined also ends here.
57 if (!IS_UNDEFINED(key)) { 57 if (!IS_UNDEFINED(key)) {
58 var e = array[key]; 58 var e = array[key];
59 if (!IS_UNDEFINED(e) || key in array) { 59 if (!IS_UNDEFINED(e) || key in array) {
60 keys.push(key); 60 keys.push(key);
61 } 61 }
62 } 62 }
63 } 63 }
64 } 64 }
65 ArraySort.call(keys, function(a, b) { return a - b; }); 65 %_CallFunction(keys, function(a, b) { return a - b; }, ArraySort);
66 return keys; 66 return keys;
67 } 67 }
68 68
69 69
70 function SparseJoinWithSeparator(array, len, convert, separator) { 70 function SparseJoinWithSeparator(array, len, convert, separator) {
71 var keys = GetSortedArrayKeys(array, %GetArrayKeys(array, len)); 71 var keys = GetSortedArrayKeys(array, %GetArrayKeys(array, len));
72 var totalLength = 0; 72 var totalLength = 0;
73 var elements = new InternalArray(keys.length * 2); 73 var elements = new InternalArray(keys.length * 2);
74 var previousKey = -1; 74 var previousKey = -1;
75 for (var i = 0; i < keys.length; i++) { 75 for (var i = 0; i < keys.length; i++) {
(...skipping 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 // exposed to user code. 1549 // exposed to user code.
1550 // Adding only the functions that are actually used. 1550 // Adding only the functions that are actually used.
1551 SetUpLockedPrototype(InternalArray, $Array(), $Array( 1551 SetUpLockedPrototype(InternalArray, $Array(), $Array(
1552 "join", getFunction("join", ArrayJoin), 1552 "join", getFunction("join", ArrayJoin),
1553 "pop", getFunction("pop", ArrayPop), 1553 "pop", getFunction("pop", ArrayPop),
1554 "push", getFunction("push", ArrayPush) 1554 "push", getFunction("push", ArrayPush)
1555 )); 1555 ));
1556 } 1556 }
1557 1557
1558 SetUpArray(); 1558 SetUpArray();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-builtin-array-op.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698