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

Side by Side Diff: test/mjsunit/assert-opt-and-deopt.js

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « test/mjsunit/array-sort.js ('k') | test/mjsunit/boolean.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 } 141 }
142 142
143 var tracker = new OptTracker(); 143 var tracker = new OptTracker();
144 tracker.CheckpointOptCount(f); 144 tracker.CheckpointOptCount(f);
145 145
146 tracker.AssertOptCount(f, 0); 146 tracker.AssertOptCount(f, 0);
147 tracker.AssertIsOptimized(f, false); 147 tracker.AssertIsOptimized(f, false);
148 tracker.AssertDeoptHappened(f, false); 148 tracker.AssertDeoptHappened(f, false);
149 tracker.AssertDeoptCount(f, 0); 149 tracker.AssertDeoptCount(f, 0);
150 150
151 for (var i = 0; i < 5; i++) f(1); 151 for (var i = 0; i < 2; i++) f(1);
152 152
153 %OptimizeFunctionOnNextCall(f); 153 %OptimizeFunctionOnNextCall(f);
154 f(1); 154 f(1);
155 155
156 tracker.AssertOptCount(f, 1); 156 tracker.AssertOptCount(f, 1);
157 tracker.AssertIsOptimized(f, true); 157 tracker.AssertIsOptimized(f, true);
158 tracker.AssertDeoptHappened(f, false); 158 tracker.AssertDeoptHappened(f, false);
159 tracker.AssertDeoptCount(f, 0); 159 tracker.AssertDeoptCount(f, 0);
160 160
161 %DeoptimizeFunction(f); 161 %DeoptimizeFunction(f);
162 162
163 tracker.AssertOptCount(f, 1); 163 tracker.AssertOptCount(f, 1);
164 tracker.AssertIsOptimized(f, false); 164 tracker.AssertIsOptimized(f, false);
165 tracker.AssertDeoptHappened(f, true); 165 tracker.AssertDeoptHappened(f, true);
166 tracker.AssertDeoptCount(f, 1); 166 tracker.AssertDeoptCount(f, 1);
167 167
168 // Let's trigger optimization for another type. 168 // Let's trigger optimization for another type.
169 for (var i = 0; i < 5; i++) f("a"); 169 for (var i = 0; i < 5; i++) f("a");
170 170
171 %OptimizeFunctionOnNextCall(f); 171 %OptimizeFunctionOnNextCall(f);
172 f("b"); 172 f("b");
173 173
174 tracker.AssertOptCount(f, 2); 174 tracker.AssertOptCount(f, 2);
175 tracker.AssertIsOptimized(f, true); 175 tracker.AssertIsOptimized(f, true);
176 tracker.AssertDeoptHappened(f, true); 176 tracker.AssertDeoptHappened(f, true);
177 tracker.AssertDeoptCount(f, 1); 177 tracker.AssertDeoptCount(f, 1);
OLDNEW
« no previous file with comments | « test/mjsunit/array-sort.js ('k') | test/mjsunit/boolean.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698