Bug 998158 - SpiderMonkey: Use specific feature tests instead of calling getSSEState() r=sstangl
authorDan Gohman <sunfish@mozilla.com>
Mon, 21 Apr 2014 17:34:57 -0700
changeset 179885 3f36eb16f2bb63fdcbecd83444fcd924c1ee18ce
parent 179884 12e086839514d92e19c886b21ed6fedde29881a8
child 179886 b5869e103bfac622d5f9ff8086dd7a0a87791599
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerssstangl
bugs998158
milestone31.0a1
Bug 998158 - SpiderMonkey: Use specific feature tests instead of calling getSSEState() r=sstangl
js/src/assembler/assembler/MacroAssemblerX86Common.h
js/src/jit/shared/Assembler-x86-shared.h
--- a/js/src/assembler/assembler/MacroAssemblerX86Common.h
+++ b/js/src/assembler/assembler/MacroAssemblerX86Common.h
@@ -1407,16 +1407,17 @@ private:
 #ifdef DEBUG
         if (s_sseCheckState >= HasSSE4_1 && s_SSE4Disabled)
             s_sseCheckState = HasSSE3;
         if (s_sseCheckState >= HasSSE3 && s_SSE3Disabled)
             s_sseCheckState = HasSSE2;
 #endif
     }
 
+  public:
 #if WTF_CPU_X86
 #if WTF_OS_MAC_OS_X
 
     // All X86 Macs are guaranteed to support at least SSE2
     static bool isSSEPresent()
     {
         return true;
     }
@@ -1504,16 +1505,17 @@ private:
             setSSECheckState();
         }
         // Only check once.
         ASSERT(s_sseCheckState != NotCheckedSSE);
 
         return s_sseCheckState >= HasSSE4_2;
     }
 
+  private:
 #ifdef DEBUG
     static bool s_floatingPointDisabled;
     static bool s_SSE3Disabled;
     static bool s_SSE4Disabled;
 
   public:
     static void SetFloatingPointDisabled() {
         s_floatingPointDisabled = true;
--- a/js/src/jit/shared/Assembler-x86-shared.h
+++ b/js/src/jit/shared/Assembler-x86-shared.h
@@ -776,24 +776,26 @@ class AssemblerX86Shared
             MOZ_ASSUME_UNREACHABLE("unexpected operand kind");
         }
     }
 
     void breakpoint() {
         masm.int3();
     }
 
+#ifdef DEBUG
     static bool HasSSE2() {
-        return JSC::MacroAssembler::getSSEState() >= JSC::MacroAssembler::HasSSE2;
+        return JSC::MacroAssembler::isSSE2Present();
     }
+#endif
     static bool HasSSE3() {
-        return JSC::MacroAssembler::getSSEState() >= JSC::MacroAssembler::HasSSE3;
+        return JSC::MacroAssembler::isSSE3Present();
     }
     static bool HasSSE41() {
-        return JSC::MacroAssembler::getSSEState() >= JSC::MacroAssembler::HasSSE4_1;
+        return JSC::MacroAssembler::isSSE41Present();
     }
 
     // The below cmpl methods switch the lhs and rhs when it invokes the
     // macroassembler to conform with intel standard.  When calling this
     // function put the left operand on the left as you would expect.
     void cmpl(const Register &lhs, const Register &rhs) {
         masm.cmpl_rr(rhs.code(), lhs.code());
     }