Changeset 167566 in webkit


Ignore:
Timestamp:
Apr 20, 2014 6:58:25 AM (10 years ago)
Author:
Csaba Osztrogonác
Message:

JavaScriptCore: ARM build fix after r167094.
https://bugs.webkit.org/show_bug.cgi?id=131612

Patch by László Langó <llango.u-szeged@partner.samsung.com> on 2014-04-20
Reviewed by Michael Saboff.

After r167094 there are many build errors on ARM like these:

/tmp/ccgtHRno.s:370: Error: invalid constant (425a) after fixup
/tmp/ccgtHRno.s:374: Error: invalid constant (426e) after fixup
/tmp/ccgtHRno.s:378: Error: invalid constant (4282) after fixup
/tmp/ccgtHRno.s:382: Error: invalid constant (4296) after fixup

Problem is caused by the wrong generated assembly like:

"\tmov r2, (" LOCAL_LABEL_STRING(llint_op_strcat) " - " LOCAL_LABEL_STRING(relativePCBase) ")\n" /home/webkit/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:741

mov can only move 8 bit immediate, but not every constant fit into 8 bit. Clang converts
the mov to a single movw or a movw and a movt, depending on the immediate, but binutils doesn't.
Add a new ARM specific offline assembler instruction (mvlbl) for the following llint_entry
use case: move rn, (label1-label2) which is translated to movw and movt.

  • llint/LowLevelInterpreter.asm:
  • offlineasm/arm.rb:
  • offlineasm/instructions.rb:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r167565 r167566  
     12014-04-20  László Langó  <llango.u-szeged@partner.samsung.com>
     2
     3        JavaScriptCore: ARM build fix after r167094.
     4        https://bugs.webkit.org/show_bug.cgi?id=131612
     5
     6        Reviewed by Michael Saboff.
     7
     8        After r167094 there are many build errors on ARM like these:
     9
     10            /tmp/ccgtHRno.s:370: Error: invalid constant (425a) after fixup
     11            /tmp/ccgtHRno.s:374: Error: invalid constant (426e) after fixup
     12            /tmp/ccgtHRno.s:378: Error: invalid constant (4282) after fixup
     13            /tmp/ccgtHRno.s:382: Error: invalid constant (4296) after fixup
     14
     15        Problem is caused by the wrong generated assembly like:
     16            "\tmov r2, (" LOCAL_LABEL_STRING(llint_op_strcat) " - " LOCAL_LABEL_STRING(relativePCBase) ")\n" // /home/webkit/WebKit/Source/JavaScriptCore/llint/LowLevelInterpreter.asm:741
     17
     18        `mov` can only move 8 bit immediate, but not every constant fit into 8 bit. Clang converts
     19        the mov to a single movw or a movw and a movt, depending on the immediate, but binutils doesn't.
     20        Add a new ARM specific offline assembler instruction (`mvlbl`) for the following llint_entry
     21        use case: move rn, (label1-label2) which is translated to movw and movt.
     22
     23        * llint/LowLevelInterpreter.asm:
     24        * offlineasm/arm.rb:
     25        * offlineasm/instructions.rb:
     26
    1272014-04-20  Csaba Osztrogonác  <ossy@webkit.org>
    228
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r167515 r167566  
    738738        move index, t2
    739739        storep t1, [a0, t2, 8]
    740     elsif ARM or ARMv7 or ARMv7_TRADITIONAL or SH4
     740    elsif ARM or ARMv7 or ARMv7_TRADITIONAL
     741        mvlbl (label - _relativePCBase), t2
     742        addp t2, t1, t2
     743        move index, t3
     744        storep t2, [a0, t3, 4]
     745    elsif SH4
    741746        move (label - _relativePCBase), t2
    742747        addp t2, t1, t2
    743748        move index, t3
    744749        storep t2, [a0, t3, 4]
    745         if SH4
    746             flushcp # Force constant pool flush to avoid "pcrel too far" link error.
    747         end
     750        flushcp # Force constant pool flush to avoid "pcrel too far" link error.
    748751    elsif MIPS
    749752        crash()  # Need to replace with code to turn label into and absolute address and save at index
  • trunk/Source/JavaScriptCore/offlineasm/arm.rb

    r167094 r167566  
    485485                $asm.puts "mov #{armFlippedOperands(operands)}"
    486486            end
     487        when "mvlbl"
     488                $asm.puts "movw #{operands[1].armOperand}, \#:lower16:#{operands[0].value}"
     489                $asm.puts "movt #{operands[1].armOperand}, \#:upper16:#{operands[0].value}"
    487490        when "nop"
    488491            $asm.puts "nop"
  • trunk/Source/JavaScriptCore/offlineasm/instructions.rb

    r167127 r167566  
    262262ARM_INSTRUCTIONS =
    263263    [
    264      "clrbp"
     264     "clrbp",
     265     "mvlbl"
    265266    ]
    266267
Note: See TracChangeset for help on using the changeset viewer.