Bug 613367: Log relevant data when computing JIT-brokenness. r=dvander a=2.0
authorChris Jones <jones.chris.g@gmail.com>
Thu, 18 Nov 2010 20:27:44 -0600
changeset 57887 2e35085ca7cc08badf78532dff238cecf4381a47
parent 57886 5f0d24418e7ee87d6334b06f6571b2283b197268
child 57888 54289a8057cf17ac767aef3633c23a9939c85020
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersdvander, 2
bugs613367
milestone2.0b8pre
Bug 613367: Log relevant data when computing JIT-brokenness. r=dvander a=2.0
js/src/jscntxt.cpp
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -41,16 +41,17 @@
 /*
  * JS execution context.
  */
 #include <new>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #ifdef ANDROID
+# include <android/log.h>
 # include <fstream>
 # include <string>
 #endif  // ANDROID
 
 #include "jsstdint.h"
 
 #include "jstypes.h"
 #include "jsarena.h"
@@ -2216,44 +2217,55 @@ ComputeIsJITBroken()
         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")) {
             const char* blacklist[] = {
                 "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
                 NULL
             };
             for (const char** 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;