components/desktop/firefox/patches/firefox31-60-Yarr_SPARC.patch
author Stacy Yeh <stacy.yeh@oracle.com>
Mon, 11 Jan 2016 09:27:45 -0800
changeset 5255 cea0e462549a
permissions -rw-r--r--
22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5255
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     1
Sparc assembler and fixes a bug in JIT. 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     2
Also some endian patch. 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     3
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     4
--- mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h.orig	2015-06-04 17:42:51.654203814 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     5
+++ mozilla-esr31/js/src/assembler/assembler/MacroAssemblerSparc.h	2015-06-04 17:42:51.667707756 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     6
@@ -337,6 +337,17 @@
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     7
             }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     8
         }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
     9
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    10
+        void load16Unaligned(BaseIndex address, RegisterID dest)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    11
+        {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    12
+            m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    13
+            add32(Imm32(address.offset+1), SparcRegisters::g2);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    14
+            m_assembler.ldub_r(address.base, SparcRegisters::g2, dest);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    15
+            m_assembler.subcc_imm(SparcRegisters::g2, 1, SparcRegisters::g2);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    16
+            m_assembler.ldub_r(address.base, SparcRegisters::g2, SparcRegisters::g3);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    17
+            m_assembler.sll_imm(SparcRegisters::g3, 8, SparcRegisters::g3);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    18
+            m_assembler.or_r(SparcRegisters::g3, dest, dest);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    19
+        }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    20
+
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    21
         void store8(RegisterID src, ImplicitAddress address)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    22
         {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    23
             if (m_assembler.isimm13(address.offset))
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    24
@@ -416,6 +427,11 @@
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    25
             }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    26
         }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    27
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    28
+        void load8(BaseIndex address, RegisterID dest)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    29
+        {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    30
+            load8ZeroExtend(address, dest);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    31
+        }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    32
+
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    33
         void load8SignExtend(BaseIndex address, RegisterID dest)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    34
         {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    35
             m_assembler.sll_imm(address.index, address.scale, SparcRegisters::g2);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    36
--- mozilla-esr31/js/src/assembler/assembler/SparcAssembler.h.orig	2015-06-04 17:42:51.659564348 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    37
+++ mozilla-esr31/js/src/assembler/assembler/SparcAssembler.h	2015-06-04 17:42:51.667904536 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    38
@@ -161,6 +161,10 @@
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    39
             {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    40
             }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    41
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    42
+            bool isSet() const {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    43
+                return m_offset != -1;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    44
+            }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    45
+
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    46
         private:
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    47
             JmpSrc(int offset)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    48
                 : m_offset(offset)
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    49
--- mozilla-esr31/js/src/yarr/YarrJIT.cpp.orig	2015-06-04 17:42:51.665227855 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    50
+++ mozilla-esr31/js/src/yarr/YarrJIT.cpp	2015-06-04 17:42:51.668284205 -0700
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    51
@@ -84,6 +84,7 @@
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    52
     static const RegisterID regT1 = SparcRegisters::i5;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    53
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    54
     static const RegisterID returnRegister = SparcRegisters::i0;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    55
+    static const RegisterID returnRegister2 = SparcRegisters::i1;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    56
 #elif WTF_CPU_X86
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    57
     static const RegisterID input = X86Registers::eax;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    58
     static const RegisterID index = X86Registers::edx;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    59
@@ -824,6 +825,18 @@
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    60
                 ignoreCaseMask |= 32 << shiftAmount;
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    61
         }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    62
 
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    63
+#if WTF_CPU_BIG_ENDIAN
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    64
+        if (m_charSize == Char8) {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    65
+            allCharacters = (allCharacters << 24) | ((allCharacters << 8) & 0xff0000) |
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    66
+                            ((allCharacters >> 8) & 0xff00) | ((allCharacters >> 24) & 0xff);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    67
+            ignoreCaseMask = (ignoreCaseMask << 24) | ((ignoreCaseMask << 8) & 0xff0000) |
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    68
+                             ((ignoreCaseMask >> 8) & 0xff00) | ((ignoreCaseMask >> 24) & 0xff);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    69
+        } else {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    70
+            allCharacters = (allCharacters << 16) | ((allCharacters >> 16) & 0xffff);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    71
+            ignoreCaseMask = (ignoreCaseMask << 16) | ((ignoreCaseMask >> 16) & 0xffff);
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    72
+        }
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    73
+#endif
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    74
+
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    75
         if (m_charSize == Char8) {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    76
             switch (numberCharacters) {
cea0e462549a 22322082 Move Firefox/Thunderbird from Desktop consolidation to Userland
Stacy Yeh <stacy.yeh@oracle.com>
parents:
diff changeset
    77
             case 1: