Title: [160315] trunk/Source/_javascript_Core
Revision
160315
Author
[email protected]
Date
2013-12-09 10:36:44 -0800 (Mon, 09 Dec 2013)

Log Message

Fix sh4 LLINT build.
https://bugs.webkit.org/show_bug.cgi?id=125454

Patch by Julien Brianceau <[email protected]> on 2013-12-09
Reviewed by Michael Saboff.

In LLINT, sh4 backend implementation didn't handle properly conditional jumps using
a LabelReference instance. This patch fixes it through sh4LowerMisplacedLabels phase.
Also, to avoid the need of a 4th temporary gpr, this phase is triggered later in
getModifiedListSH4.

* offlineasm/sh4.rb:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (160314 => 160315)


--- trunk/Source/_javascript_Core/ChangeLog	2013-12-09 18:30:31 UTC (rev 160314)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-12-09 18:36:44 UTC (rev 160315)
@@ -1,3 +1,17 @@
+2013-12-09  Julien Brianceau  <[email protected]>
+
+        Fix sh4 LLINT build.
+        https://bugs.webkit.org/show_bug.cgi?id=125454
+
+        Reviewed by Michael Saboff.
+
+        In LLINT, sh4 backend implementation didn't handle properly conditional jumps using
+        a LabelReference instance. This patch fixes it through sh4LowerMisplacedLabels phase.
+        Also, to avoid the need of a 4th temporary gpr, this phase is triggered later in
+        getModifiedListSH4.
+
+        * offlineasm/sh4.rb:
+
 2013-12-08  Filip Pizlo  <[email protected]>
 
         Add the notion of ConstantStoragePointer to DFG IR

Modified: trunk/Source/_javascript_Core/offlineasm/sh4.rb (160314 => 160315)


--- trunk/Source/_javascript_Core/offlineasm/sh4.rb	2013-12-09 18:30:31 UTC (rev 160314)
+++ trunk/Source/_javascript_Core/offlineasm/sh4.rb	2013-12-09 18:36:44 UTC (rev 160315)
@@ -452,18 +452,19 @@
     list.each {
         | node |
         if node.is_a? Instruction
-            case node.opcode
-            when "jmp", "call"
-                if node.operands[0].is_a? LabelReference
-                    tmp = Tmp.new(codeOrigin, :gpr)
-                    newList << Instruction.new(codeOrigin, "move", [node.operands[0], tmp])
-                    newList << Instruction.new(codeOrigin, node.opcode, [tmp])
+            operands = node.operands
+            newOperands = []
+            operands.each {
+                | operand |
+                if operand.is_a? LabelReference
+                    tmp = Tmp.new(operand.codeOrigin, :gpr)
+                    newList << Instruction.new(operand.codeOrigin, "move", [operand, tmp])
+                    newOperands << tmp
                 else
-                    newList << node
+                    newOperands << operand
                 end
-            else
-                newList << node
-            end
+            }
+            newList << Instruction.new(node.codeOrigin, node.opcode, newOperands, node.annotation)
         else
             newList << node
         end
@@ -730,8 +731,8 @@
             "bbeq", "bbneq", "bbb", "bieq", "bpeq", "bineq", "bpneq", "bia", "bpa", "biaeq", "bpaeq", "bib", "bpb",
             "bigteq", "bpgteq", "bilt", "bplt", "bigt", "bpgt", "bilteq", "bplteq", "btiz", "btpz", "btinz", "btpnz", "btbz", "btbnz"])
         result = riscLowerMalformedImmediates(result, -128..127)
+        result = riscLowerMisplacedAddresses(result)
         result = sh4LowerMisplacedLabels(result)
-        result = riscLowerMisplacedAddresses(result)
         result = sh4LowerMisplacedSpecialRegisters(result)
 
         result = assignRegistersToTemporaries(result, :gpr, SH4_TMP_GPRS)
@@ -749,6 +750,7 @@
 end
 
 def emitSH4Branch(sh4opcode, operand)
+    raise "Invalid operand #{operand}" unless operand.is_a? RegisterID or operand.is_a? SpecialRegister
     $asm.puts "#{sh4opcode} @#{operand.sh4Operand}"
     $asm.puts "nop"
 end
@@ -772,12 +774,16 @@
     end
 end
 
-def emitSH4BranchIfT(label, neg)
+def emitSH4BranchIfT(dest, neg)
     outlabel = LocalLabel.unique("branchIfT")
     sh4opcode = neg ? "bt" : "bf"
     $asm.puts "#{sh4opcode} #{LocalLabelReference.new(codeOrigin, outlabel).asmLabel}"
-    $asm.puts "bra #{label.asmLabel}"
-    $asm.puts "nop"
+    if dest.is_a? LocalLabelReference
+        $asm.puts "bra #{dest.asmLabel}"
+        $asm.puts "nop"
+    else
+        emitSH4Branch("jmp", dest)
+    end
     outlabel.lower("SH4")
 end
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to