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

Side by Side Diff: src/array.js

Issue 6592007: Port revision 6934 and 6993 (plus fix from 6935) to the 3.0 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.0
Patch Set: Include refactoring of HandleCell. Created 9 years, 9 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 | src/handles.h » ('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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 var m = %_ArgumentsLength(); 419 var m = %_ArgumentsLength();
420 for (var i = 0; i < m; i++) { 420 for (var i = 0; i < m; i++) {
421 this[i+n] = %_Arguments(i); 421 this[i+n] = %_Arguments(i);
422 } 422 }
423 this.length = n + m; 423 this.length = n + m;
424 return this.length; 424 return this.length;
425 } 425 }
426 426
427 427
428 function ArrayConcat(arg1) { // length == 1 428 function ArrayConcat(arg1) { // length == 1
429 // TODO: can we just use arguments?
430 var arg_count = %_ArgumentsLength(); 429 var arg_count = %_ArgumentsLength();
431 var arrays = new $Array(1 + arg_count); 430 var arrays = new $Array(1 + arg_count);
432 arrays[0] = this; 431 arrays[0] = this;
433 for (var i = 0; i < arg_count; i++) { 432 for (var i = 0; i < arg_count; i++) {
434 arrays[i + 1] = %_Arguments(i); 433 arrays[i + 1] = %_Arguments(i);
435 } 434 }
436 435
437 return %ArrayConcat(arrays); 436 return %ArrayConcat(arrays);
438 } 437 }
439 438
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1), 1227 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1),
1229 "reduce", getFunction("reduce", ArrayReduce, 1), 1228 "reduce", getFunction("reduce", ArrayReduce, 1),
1230 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1) 1229 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1)
1231 )); 1230 ));
1232 1231
1233 %FinishArrayPrototypeSetup($Array.prototype); 1232 %FinishArrayPrototypeSetup($Array.prototype);
1234 } 1233 }
1235 1234
1236 1235
1237 SetupArray(); 1236 SetupArray();
OLDNEW
« no previous file with comments | « no previous file | src/handles.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698