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

Unified Diff: test/mjsunit/deopt-minus-zero.js

Issue 10937013: Fixed minus zero test (fixes v8:2133). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Removed tab. Created 8 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/ia32/disasm-ia32.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/deopt-minus-zero.js
diff --git a/test/mjsunit/regress/regress-inlining-function-literal-context.js b/test/mjsunit/deopt-minus-zero.js
similarity index 76%
copy from test/mjsunit/regress/regress-inlining-function-literal-context.js
copy to test/mjsunit/deopt-minus-zero.js
index 9b7f7ac76882f09e1cc837373c1bee547c645de3..ee0983127dc3ae10311cf11a88ba40284e366dfe 100644
--- a/test/mjsunit/regress/regress-inlining-function-literal-context.js
+++ b/test/mjsunit/deopt-minus-zero.js
@@ -27,27 +27,30 @@
// Flags: --allow-natives-syntax --expose-gc
-function mkbaz(x) {
- function baz() {
- return function () {
- return [x];
- }
- }
- return baz;
-}
-
-var baz = mkbaz(1);
+/**
+ * The possible optimization states of a function. Must be in sync with the
+ * return values of Runtime_GetOptimizationStatus() in runtime.cc!
+ */
+var OptimizationState = {
+ YES: 1,
+ NO: 2,
+ ALWAYS: 3,
+ NEVER: 4
+};
-function foo() {
- var f = baz();
- return f();
+function mul (a, b) {
+ return a * b;
}
-// Tenure.
-gc();
+mul(-1, -1);
+mul(0x80000001|0, -1);
+mul(0x80000001|0, -1);
+%OptimizeFunctionOnNextCall(mul);
+mul(0, -1);
+%OptimizeFunctionOnNextCall(mul);
+mul(0, -1);
+
+var raw_optimized = %GetOptimizationStatus(mul);
+assertFalse(raw_optimized == OptimizationState.NO);
gc();
-assertArrayEquals([1], foo());
-assertArrayEquals([1], foo());
-%OptimizeFunctionOnNextCall(foo);
-assertArrayEquals([1], foo());
« no previous file with comments | « src/ia32/disasm-ia32.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698