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

Side by Side Diff: src/harmony-typedarray.js

Issue 1325573004: [runtime] Replace many buggy uses of %_CallFunction with %_Call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years, 3 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/harmony-array.js ('k') | src/hydrogen.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (!%_IsTypedArray(this)) throw MakeTypeError(kNotTypedArray); 270 if (!%_IsTypedArray(this)) throw MakeTypeError(kNotTypedArray);
271 271
272 var length = %_TypedArrayGetLength(this); 272 var length = %_TypedArrayGetLength(this);
273 273
274 return InnerArrayToLocaleString(this, length); 274 return InnerArrayToLocaleString(this, length);
275 } 275 }
276 276
277 277
278 // ES6 section 22.2.3.28 278 // ES6 section 22.2.3.28
279 function TypedArrayToString() { 279 function TypedArrayToString() {
280 return %_CallFunction(this, ArrayToString); 280 return %_Call(ArrayToString, this);
281 } 281 }
282 282
283 283
284 // ES6 section 22.2.3.14 284 // ES6 section 22.2.3.14
285 function TypedArrayJoin(separator) { 285 function TypedArrayJoin(separator) {
286 if (!%_IsTypedArray(this)) throw MakeTypeError(kNotTypedArray); 286 if (!%_IsTypedArray(this)) throw MakeTypeError(kNotTypedArray);
287 287
288 var length = %_TypedArrayGetLength(this); 288 var length = %_TypedArrayGetLength(this);
289 289
290 return InnerArrayJoin(separator, this, length); 290 return InnerArrayJoin(separator, this, length);
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 for (var i = 0; i < length; i++) { 365 for (var i = 0; i < length; i++) {
366 array[i] = %_Arguments(i); 366 array[i] = %_Arguments(i);
367 } 367 }
368 return array; 368 return array;
369 } 369 }
370 370
371 371
372 function TypedArrayFrom(source, mapfn, thisArg) { 372 function TypedArrayFrom(source, mapfn, thisArg) {
373 // TODO(littledan): Investigate if there is a receiver which could be 373 // TODO(littledan): Investigate if there is a receiver which could be
374 // faster to accumulate on than Array, e.g., a TypedVector. 374 // faster to accumulate on than Array, e.g., a TypedVector.
375 var array = %_CallFunction(GlobalArray, source, mapfn, thisArg, ArrayFrom); 375 var array = %_Call(ArrayFrom, GlobalArray, source, mapfn, thisArg);
376 return ConstructTypedArray(this, array); 376 return ConstructTypedArray(this, array);
377 } 377 }
378 %FunctionSetLength(TypedArrayFrom, 1); 378 %FunctionSetLength(TypedArrayFrom, 1);
379 379
380 // TODO(littledan): Fix the TypedArray proto chain (bug v8:4085). 380 // TODO(littledan): Fix the TypedArray proto chain (bug v8:4085).
381 macro EXTEND_TYPED_ARRAY(NAME) 381 macro EXTEND_TYPED_ARRAY(NAME)
382 // Set up non-enumerable functions on the object. 382 // Set up non-enumerable functions on the object.
383 utils.InstallFunctions(GlobalNAME, DONT_ENUM | DONT_DELETE | READ_ONLY, [ 383 utils.InstallFunctions(GlobalNAME, DONT_ENUM | DONT_DELETE | READ_ONLY, [
384 "from", TypedArrayFrom, 384 "from", TypedArrayFrom,
385 "of", TypedArrayOf 385 "of", TypedArrayOf
(...skipping 19 matching lines...) Expand all
405 "some", TypedArraySome, 405 "some", TypedArraySome,
406 "sort", TypedArraySort, 406 "sort", TypedArraySort,
407 "toString", TypedArrayToString, 407 "toString", TypedArrayToString,
408 "toLocaleString", TypedArrayToLocaleString 408 "toLocaleString", TypedArrayToLocaleString
409 ]); 409 ]);
410 endmacro 410 endmacro
411 411
412 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) 412 TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
413 413
414 }) 414 })
OLDNEW
« no previous file with comments | « src/harmony-array.js ('k') | src/hydrogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698