Index: test/mjsunit/regress/regress-1167.js |
diff --git a/test/mjsunit/regress/regress-1167.js b/test/mjsunit/regress/regress-1167.js |
index ea37ba0c6337ec8ec8a4c347e62cc224881c25ec..8437d83bcc4f4594c59543eec4321fdf02daebf3 100644 |
--- a/test/mjsunit/regress/regress-1167.js |
+++ b/test/mjsunit/regress/regress-1167.js |
@@ -27,7 +27,7 @@ |
// Deoptimization after a logical not in an effect context should not see a |
// value for the logical not expression. |
-function test(n) { |
+function test0(n) { |
var a = new Array(n); |
for (var i = 0; i < n; ++i) { |
// ~ of a non-numeric value is used to trigger deoptimization. |
@@ -38,6 +38,35 @@ function test(n) { |
// OSR (after deoptimization) is used to observe the stack height mismatch. |
for (var i = 0; i < 5; ++i) { |
for (var j = 1; j < 12; ++j) { |
- test(j * 1000); |
+ test0(j * 1000); |
} |
} |
+ |
+ |
+// Similar test with a different subexpression of unary !. |
+function test1(n) { |
+ var a = new Array(n); |
+ for (var i = 0; i < n; ++i) { |
+ a[i] = void(!(- 'object')) % ~(delete 4); |
+ } |
+} |
+ |
+for (i = 0; i < 5; ++i) { |
+ for (j = 1; j < 12; ++j) { |
+ test1(j * 1000); |
+ } |
+} |
+ |
+ |
+// A similar issue, different subexpression of unary ! (e0 !== e1 is |
+// translated into !(e0 == e1)) and different effect context. |
+function side_effect() { } |
+function observe(x, y) { return x; } |
+function test2(x) { |
+ return observe(this, |
+ (((side_effect.observe <= side_effect.side_effect) !== false), |
+ x + 1)); |
+} |
+ |
+for (var i = 0; i < 1000000; ++i) test2(0); |
+test2(test2); |