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

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

Issue 874323003: Externalize deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: arm64 Created 5 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
« src/objects.cc ('K') | « src/x87/lithium-codegen-x87.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 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // Let's trigger optimization for another type. 174 // Let's trigger optimization for another type.
175 for (var i = 0; i < 5; i++) f("a"); 175 for (var i = 0; i < 5; i++) f("a");
176 176
177 %OptimizeFunctionOnNextCall(f); 177 %OptimizeFunctionOnNextCall(f);
178 f("b"); 178 f("b");
179 179
180 tracker.AssertOptCount(f, 2); 180 tracker.AssertOptCount(f, 2);
181 tracker.AssertIsOptimized(f, true); 181 tracker.AssertIsOptimized(f, true);
182 tracker.AssertDeoptHappened(f, true); 182 tracker.AssertDeoptHappened(f, true);
183 tracker.AssertDeoptCount(f, 1); 183 tracker.AssertDeoptCount(f, 1);
184
185
186 function deoptTest() {
187 function k(a) {
188 return a / 10;
189 }
190
191 function f(a) {
192 return k(a);
193 }
194
195 var tracker = new OptTracker();
196 tracker.CheckpointOptCount(f);
197
198 f(10);
199 %OptimizeFunctionOnNextCall(f);
200 f(10);
201
202 tracker.AssertOptCount(f, 1);
203 tracker.AssertIsOptimized(f, true);
204 tracker.AssertDeoptHappened(f, false);
205 tracker.AssertDeoptCount(f, 0);
206
207 try {
208 f('a');
209 } catch(e) {
210 }
211
212 tracker.AssertIsOptimized(f, false);
213 tracker.AssertDeoptHappened(f, true);
214 tracker.AssertDeoptCount(f, 1);
215 }
216
217 deoptTest();
OLDNEW
« src/objects.cc ('K') | « src/x87/lithium-codegen-x87.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698