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

Side by Side Diff: test/mjsunit/compiler/countoperation.js

Issue 6529055: [Isolates] Merge crankshaft (r5922 from bleeding_edge). (Closed)
Patch Set: Win32 port Created 9 years, 10 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
« no previous file with comments | « test/mjsunit/compiler/count-deopt.js ('k') | test/mjsunit/compiler/delete.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 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 assertEquals(1, a++ && 1); 102 assertEquals(1, a++ && 1);
103 assertEquals(44, a); 103 assertEquals(44, a);
104 assertEquals(1, ++b.x && 1); 104 assertEquals(1, ++b.x && 1);
105 assertEquals(43, b.x); 105 assertEquals(43, b.x);
106 assertEquals(1, (b.x++) && 1); 106 assertEquals(1, (b.x++) && 1);
107 assertEquals(44, b.x); 107 assertEquals(44, b.x);
108 assertEquals(1, ++b[c] && 1); 108 assertEquals(1, ++b[c] && 1);
109 assertEquals(45, b[c]); 109 assertEquals(45, b[c]);
110 assertEquals(1, b[c]++ && 1); 110 assertEquals(1, b[c]++ && 1);
111 assertEquals(46, b[c]); 111 assertEquals(46, b[c]);
112
113 // Test count operations with parameters.
114 function f(x) { x++; return x; }
115 assertEquals(43, f(42));
116
117 function g(x) { ++x; return x; }
118 assertEquals(43, g(42));
119
120 function h(x) { var y = x++; return y; }
121 assertEquals(42, h(42));
122
123 function k(x) { var y = ++x; return y; }
124 assertEquals(43, k(42));
125
126 // Test count operation in a test context.
127 function countTestPost(i) { var k = 0; while (i--) { k++; } return k; }
128 assertEquals(10, countTestPost(10));
129
130 function countTestPre(i) { var k = 0; while (--i) { k++; } return k; }
131 assertEquals(9, countTestPre(10));
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/count-deopt.js ('k') | test/mjsunit/compiler/delete.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698