Backed out changeset b12fe0ea05d6 (bug 1275306) for likely causing intermittent crashes in 13.3.0_7.js. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 28 May 2016 09:53:26 +0200
changeset 340439 0667549f62c0b41938ec448951e1b476ea7e88f5
parent 340438 8fa26a17137868e2d72a98b294398940855ae8ad
child 340440 d04a27a81ae928cd3535ffb34595ba5d2248a1e8
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1275306
milestone49.0a1
backs outb12fe0ea05d6669181144ad17652cc0d92a81de8
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset b12fe0ea05d6 (bug 1275306) for likely causing intermittent crashes in 13.3.0_7.js. r=backout
js/src/shell/js.cpp
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -129,17 +129,17 @@ static const size_t gMaxStackSize = 2 * 
 #else
 static const size_t gMaxStackSize = 128 * sizeof(size_t) * 1024;
 #endif
 
 /*
  * Limit the timeout to 30 minutes to prevent an overflow on platfoms
  * that represent the time internally in microseconds using 32-bit int.
  */
-static const TimeDuration MAX_TIMEOUT_INTERVAL = TimeDuration::FromSeconds(1800.0);
+static const double MAX_TIMEOUT_INTERVAL = 1800.0;  // seconds
 
 #ifdef NIGHTLY_BUILD
 # define SHARED_MEMORY_DEFAULT 1
 #else
 # define SHARED_MEMORY_DEFAULT 0
 #endif
 
 #ifdef SPIDERMONKEY_PROMISE
@@ -3101,23 +3101,23 @@ Sleep_fn(JSContext* cx, unsigned argc, V
     ShellRuntime* sr = GetShellRuntime(cx);
     CallArgs args = CallArgsFromVp(argc, vp);
 
     TimeDuration duration = TimeDuration::FromSeconds(0.0);
     if (args.length() > 0) {
         double t_secs;
         if (!ToNumber(cx, args[0], &t_secs))
             return false;
-        duration = TimeDuration::FromSeconds(Max(0.0, t_secs));
 
         /* NB: The next condition also filter out NaNs. */
-        if (duration > MAX_TIMEOUT_INTERVAL) {
+        if (!(t_secs <= MAX_TIMEOUT_INTERVAL)) {
             JS_ReportError(cx, "Excessive sleep interval");
             return false;
         }
+        duration = TimeDuration::FromSeconds(Max(0.0, t_secs));
     }
     PR_Lock(sr->watchdogLock);
     TimeStamp toWakeup = TimeStamp::Now() + duration;
     for (;;) {
         PR_WaitCondVar(sr->sleepWakeup, DurationToPRInterval(duration));
         if (sr->serviceInterrupt)
             break;
         auto now = TimeStamp::Now();
@@ -3293,17 +3293,17 @@ CancelExecution(JSRuntime* rt)
         fputs(msg, stderr);
     }
 }
 
 static bool
 SetTimeoutValue(JSContext* cx, double t)
 {
     /* NB: The next condition also filter out NaNs. */
-    if (TimeDuration::FromSeconds(t) > MAX_TIMEOUT_INTERVAL) {
+    if (!(t <= MAX_TIMEOUT_INTERVAL)) {
         JS_ReportError(cx, "Excessive timeout value");
         return false;
     }
     GetShellRuntime(cx)->timeoutInterval = t;
     if (!ScheduleWatchdog(cx->runtime(), t)) {
         JS_ReportError(cx, "Failed to create the watchdog");
         return false;
     }