Version 3.25.28 (based on bleeding_edge revision r20289)
Performance and stability improvements on all platforms.
git-svn-id: http://v8.googlecode.com/svn/trunk@20290 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/typedarray.js b/src/typedarray.js
index d13ee61..109d627 100644
--- a/src/typedarray.js
+++ b/src/typedarray.js
@@ -100,8 +100,12 @@
throw MakeRangeError("invalid_typed_array_length");
}
var byteLength = l * ELEMENT_SIZE;
- var buffer = new $ArrayBuffer(byteLength);
- %_TypedArrayInitialize(obj, ARRAY_ID, buffer, 0, byteLength);
+ if (byteLength > %_TypedArrayMaxSizeInHeap()) {
+ var buffer = new $ArrayBuffer(byteLength);
+ %_TypedArrayInitialize(obj, ARRAY_ID, buffer, 0, byteLength);
+ } else {
+ %_TypedArrayInitialize(obj, ARRAY_ID, null, 0, byteLength);
+ }
}
function NAMEConstructByArrayLike(obj, arrayLike) {