Changeset 195236 in webkit


Ignore:
Timestamp:
Jan 18, 2016 1:07:08 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[MIPS] LLInt: fix calculation of Global Offset Table
https://bugs.webkit.org/show_bug.cgi?id=150381

Offlineasm adds a .cpload $t9 when we create a label in MIPS, which
computes address of GOT. However, this instruction requires $t9 to
contain address of current function. So we need to set $t9 to pcBase,
otherwise GOT-related calculations will be invalid.

Since offlineasm does not allow direct move to $t9 on MIPS, added new
instruction setcallreg which does exactly that.

Patch by Konstantin Tokarev <Konstantin Tokarev> on 2016-01-18
Reviewed by Michael Saboff.

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

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r195233 r195236  
     12016-01-18  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        [MIPS] LLInt: fix calculation of Global Offset Table
     4        https://bugs.webkit.org/show_bug.cgi?id=150381
     5
     6        Offlineasm adds a .cpload $t9 when we create a label in MIPS, which
     7        computes address of GOT. However, this instruction requires $t9 to
     8        contain address of current function. So we need to set $t9 to pcBase,
     9        otherwise GOT-related calculations will be invalid.
     10
     11        Since offlineasm does not allow direct move to $t9 on MIPS, added new
     12        instruction setcallreg which does exactly that.
     13
     14        Reviewed by Michael Saboff.
     15
     16        * llint/LowLevelInterpreter.asm:
     17        * offlineasm/instructions.rb:
     18        * offlineasm/mips.rb:
     19
    1202016-01-18  Csaba Osztrogonác  <ossy@webkit.org>
    221
  • trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm

    r194369 r195236  
    10881088        elsif MIPS
    10891089            la _relativePCBase, pcBase
     1090            setcallreg pcBase # needed to set $t9 to the right value for the .cpload created by the label.
    10901091        _relativePCBase:
    10911092        elsif SH4
  • trunk/Source/JavaScriptCore/offlineasm/instructions.rb

    r175514 r195236  
    285285    "movz",
    286286    "movn",
     287    "setcallreg",
    287288    "slt",
    288289    "sltu",
  • trunk/Source/JavaScriptCore/offlineasm/mips.rb

    r195182 r195236  
    10341034        when "movn"
    10351035            $asm.puts "movn #{operands[0].mipsOperand}, #{operands[1].mipsOperand}, #{operands[2].mipsOperand}"
     1036        when "setcallreg"
     1037            $asm.puts "move #{MIPS_CALL_REG.mipsOperand}, #{operands[0].mipsOperand}"
    10361038        when "slt", "sltb"
    10371039            $asm.puts "slt #{operands[0].mipsOperand}, #{operands[1].mipsOperand}, #{operands[2].mipsOperand}"
Note: See TracChangeset for help on using the changeset viewer.