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

Side by Side Diff: test/mjsunit/big-array-literal.js

Issue 155279: X64: Fix bug in left-shift. (Closed)
Patch Set: Created 11 years, 5 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
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 if (array_in_middle) { 74 if (array_in_middle) {
75 assertEquals(42.2, y[0], "y array in middle"); 75 assertEquals(42.2, y[0], "y array in middle");
76 y[0] = 41.2; 76 y[0] = 41.2;
77 } else { 77 } else {
78 assertEquals(42.2, y.a, "y object in middle"); 78 assertEquals(42.2, y.a, "y object in middle");
79 y.a = 41.2; 79 y.a = 41.2;
80 } 80 }
81 } 81 }
82 82
83 // The sizes to test. 83 // The sizes to test.
84 var sizes = [1, 2, 100, 200, 400]; 84 var sizes = [1, 2, 100, 200, 300];
85 85
86 // Run the test. 86 // Run the test.
87 for (var i = 0; i < sizes.length; i++) { 87 for (var i = 0; i < sizes.length; i++) {
88 testLiteral(sizes[i], false); 88 testLiteral(sizes[i], false);
89 testLiteral(sizes[i], true); 89 testLiteral(sizes[i], true);
90 } 90 }
91 91
92 function testLiteralAndCatch(size) { 92 function testLiteralAndCatch(size) {
93 var big_enough = false; 93 var big_enough = false;
94 try { 94 try {
95 testLiteral(size, false); 95 testLiteral(size, false);
96 } catch (e) { 96 } catch (e) {
97 big_enough = true; 97 big_enough = true;
98 } 98 }
99 try { 99 try {
100 testLiteral(size, true); 100 testLiteral(size, true);
101 } catch (e) { 101 } catch (e) {
102 big_enough = true; 102 big_enough = true;
103 } 103 }
104 return big_enough; 104 return big_enough;
105 } 105 }
106 106
107 // Catch stack overflows. 107 // Catch stack overflows.
108 108
109 testLiteralAndCatch(1000) || 109 testLiteralAndCatch(1000) ||
110 testLiteralAndCatch(20000) || 110 testLiteralAndCatch(20000) ||
111 testLiteralAndCatch(200000); 111 testLiteralAndCatch(200000);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698