Title: [237747] tags/Safari-607.1.12.1/Source/_javascript_Core

Diff

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/ChangeLog (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/ChangeLog	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/ChangeLog	2018-11-02 20:33:09 UTC (rev 237747)
@@ -1,3 +1,7 @@
+2018-11-02  Babak Shafiei  <bshaf...@apple.com>
+
+        Revert r237627. rdar://problem/45771226
+
 2018-11-02  Kocsen Chung  <kocsen_ch...@apple.com>
 
         Cherry-pick r237707. rdar://problem/45749094

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter32_64.asm	2018-11-02 20:33:09 UTC (rev 237747)
@@ -26,13 +26,15 @@
 macro nextInstruction()
     loadb [PC], t0
     leap _g_opcodeMap, t1
-    jmp [t1, t0, 4], BytecodePtrTag
+    loadp [t1, t0, 4], t2
+    jmp t2, BytecodePtrTag
 end
 
 macro nextInstructionWide()
     loadi 1[PC], t0
     leap _g_opcodeMapWide, t1
-    jmp [t1, t0, 4], BytecodePtrTag
+    loadp [t1, t0, 4], t2
+    jmp t2, BytecodePtrTag
 end
 
 macro getuOperandNarrow(op, field, dst)

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter64.asm (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/llint/LowLevelInterpreter64.asm	2018-11-02 20:33:09 UTC (rev 237747)
@@ -28,13 +28,15 @@
 macro nextInstruction()
     loadb [PB, PC, 1], t0
     leap _g_opcodeMap, t1
-    jmp [t1, t0, PtrSize], BytecodePtrTag
+    loadp [t1, t0, PtrSize], t2
+    jmp t2, BytecodePtrTag
 end
 
 macro nextInstructionWide()
     loadi 1[PB, PC, 1], t0
     leap _g_opcodeMapWide, t1
-    jmp [t1, t0, PtrSize], BytecodePtrTag
+    loadp [t1, t0, PtrSize], t2
+    jmp t2, BytecodePtrTag
 end
 
 macro getuOperandNarrow(op, field, dst)
@@ -435,30 +437,17 @@
 
 # Index and value must be different registers. Index may be clobbered.
 macro loadConstantOrVariable(size, index, value)
-    macro loadNarrow()
-        bpgteq index, FirstConstantRegisterIndexNarrow, .constant
+    size(FirstConstantRegisterIndexNarrow, FirstConstantRegisterIndexWide, macro (FirstConstantRegisterIndex)
+        bpgteq index, FirstConstantRegisterIndex, .constant
         loadq [cfr, index, 8], value
         jmp .done
     .constant:
         loadp CodeBlock[cfr], value
         loadp CodeBlock::m_constantRegisters + VectorBufferOffset[value], value
-        loadq -(FirstConstantRegisterIndexNarrow * 8)[value, index, 8], value
-    .done:
-    end
-
-    macro loadWide()
-        bpgteq index, FirstConstantRegisterIndexWide, .constant
-        loadq [cfr, index, 8], value
-        jmp .done
-    .constant:
-        loadp CodeBlock[cfr], value
-        loadp CodeBlock::m_constantRegisters + VectorBufferOffset[value], value
-        subp FirstConstantRegisterIndexWide, index
+        subp FirstConstantRegisterIndex, index
         loadq [value, index, 8], value
     .done:
-    end
-
-    size(loadNarrow, loadWide, macro (load) load() end)
+    end)
 end
 
 macro loadConstantOrVariableInt32(size, index, value, slow)

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/arm64.rb (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/arm64.rb	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/arm64.rb	2018-11-02 20:33:09 UTC (rev 237747)
@@ -484,18 +484,6 @@
     $asm.puts "#{opcode} #{arm64TACOperands(operands, kind)}"
 end
 
-def emitARM64Mul(opcode, operands, kind)
-    if operands.size == 2 and operands[0].is_a? Immediate
-        imm = operands[0].value
-        if imm > 0 and isPowerOfTwo(imm)
-            emitARM64LShift([Immediate.new(nil, Math.log2(imm).to_i), operands[1]], kind)
-            return
-        end
-    end
-
-    $asm.puts "madd #{arm64TACOperands(operands, kind)}, #{arm64GPRName('xzr', kind)}"
-end
-
 def emitARM64Unflipped(opcode, operands, kind)
     $asm.puts "#{opcode} #{arm64Operands(operands, kind)}"
 end
@@ -534,21 +522,6 @@
     emitARM64TAC(opcodeRegs, operands, kind)
 end
 
-def emitARM64LShift(operands, kind)
-    emitARM64Shift("lslv", "ubfm", operands, kind) {
-        | value |
-        case kind
-        when :word
-            [32 - value, 31 - value]
-        when :ptr
-            bitSize = $currentSettings["ADDRESS64"] ? 64 : 32
-            [bitSize - value, bitSize - 1 - value]
-        when :quad
-            [64 - value, 63 - value]
-        end
-    }
-end
-
 def emitARM64Branch(opcode, operands, kind, branchOpcode)
     emitARM64Unflipped(opcode, operands[0..-2], kind)
     $asm.puts "#{branchOpcode} #{operands[-1].asmLabel}"
@@ -611,11 +584,21 @@
         when "xorq"
             emitARM64TAC("eor", operands, :quad)
         when "lshifti"
-            emitARM64LShift(operands, :word)
+            emitARM64Shift("lslv", "ubfm", operands, :word) {
+                | value |
+                [32 - value, 31 - value]
+            }
         when "lshiftp"
-            emitARM64LShift(operands, :ptr)
+            emitARM64Shift("lslv", "ubfm", operands, :ptr) {
+                | value |
+                bitSize = $currentSettings["ADDRESS64"] ? 64 : 32
+                [bitSize - value, bitSize - 1 - value]
+            }
         when "lshiftq"
-            emitARM64LShift(operands, :quad)
+            emitARM64Shift("lslv", "ubfm", operands, :quad) {
+                | value |
+                [64 - value, 63 - value]
+            }
         when "rshifti"
             emitARM64Shift("asrv", "sbfm", operands, :word) {
                 | value |
@@ -649,11 +632,11 @@
                 [value, 63]
             }
         when "muli"
-            emitARM64Mul('mul', operands, :word)
+            $asm.puts "madd #{arm64TACOperands(operands, :word)}, wzr"
         when "mulp"
-            emitARM64Mul('mul', operands, :ptr)
+            $asm.puts "madd #{arm64TACOperands(operands, :ptr)}, #{arm64GPRName('xzr', :ptr)}"
         when "mulq"
-            emitARM64Mul('mul', operands, :quad)
+            $asm.puts "madd #{arm64TACOperands(operands, :quad)}, xzr"
         when "subi"
             emitARM64TAC("sub", operands, :word)
         when "subp"

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/instructions.rb (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/instructions.rb	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/instructions.rb	2018-11-02 20:33:09 UTC (rev 237747)
@@ -324,7 +324,3 @@
     instruction != "ret" and instruction != "jmp"
 end
 
-def isPowerOfTwo(value)
-    return false if value <= 0
-    (value & (value - 1)).zero?
-end

Modified: tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/x86.rb (237746 => 237747)


--- tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/x86.rb	2018-11-02 19:39:01 UTC (rev 237746)
+++ tags/Safari-607.1.12.1/Source/_javascript_Core/offlineasm/x86.rb	2018-11-02 20:33:09 UTC (rev 237747)
@@ -798,18 +798,11 @@
     def handleX86Mul(kind)
         if operands.size == 3 and operands[0].is_a? Immediate
             $asm.puts "imul#{x86Suffix(kind)} #{x86Operands(kind, kind, kind)}"
-            return
+        else
+            # FIXME: could do some peephole in case the left operand is immediate and it's
+            # a power of two.
+            handleX86Op("imul#{x86Suffix(kind)}", kind)
         end
-
-        if operands.size == 2 and operands[0].is_a? Immediate
-            imm = operands[0].value
-            if imm > 0 and isPowerOfTwo(imm)
-                $asm.puts "sal#{x86Suffix(kind)} #{orderOperands(Immediate.new(nil, Math.log2(imm).to_i).x86Operand(kind), operands[1].x86Operand(kind))}"
-                return
-            end
-        end
-
-        handleX86Op("imul#{x86Suffix(kind)}", kind)
     end
     
     def handleX86Peek()
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to