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

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

Issue 1648813005: Version 4.9.385.14 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.9
Patch Set: Created 4 years, 10 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 | « include/v8-version.h ('k') | test/mjsunit/es6/typedarray-proto.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 NAMEConstructByArrayLike(this, arg1); 256 NAMEConstructByArrayLike(this, arg1);
257 } else { 257 } else {
258 NAMEConstructByIterable(this, arg1, iteratorFn); 258 NAMEConstructByIterable(this, arg1, iteratorFn);
259 } 259 }
260 } 260 }
261 } else { 261 } else {
262 throw MakeTypeError(kConstructorNotFunction, "NAME") 262 throw MakeTypeError(kConstructorNotFunction, "NAME")
263 } 263 }
264 } 264 }
265 265
266 // TODO(littledan): Remove this performance workaround BUG(chromium:579905)
267 function NAME_GetLength() {
268 if (!(%_ClassOf(this) === 'NAME')) {
269 throw MakeTypeError(kIncompatibleMethodReceiver, "NAME.length", this);
270 }
271 return %_TypedArrayGetLength(this);
272 }
273
266 function NAMESubArray(begin, end) { 274 function NAMESubArray(begin, end) {
267 var beginInt = TO_INTEGER(begin); 275 var beginInt = TO_INTEGER(begin);
268 if (!IS_UNDEFINED(end)) { 276 if (!IS_UNDEFINED(end)) {
269 var endInt = TO_INTEGER(end); 277 var endInt = TO_INTEGER(end);
270 var srcLength = %_TypedArrayGetLength(this); 278 var srcLength = %_TypedArrayGetLength(this);
271 } else { 279 } else {
272 var srcLength = %_TypedArrayGetLength(this); 280 var srcLength = %_TypedArrayGetLength(this);
273 var endInt = srcLength; 281 var endInt = srcLength;
274 } 282 }
275 283
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 %InternalSetPrototype(GlobalNAME.prototype, TypedArray.prototype); 830 %InternalSetPrototype(GlobalNAME.prototype, TypedArray.prototype);
823 831
824 %AddNamedProperty(GlobalNAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE, 832 %AddNamedProperty(GlobalNAME, "BYTES_PER_ELEMENT", ELEMENT_SIZE,
825 READ_ONLY | DONT_ENUM | DONT_DELETE); 833 READ_ONLY | DONT_ENUM | DONT_DELETE);
826 834
827 %AddNamedProperty(GlobalNAME.prototype, 835 %AddNamedProperty(GlobalNAME.prototype,
828 "constructor", global.NAME, DONT_ENUM); 836 "constructor", global.NAME, DONT_ENUM);
829 %AddNamedProperty(GlobalNAME.prototype, 837 %AddNamedProperty(GlobalNAME.prototype,
830 "BYTES_PER_ELEMENT", ELEMENT_SIZE, 838 "BYTES_PER_ELEMENT", ELEMENT_SIZE,
831 READ_ONLY | DONT_ENUM | DONT_DELETE); 839 READ_ONLY | DONT_ENUM | DONT_DELETE);
840 // TODO(littledan): Remove this performance workaround BUG(chromium:579905)
841 utils.InstallGetter(GlobalNAME.prototype, "length", NAME_GetLength,
842 DONT_ENUM | DONT_DELETE);
832 endmacro 843 endmacro
833 844
834 TYPED_ARRAYS(SETUP_TYPED_ARRAY) 845 TYPED_ARRAYS(SETUP_TYPED_ARRAY)
835 846
836 // --------------------------- DataView ----------------------------- 847 // --------------------------- DataView -----------------------------
837 848
838 function DataViewConstructor(buffer, byteOffset, byteLength) { // length = 3 849 function DataViewConstructor(buffer, byteOffset, byteLength) { // length = 3
839 if (IS_UNDEFINED(new.target)) { 850 if (IS_UNDEFINED(new.target)) {
840 throw MakeTypeError(kConstructorNotFunction, "DataView"); 851 throw MakeTypeError(kConstructorNotFunction, "DataView");
841 } 852 }
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 "setUint32", DataViewSetUint32JS, 971 "setUint32", DataViewSetUint32JS,
961 972
962 "getFloat32", DataViewGetFloat32JS, 973 "getFloat32", DataViewGetFloat32JS,
963 "setFloat32", DataViewSetFloat32JS, 974 "setFloat32", DataViewSetFloat32JS,
964 975
965 "getFloat64", DataViewGetFloat64JS, 976 "getFloat64", DataViewGetFloat64JS,
966 "setFloat64", DataViewSetFloat64JS 977 "setFloat64", DataViewSetFloat64JS
967 ]); 978 ]);
968 979
969 }) 980 })
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | test/mjsunit/es6/typedarray-proto.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698