Revision: 15951
Author:   [email protected]
Date:     Tue Jul 30 02:28:55 2013
Log: Fix many tests that try to force an OSR by checking OptimizationStatus() to instead check OptimizationCount().

BUG=
[email protected]

Review URL: https://codereview.chromium.org/21221003
http://code.google.com/p/v8/source/detail?r=15951

Modified:
 /branches/bleeding_edge/test/mjsunit/array-literal-transitions.js
 /branches/bleeding_edge/test/mjsunit/count-based-osr.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-2618.js
 /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-150545.js

=======================================
--- /branches/bleeding_edge/test/mjsunit/array-literal-transitions.js Mon Jul 22 02:16:33 2013 +++ /branches/bleeding_edge/test/mjsunit/array-literal-transitions.js Tue Jul 30 02:28:55 2013
@@ -205,7 +205,9 @@

 (function literals_after_osr() {
   var color = [0];
-  // Trigger OSR.
-  while (%GetOptimizationStatus(literals_after_osr, "no sync") == 2) {}
+  // Trigger OSR, if optimization is not disabled.
+  if (%GetOptimizationStatus(literals_after_osr) != 4) {
+    while (%GetOptimizationCount(literals_after_osr) == 0) {}
+  }
   return [color[0]];
 })();
=======================================
--- /branches/bleeding_edge/test/mjsunit/count-based-osr.js Mon Jul 22 02:16:33 2013 +++ /branches/bleeding_edge/test/mjsunit/count-based-osr.js Tue Jul 30 02:28:55 2013
@@ -25,15 +25,15 @@
 // (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: --count-based-interrupts --interrupt-budget=10 --weighted-back-edges
 // Flags: --allow-natives-syntax

// Test that OSR works properly when using count-based interrupting/profiling.

 function osr_this() {
   var a = 1;
-  // Trigger OSR.
-  while (%GetOptimizationStatus(osr_this, "no sync") == 2) {}
+  // Trigger OSR. First check if optimization is disabled.
+  if (%GetOptimizationStatus(osr_this) == 4) return 1;
+  while (%GetOptimizationCount(osr_this) == 0) {}
   return a;
 }
 assertEquals(1, osr_this());
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js Mon Jul 22 02:16:33 2013 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js Tue Jul 30 02:28:55 2013
@@ -52,8 +52,10 @@
     g();
   } else {
     // Run for a bit as long as h is unoptimized.
-    while (%GetOptimizationStatus(h, "no sync") == 2) {
-      for (var j = 0; j < 100; j++) g();
+    if (%GetOptimizationStatus(h) != 4) {
+      while (%GetOptimizationCount(h) == 0) {
+        for (var j = 0; j < 100; j++) g();
+      }
     }
     g();
   }
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-2618.js Mon Jul 22 02:16:33 2013 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-2618.js Tue Jul 30 02:28:55 2013
@@ -38,8 +38,7 @@
 }

 f();
-assertOptimized(f);
-
+assertTrue(%GetOptimizationCount(f) > 0 || %GetOptimizationStatus(f) == 4);

 function g() {
   for (var i = 0; i < 1; i++) { }
@@ -70,4 +69,4 @@
 }

 g();
-assertOptimized(g);
+assertTrue(%GetOptimizationCount(g) > 0 || %GetOptimizationStatus(g) == 4);
=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-150545.js Mon Jul 22 02:16:33 2013 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-150545.js Tue Jul 30 02:28:55 2013
@@ -45,8 +45,10 @@

   function outer() {
     inner(1,2,3);
-    // Trigger OSR.
-    while (%GetOptimizationStatus(outer, "no sync") == 2) {}
+    // Trigger OSR, if optimization is not disabled.
+    if (%GetOptimizationStatus(outer) != 4) {
+      while (%GetOptimizationCount(outer) == 0) {}
+    }
   }

   outer();

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to