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

Side by Side Diff: test/mjsunit/compiler/assignment-deopt.js

Issue 8888006: Make more JS files beter match the coding standard. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address review comments Created 9 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/closures.js ('k') | test/mjsunit/compiler/call-keyed.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 22 matching lines...) Expand all
33 33
34 function assign1(x) { x += 1; o.x = x; } 34 function assign1(x) { x += 1; o.x = x; }
35 assign1(max_smi); 35 assign1(max_smi);
36 assertEquals(max_smi + 1, o.x); 36 assertEquals(max_smi + 1, o.x);
37 37
38 assign1(1.1); 38 assign1(1.1);
39 assertEquals(2.1, o.x); 39 assertEquals(2.1, o.x);
40 40
41 41
42 // Test deopt with count operation on named property. 42 // Test deopt with count operation on named property.
43 function assign2(p) { p.x += 1 } 43 function assign2(p) { p.x += 1; }
44 44
45 o.x = "42"; 45 o.x = "42";
46 assign2(o); 46 assign2(o);
47 assertEquals("421", o.x); 47 assertEquals("421", o.x);
48 48
49 var s = max_smi - 10; 49 var s = max_smi - 10;
50 o.x = s; 50 o.x = s;
51 for(var i = 0; i < 20; i++) { 51 for(var i = 0; i < 20; i++) {
52 assign2(o); 52 assign2(o);
53 if (i == 4) { 53 if (i == 4) {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 %OptimizeFunctionOnNextCall(assign9); 120 %OptimizeFunctionOnNextCall(assign9);
121 q[0] = 42; 121 q[0] = 42;
122 assertEquals(44, assign9(q, 1)); 122 assertEquals(44, assign9(q, 1));
123 123
124 q[0] = 42; 124 q[0] = 42;
125 assertEquals(44.1, assign9(q, 1.1)); 125 assertEquals(44.1, assign9(q, 1.1));
126 q[0] = 42.1; 126 q[0] = 42.1;
127 assertEquals(44.1, assign9(q, 1)); 127 assertEquals(44.1, assign9(q, 1));
128 128
129 // Test deopt because of a failed map check on the load. 129 // Test deopt because of a failed map check on the load.
130 function assign10(p) { return p.x += 1 } 130 function assign10(p) { return p.x += 1; }
131 var g1 = {x:0}; 131 var g1 = {x:0};
132 var g2 = {y:0, x:42}; 132 var g2 = {y:0, x:42};
133 for (var i = 0; i < 5; ++i) { 133 for (var i = 0; i < 5; ++i) {
134 g1.x = 42; 134 g1.x = 42;
135 assertEquals(43, assign10(g1)); 135 assertEquals(43, assign10(g1));
136 assertEquals(43, g1.x); 136 assertEquals(43, g1.x);
137 } 137 }
138 %OptimizeFunctionOnNextCall(assign10); 138 %OptimizeFunctionOnNextCall(assign10);
139 g1.x = 42; 139 g1.x = 42;
140 assertEquals(43, assign10(g1)); 140 assertEquals(43, assign10(g1));
(...skipping 30 matching lines...) Expand all
171 assign12(o); 171 assign12(o);
172 } 172 }
173 %OptimizeFunctionOnNextCall(assign12); 173 %OptimizeFunctionOnNextCall(assign12);
174 o[0] = "a"; 174 o[0] = "a";
175 assign12(o); 175 assign12(o);
176 176
177 assertEquals("a11", assign12(o)); 177 assertEquals("a11", assign12(o));
178 o[0] = g4; 178 o[0] = g4;
179 assertEquals(43, assign12(o)); 179 assertEquals(43, assign12(o));
180 assertEquals("bar", o.y); 180 assertEquals("bar", o.y);
OLDNEW
« no previous file with comments | « test/mjsunit/closures.js ('k') | test/mjsunit/compiler/call-keyed.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698