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

Unified Diff: test/mjsunit/regress/regress-2499.js

Issue 12047015: Fix pattern detection for replacing shifts by rotation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 11 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/hydrogen.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-2499.js
diff --git a/test/mjsunit/regress/regress-110509.js b/test/mjsunit/regress/regress-2499.js
similarity index 85%
copy from test/mjsunit/regress/regress-110509.js
copy to test/mjsunit/regress/regress-2499.js
index 132bd233bee32f6c84061049224ea43901dae06a..52aad874db6fcdc89f5ee1ae4db45304e64b0e77 100644
--- a/test/mjsunit/regress/regress-110509.js
+++ b/test/mjsunit/regress/regress-2499.js
@@ -1,4 +1,4 @@
-// Copyright 2012 the V8 project authors. All rights reserved.
+// Copyright 2013 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -27,15 +27,14 @@
// Flags: --allow-natives-syntax
-// Verify that LRandom preserves rsi correctly.
-
-function foo() {
- Math.random();
- new Function("");
+function foo(word, nBits) {
+ return (word[1] >>> nBits) | (word[0] << (32 - nBits));
}
-foo();
-foo();
-foo();
+word = [0x1001, 0];
+
+var expected = foo(word, 1);
+foo(word, 1);
%OptimizeFunctionOnNextCall(foo);
-foo();
+var optimized = foo(word, 1);
+assertEquals(expected, optimized)
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698