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

Unified Diff: test/mjsunit/lithium/DivI.js

Issue 23536045: ARM: Tweak the integer division operation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 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/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/lithium/DivI.js
diff --git a/test/mjsunit/constant-compare-nil-value.js b/test/mjsunit/lithium/DivI.js
similarity index 73%
copy from test/mjsunit/constant-compare-nil-value.js
copy to test/mjsunit/lithium/DivI.js
index 9f5b2adb063abc0c7920d8dee30edb7ee6eb1ff9..5420d8c8d0ab0adc715683fd95f41a34e9373fc0 100644
--- a/test/mjsunit/constant-compare-nil-value.js
+++ b/test/mjsunit/lithium/DivI.js
@@ -25,18 +25,33 @@
// (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
+// Flags: --allow-natives-syntax --no-use-osr
-function inlined() {
- return 1;
+function foo(a, b) {
+ var result = a / 35;
+ result += 50 / b;
+ result += a / b;
+ result += a / -1;
+ result += a / 1;
+ result += a / 4;
+ result += a / -4;
+ return result / b;
}
-function foo() {
- if ((inlined() + 0.5) == null) return "null";
- return "non-null";
+foo(700, 5);
+var r1 = foo(700, 5);
+%OptimizeFunctionOnNextCall(foo);
+var r2 = foo(700, 5);
+
+assertEquals(r1, r2);
+
+function boo(value) {
+ return value / -1;
}
-assertEquals("non-null", foo());
-assertEquals("non-null", foo());
-%OptimizeFunctionOnNextCall(foo);
-assertEquals("non-null", foo());
+// Test deoptimization of MinInt / -1.
+assertEquals(2147483600, boo(-2147483600));
+assertEquals(2147483600, boo(-2147483600));
+%OptimizeFunctionOnNextCall(boo);
+assertEquals(2147483600, boo(-2147483600));
+assertEquals(2147483648, boo(-2147483648));
« no previous file with comments | « src/arm/lithium-codegen-arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698