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

Side by Side Diff: test/mjsunit/switch.js

Issue 13290: Fixed bug in large switch tables on arm. (Closed)
Patch Set: Addressed review comments Created 12 years 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 | « src/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 261
262 assertEquals("default", f7(0.1), "0-1-switch.double-0.1"); 262 assertEquals("default", f7(0.1), "0-1-switch.double-0.1");
263 assertEquals("0", f7(-0), "0-1-switch.double-neg0"); 263 assertEquals("0", f7(-0), "0-1-switch.double-neg0");
264 assertEquals("MaxSmi", f7((1<<30)-1), "0-1-switch.maxsmi"); 264 assertEquals("MaxSmi", f7((1<<30)-1), "0-1-switch.maxsmi");
265 assertEquals("MinSmi", f7(-(1<<30)), "0-1-switch.minsmi"); 265 assertEquals("MinSmi", f7(-(1<<30)), "0-1-switch.minsmi");
266 assertEquals("default", f7(1<<30), "0-1-switch.maxsmi++"); 266 assertEquals("default", f7(1<<30), "0-1-switch.maxsmi++");
267 assertEquals("default", f7(-(1<<30)-1), "0-1-switch.minsmi--"); 267 assertEquals("default", f7(-(1<<30)-1), "0-1-switch.minsmi--");
268 assertEquals("A", f7((170/16)-(170%16/16)), "0-1-switch.heapnum"); 268 assertEquals("A", f7((170/16)-(170%16/16)), "0-1-switch.heapnum");
269 269
270
271 function makeVeryLong(length) {
272 var res = "function() {\n" +
273 " var res = 0;\n" +
274 " for (var i = 0; i <= " + length + "; i++) {\n" +
275 " switch(i) {\n";
276 for (var i = 0; i < length; i++) {
277 res += " case " + i + ": res += 2; break;\n";
278 }
279 res += " default: res += 1;\n" +
280 " }\n" +
281 " }\n" +
282 " return res;\n" +
283 "}";
284 return eval(res);
285 }
286 var verylong_size = 1000;
287 var verylong = makeVeryLong(verylong_size);
288
289 assertEquals(verylong_size * 2 + 1, verylong());
OLDNEW
« no previous file with comments | « src/macro-assembler-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698