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

Unified Diff: test/mjsunit/compiler/regress-633497.js

Issue 2251833002: [turbofan] Only do value numbering when types are compatible. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/value-numbering-reducer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/regress-633497.js
diff --git a/test/mjsunit/compiler/regress-628403.js b/test/mjsunit/compiler/regress-633497.js
similarity index 50%
copy from test/mjsunit/compiler/regress-628403.js
copy to test/mjsunit/compiler/regress-633497.js
index 4096ac32aee4692487618fc53f6b7bcf703a9098..8bf358af00a5dbfc03ab8f3a11f2170b174d3d4b 100644
--- a/test/mjsunit/compiler/regress-628403.js
+++ b/test/mjsunit/compiler/regress-633497.js
@@ -4,24 +4,26 @@
// Flags: --allow-natives-syntax
-var dothrow = false;
-
-function g() {
- if (dothrow) throw 1;
-}
-
function f(a) {
- try {
- g();
- } catch(e) {
- if (typeof e !== 'number' && e !== 1) throw e;
- return a[0];
+ var x;
+ a = a|0;
+ var dummy;
+ if (a === 1) {
+ x = 277.5;
+ } else if (a === 2) {
+ x = 0;
+ } else {
+ dummy = 527.5;
ahaas 2016/08/18 06:57:07 Could we add a comment which describes the purpose
+ dummy = 958.5;
+ dummy = 1143.5;
+ dummy = 1368.5;
+ dummy = 1558.5;
+ x = 277.5;
}
+ return +x;
}
-%NeverOptimizeFunction(g);
f();
f();
%OptimizeFunctionOnNextCall(f);
-dothrow = true;
-assertEquals(42, f([42]));
+assertEquals(277.5, f());
« no previous file with comments | « src/compiler/value-numbering-reducer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698