Bug 1533733: Delete obsolete workaround r=mgaudet
authorIain Ireland <iireland@mozilla.com>
Fri, 08 Mar 2019 15:28:40 +0000
changeset 521155 535960a95139
parent 521154 ed3b55f9d326
child 521156 5833aea8a83b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1533733
milestone67.0a1
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
Bug 1533733: Delete obsolete workaround r=mgaudet Differential Revision: https://phabricator.services.mozilla.com/D22705
js/src/vm/JSContext.cpp
js/src/vm/JSContext.h
--- a/js/src/vm/JSContext.cpp
+++ b/js/src/vm/JSContext.cpp
@@ -1273,17 +1273,16 @@ JSContext::JSContext(JSRuntime* runtime,
       reportGranularity(JS_DEFAULT_JITREPORT_GRANULARITY),
       resolvingList(nullptr),
 #ifdef DEBUG
       enteredPolicy(nullptr),
 #endif
       generatingError(false),
       cycleDetectorVector_(this),
       data(nullptr),
-      jitIsBroken(false),
       asyncCauseForNewActivations(nullptr),
       asyncCallIsExplicit(false),
       interruptCallbackDisabled(false),
       interruptBits_(0),
       osrTempData_(nullptr),
       ionReturnOverride_(MagicValue(JS_ARG_POISON)),
       jitStackLimit(UINTPTR_MAX),
       jitStackLimitNoInterrupt(UINTPTR_MAX),
@@ -1375,84 +1374,16 @@ bool JSContext::isClosingGenerator() {
 
 bool JSContext::isThrowingDebuggeeWouldRun() {
   return throwing && unwrappedException().isObject() &&
          unwrappedException().toObject().is<ErrorObject>() &&
          unwrappedException().toObject().as<ErrorObject>().type() ==
              JSEXN_DEBUGGEEWOULDRUN;
 }
 
-static bool ComputeIsJITBroken() {
-#if !defined(ANDROID)
-  return false;
-#else   // ANDROID
-  if (getenv("JS_IGNORE_JIT_BROKENNESS")) {
-    return false;
-  }
-
-  std::string line;
-
-  // Check for the known-bad kernel version (2.6.29).
-  std::ifstream osrelease("/proc/sys/kernel/osrelease");
-  std::getline(osrelease, line);
-  __android_log_print(ANDROID_LOG_INFO, "Gecko", "Detected osrelease `%s'",
-                      line.c_str());
-
-  if (line.npos == line.find("2.6.29")) {
-    // We're using something other than 2.6.29, so the JITs should work.
-    __android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are not broken");
-    return false;
-  }
-
-  // We're using 2.6.29, and this causes trouble with the JITs on i9000.
-  line = "";
-  bool broken = false;
-  std::ifstream cpuinfo("/proc/cpuinfo");
-  do {
-    if (0 == line.find("Hardware")) {
-      static const char* const blacklist[] = {
-          "SCH-I400",  // Samsung Continuum
-          "SGH-T959",  // Samsung i9000, Vibrant device
-          "SGH-I897",  // Samsung i9000, Captivate device
-          "SCH-I500",  // Samsung i9000, Fascinate device
-          "SPH-D700",  // Samsung i9000, Epic device
-          "GT-I9000",  // Samsung i9000, UK/Europe device
-          nullptr};
-      for (const char* const* hw = &blacklist[0]; *hw; ++hw) {
-        if (line.npos != line.find(*hw)) {
-          __android_log_print(ANDROID_LOG_INFO, "Gecko",
-                              "Blacklisted device `%s'", *hw);
-          broken = true;
-          break;
-        }
-      }
-      break;
-    }
-    std::getline(cpuinfo, line);
-  } while (!cpuinfo.fail() && !cpuinfo.eof());
-
-  __android_log_print(ANDROID_LOG_INFO, "Gecko", "JITs are %sbroken",
-                      broken ? "" : "not ");
-
-  return broken;
-#endif  // ifndef ANDROID
-}
-
-static bool IsJITBrokenHere() {
-  static bool computedIsBroken = false;
-  static bool isBroken = false;
-  if (!computedIsBroken) {
-    isBroken = ComputeIsJITBroken();
-    computedIsBroken = true;
-  }
-  return isBroken;
-}
-
-void JSContext::updateJITEnabled() { jitIsBroken = IsJITBrokenHere(); }
-
 size_t JSContext::sizeOfExcludingThis(
     mozilla::MallocSizeOf mallocSizeOf) const {
   /*
    * There are other JSContext members that could be measured; the following
    * ones have been found by DMD to be worth measuring.  More stuff may be
    * added later.
    */
   return cycleDetectorVector().sizeOfExcludingThis(mallocSizeOf);
--- a/js/src/vm/JSContext.h
+++ b/js/src/vm/JSContext.h
@@ -713,20 +713,16 @@ struct JSContext : public JS::RootingCon
   void initJitStackLimit();
   void resetJitStackLimit();
 
  public:
   JS::ContextOptions& options() { return options_.ref(); }
 
   bool runtimeMatches(JSRuntime* rt) const { return runtime_ == rt; }
 
-  js::ThreadData<bool> jitIsBroken;
-
-  void updateJITEnabled();
-
  private:
   /*
    * Youngest frame of a saved stack that will be picked up as an async stack
    * by any new Activation, and is nullptr when no async stack should be used.
    *
    * The JS::AutoSetAsyncStackForNewCalls class can be used to set this.
    *
    * New activations will reset this to nullptr on construction after getting