Revision: 7843
Author:   [email protected]
Date:     Tue May 10 08:07:30 2011
Log:      Fix timeout of test regress-1118.js

TEST=mjsunit/regress/regress-1118.js no longer times out when run in the ARM simulator.

Review URL: http://codereview.chromium.org/6994010
http://code.google.com/p/v8/source/detail?r=7843

Modified:
 /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js

=======================================
--- /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js Wed Feb 9 03:45:50 2011 +++ /branches/bleeding_edge/test/mjsunit/regress/regress-1118.js Tue May 10 08:07:30 2011
@@ -25,6 +25,8 @@
 // (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
+
// An exception thrown in a function optimized by on-stack replacement (OSR)
 // should be able to construct a receiver from all optimized stack frames.

@@ -38,11 +40,25 @@
 // This function throws if o does not have an f property, and should not be
 // inlined.
 function g() { try { return o.f(); } finally { }}
+
+// Optimization status (see runtime.cc):
+// 1 - yes, 2 - no, 3 - always, 4 - never.

 // This function should be optimized via OSR.
 function h() {
-  while(false) ;
-  for (var j = 0; j < 5000000; j++) g();
+  var optstatus = %GetOptimizationStatus(h);
+  if (optstatus == 4) {
+    // Optimizations are globally disabled; just run once.
+    g();
+  } else {
+    // Run for a bit as long as h is unoptimized.
+    while (%GetOptimizationStatus(h) == 2) {
+      for (var j = 0; j < 100; j++) g();
+    }
+    assertTrue(%GetOptimizationStatus(h) == 1 ||
+               %GetOptimizationStatus(h) == 3);
+    g();
+  }
 }

 h();

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to