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

Side by Side Diff: src/typedarray.js

Issue 74093002: Revert "Limit the size for typed arrays to MaxSmi." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month 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 | « src/runtime.cc ('k') | test/mjsunit/regress/regress-319722-ArrayBuffer.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 // 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 if (offset + newByteLength > bufferByteLength) { 81 if (offset + newByteLength > bufferByteLength) {
82 throw MakeRangeError("invalid_typed_array_length"); 82 throw MakeRangeError("invalid_typed_array_length");
83 } 83 }
84 %TypedArrayInitialize(obj, ARRAY_ID, buffer, offset, newByteLength); 84 %TypedArrayInitialize(obj, ARRAY_ID, buffer, offset, newByteLength);
85 } 85 }
86 86
87 function NAMEConstructByLength(obj, length) { 87 function NAMEConstructByLength(obj, length) {
88 var l = IS_UNDEFINED(length) ? 88 var l = IS_UNDEFINED(length) ?
89 0 : ToPositiveInteger(length, "invalid_typed_array_length"); 89 0 : ToPositiveInteger(length, "invalid_typed_array_length");
90 if (l > %MaxSmi()) {
91 throw MakeRangeError(length, "invalid_typed_array_length");
92 }
93 var byteLength = l * ELEMENT_SIZE; 90 var byteLength = l * ELEMENT_SIZE;
94 var buffer = new $ArrayBuffer(byteLength); 91 var buffer = new $ArrayBuffer(byteLength);
95 %TypedArrayInitialize(obj, ARRAY_ID, buffer, 0, byteLength); 92 %TypedArrayInitialize(obj, ARRAY_ID, buffer, 0, byteLength);
96 } 93 }
97 94
98 function NAMEConstructByArrayLike(obj, arrayLike) { 95 function NAMEConstructByArrayLike(obj, arrayLike) {
99 var length = arrayLike.length; 96 var length = arrayLike.length;
100 var l = ToPositiveInteger(length, "invalid_typed_array_length"); 97 var l = ToPositiveInteger(length, "invalid_typed_array_length");
101 if(!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) { 98 if(!%TypedArrayInitializeFromArrayLike(obj, ARRAY_ID, arrayLike, l)) {
102 for (var i = 0; i < l; i++) { 99 for (var i = 0; i < l; i++) {
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 429
433 "getFloat32", DataViewGetFloat32, 430 "getFloat32", DataViewGetFloat32,
434 "setFloat32", DataViewSetFloat32, 431 "setFloat32", DataViewSetFloat32,
435 432
436 "getFloat64", DataViewGetFloat64, 433 "getFloat64", DataViewGetFloat64,
437 "setFloat64", DataViewSetFloat64 434 "setFloat64", DataViewSetFloat64
438 )); 435 ));
439 } 436 }
440 437
441 SetupDataView(); 438 SetupDataView();
OLDNEW
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/regress/regress-319722-ArrayBuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698