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

Unified Diff: test/mjsunit/regress/regress-319722-TypedArrays.js

Issue 73943004: Limit the size for typed arrays to MaxSmi. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix for message and reduced memory reqs in test 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/regress/regress-319722-ArrayBuffer.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-319722-TypedArrays.js
diff --git a/test/cctest/test-cpu-ia32.cc b/test/mjsunit/regress/regress-319722-TypedArrays.js
similarity index 80%
copy from test/cctest/test-cpu-ia32.cc
copy to test/mjsunit/regress/regress-319722-TypedArrays.js
index 245450bf92b595e417a53edff09a5849d74dd135..0445e2d2cf0dd4a5494b42daa50381d905c73e07 100644
--- a/test/cctest/test-cpu-ia32.cc
+++ b/test/mjsunit/regress/regress-319722-TypedArrays.js
@@ -1,3 +1,4 @@
+
// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
@@ -25,16 +26,20 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "v8.h"
-
-#include "cctest.h"
-#include "cpu.h"
-
-using namespace v8::internal;
-
-
-TEST(RequiredFeaturesX64) {
- // Test for the features required by every x86 CPU in compat/legacy mode.
- CPU cpu;
- CHECK(cpu.has_sahf());
+// Flags: --nostress-opt --allow-natives-syntax
+var maxSize = %MaxSmi() + 1;
+function TestArray(constr) {
+ assertThrows(function() {
+ new constr(maxSize);
+ }, RangeError);
}
+
+TestArray(Uint8Array);
+TestArray(Int8Array);
+TestArray(Uint16Array);
+TestArray(Int16Array);
+TestArray(Uint32Array);
+TestArray(Int32Array);
+TestArray(Float32Array);
+TestArray(Float64Array);
+TestArray(Uint8ClampedArray);
« no previous file with comments | « test/mjsunit/regress/regress-319722-ArrayBuffer.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698