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

Side by Side Diff: test/mjsunit/external-array.js

Issue 22290005: Move ToI conversions to the MacroAssembler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: address review Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « src/v8globals.h ('k') | test/mjsunit/external-array-no-sse2.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 671
672 built_in_array = new Array(1.5, 2, 3, 4, 5, 6); 672 built_in_array = new Array(1.5, 2, 3, 4, 5, 6);
673 assertEquals(1.5, goo(built_in_array, 0)); 673 assertEquals(1.5, goo(built_in_array, 0));
674 assertEquals(1.5, goo(built_in_array, 0)); 674 assertEquals(1.5, goo(built_in_array, 0));
675 %OptimizeFunctionOnNextCall(goo); 675 %OptimizeFunctionOnNextCall(goo);
676 %OptimizeFunctionOnNextCall(boo); 676 %OptimizeFunctionOnNextCall(boo);
677 boo(built_in_array, 0, 2.5); 677 boo(built_in_array, 0, 2.5);
678 assertEquals(2.5, goo(built_in_array, 0)); 678 assertEquals(2.5, goo(built_in_array, 0));
679 %ClearFunctionTypeFeedback(goo); 679 %ClearFunctionTypeFeedback(goo);
680 %ClearFunctionTypeFeedback(boo); 680 %ClearFunctionTypeFeedback(boo);
681
682 // Check all int range edge cases
683 function checkRange() {
684 var e32 = Math.pow(2,32); var e31 = Math.pow(2,31);
685 var e16 = Math.pow(2,16); var e15 = Math.pow(2,15);
686 var e8 = Math.pow(2,8); var e7 = Math.pow(2,7);
687 var a7 = new Uint32Array(2); var a71 = new Int32Array(2);
688 var a72 = new Uint16Array(2); var a73 = new Int16Array(2);
689 var a74 = new Uint8Array(2); var a75 = new Int8Array(2);
690 for (i = 1; i <= Math.pow(2,33); i *= 2) {
691 var j = i-1;
692 a7[0] = i; a71[0] = i; a72[0] = i; a73[0] = i; a74[0] = i; a75[0] = i;
693 a7[1] = j; a71[1] = j; a72[1] = j; a73[1] = j; a74[1] = j; a75[1] = j;
694
695 if (i < e32) { assertEquals(a7[0], i); } else { assertEquals(a7[0], 0); }
696 if (j < e32) { assertEquals(a7[1], j); } else { assertEquals(a7[1],e32-1); }
697 if (i < e31) { assertEquals(a71[0], i); } else {
698 assertEquals(a71[0], (i < e32) ? -e31 : 0 ); }
699 if (j < e31) { assertEquals(a71[1], j); } else { assertEquals(a71[1], -1); }
700
701 if (i < e16) { assertEquals(a72[0], i); } else { assertEquals(a72[0], 0); }
702 if (j < e16) { assertEquals(a72[1], j); } else { assertEquals(a72[1], e16-1) ; }
703 if (i < e15) { assertEquals(a73[0], i); } else {
704 assertEquals(a73[0], (i < e16) ? -e15 : 0 ); }
705 if (j < e15) { assertEquals(a73[1], j); } else { assertEquals(a73[1], -1); }
706
707 if (i < e8) { assertEquals(a74[0], i); } else { assertEquals(a74[0], 0); }
708 if (j < e8) { assertEquals(a74[1], j); } else { assertEquals(a74[1], e8-1); }
709 if (i < e7) { assertEquals(a75[0], i); } else {
710 assertEquals(a75[0], (i < e8) ? -e7 : 0); }
711 if (j < e7) { assertEquals(a75[1], j); } else { assertEquals(a75[1], -1); }
712 }
713 }
714 checkRange();
OLDNEW
« no previous file with comments | « src/v8globals.h ('k') | test/mjsunit/external-array-no-sse2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698