Bug 535765 debug build Firefox failed to start on Solaris r=gal
authorGinn Chen <ginn.chen@sun.com>
Wed, 06 Jan 2010 15:24:30 +0800
changeset 37025 d70a30763ffe611188c12255b612f2dd853c392c
parent 37024 8035fd8809aa995682e91cfa452ab1a986465214
child 37026 1c02b713e856a2e7b919229eb9d879f7f950d821
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs535765
milestone1.9.3a1pre
Bug 535765 debug build Firefox failed to start on Solaris r=gal
js/src/nanojit/Nativei386.cpp
--- a/js/src/nanojit/Nativei386.cpp
+++ b/js/src/nanojit/Nativei386.cpp
@@ -88,23 +88,23 @@ namespace nanojit
             "cpuid\n"
             "mov %%edx, %0\n"
             "xchg %%esi, %%ebx\n"
             : "=m" (features)
             : /* We have no inputs */
             : "%eax", "%esi", "%ecx", "%edx"
            );
     #elif defined __SUNPRO_C || defined __SUNPRO_CC
-        asm("push %%ebx\n"
+        asm("xchg %%esi, %%ebx\n"
             "mov $0x01, %%eax\n"
             "cpuid\n"
-            "pop %%ebx\n"
+            "xchg %%esi, %%ebx\n"
             : "=d" (features)
             : /* We have no inputs */
-            : "%eax", "%ecx"
+            : "%eax", "%ecx", "esi"
            );
     #endif
         return (features & (1<<26)) != 0;
     }
 
     void Assembler::nInit(AvmCore* core)
     {
         (void) core;
@@ -315,16 +315,22 @@ namespace nanojit
     #ifdef WIN32
         _asm
         {
             mov ecx, regs
             bsf eax, set                    // i = first bit set
             btr RegAlloc::free[ecx], eax    // free &= ~rmask(i)
             mov r, eax
         }
+    #elif defined __SUNPRO_C || defined __SUNPRO_CC
+        asm(
+            "bsf    %1, %%edi\n\t"
+            "btr    %%edi, (%2)\n\t"
+            "movl   %%edi, %0\n\t"
+            : "=a"(r) : "d"(set), "c"(&regs.free) : "%edi", "memory" );
     #else
         asm(
             "bsf    %1, %%eax\n\t"
             "btr    %%eax, %2\n\t"
             "movl   %%eax, %0\n\t"
             : "=m"(r) : "m"(set), "m"(regs.free) : "%eax", "memory" );
     #endif /* WIN32 */
         return r;