Index: test/mjsunit/regress/regress-crbug-260345.js |
diff --git a/test/mjsunit/regress/regress-int32-truncation.js b/test/mjsunit/regress/regress-crbug-260345.js |
similarity index 71% |
copy from test/mjsunit/regress/regress-int32-truncation.js |
copy to test/mjsunit/regress/regress-crbug-260345.js |
index dec4ac1195a6c4928d84eac8cc8dc9496bf66600..75832ab4beb9e004dda914ffc2e23647f57ef979 100644 |
--- a/test/mjsunit/regress/regress-int32-truncation.js |
+++ b/test/mjsunit/regress/regress-crbug-260345.js |
@@ -25,37 +25,35 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// Flags: --allow-natives-syntax |
+var steps = 100000; |
+var undefined_values = [undefined, "go on"]; |
+var null_values = [null, "go on"]; |
-function f(i, b) { |
- var a = 0; |
- if (b) { |
- var c = 1 << i; |
- a = c + c; |
+function get_undefined_object(i) { |
+ return undefined_values[(i / steps) | 0]; |
+} |
+ |
+function test_undefined() { |
+ var objects = 0; |
+ for (var i = 0; i < 2 * steps; i++) { |
+ undefined == get_undefined_object(i) && objects++; |
} |
- var x = a >> 3; |
- return a; |
+ return objects; |
} |
-f(1, false); |
-f(1, true); |
-%OptimizeFunctionOnNextCall(f); |
-assertEquals((1 << 30) * 2, f(30, true)); |
+assertEquals(steps, test_undefined()); |
-var global = 1; |
+function get_null_object(i) { |
+ return null_values[(i / steps) | 0]; |
+} |
-function f2(b) { |
- var a = 0; |
- if (b) { |
- a = global; |
+function test_null() { |
+ var objects = 0; |
+ for (var i = 0; i < 2 * steps; i++) { |
+ null == get_null_object(i) && objects++; |
} |
- var x = a >> 3; |
- return a; |
+ return objects; |
} |
-f2(false); |
-f2(true); |
-%OptimizeFunctionOnNextCall(f2); |
-global = 2.5; |
-assertEquals(global, f2(true)); |
+assertEquals(steps, test_null()); |