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

Unified Diff: test/mjsunit/regress/regress-crbug-260345.js

Issue 19460006: Merged r15723, r15724, r15725, r15728 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698