Ignore:
Timestamp:
Sep 3, 2015, 3:16:23 PM (10 years ago)
Author:
[email protected]
Message:

Clean up register naming
https://bugs.webkit.org/show_bug.cgi?id=148658

Reviewed by Geoffrey Garen.

This changes register naming conventions in the llint and baseline JIT
in order to use as few (native) callee-save registers as possible on
64-bits platforms. It also introduces significant changes in the way
registers names are defined in the LLint and baseline JIT in order to
enable a simpler convention about which registers can be aliased. That
convention is valid across all architecture, and described in
llint/LowLevelInterpreter.asm.

Callee save registers are now called out regCS<n> (in the JIT) or
csr<n> (in the LLInt) with a common numbering across all tiers. Some
registers are unused in some tiers.

As a part of this change, rdi was removed from the list of temporary
registers for X86-64 Windows as it is a callee saves register. This
reduced the number of temporary registers for X86-64 Windows.

This is in preparation for properly handling callee save register
preservation and restoration.

  • dfg/DFGJITCompiler.cpp:

(JSC::DFG::JITCompiler::compileFunction):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • jit/FPRInfo.h:

(JSC::FPRInfo::toRegister):
(JSC::FPRInfo::toIndex):

  • jit/GPRInfo.h:

(JSC::GPRInfo::toIndex):
(JSC::GPRInfo::toRegister):
(JSC::GPRInfo::debugName): Deleted.

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_mod):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emitSlow_op_loop_hint):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_end):
(JSC::JIT::emit_op_new_object):

  • jit/RegisterPreservationWrapperGenerator.cpp:

(JSC::generateRegisterPreservationWrapper):
(JSC::generateRegisterRestoration):

  • jit/ThunkGenerators.cpp:

(JSC::arityFixupGenerator):
(JSC::nativeForGenerator): Deleted.

  • llint/LowLevelInterpreter.asm:
  • llint/LowLevelInterpreter32_64.asm:
  • llint/LowLevelInterpreter64.asm:
  • offlineasm/arm.rb:
  • offlineasm/arm64.rb:
  • offlineasm/cloop.rb:
  • offlineasm/mips.rb:
  • offlineasm/registers.rb:
  • offlineasm/sh4.rb:
  • offlineasm/x86.rb:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/offlineasm/sh4.rb

    r172429 r189293  
    2525require 'risc'
    2626
     27# GPR conventions, to match the baseline JIT
     28#
     29#  r0 => t0, r0
     30#  r1 => t1, r1
     31#  r2 => t4
     32#  r3 => t5
     33#  r4 =>         a0
     34#  r5 =>         a1
     35#  r6 => t2,     a2
     36#  r7 => t3,     a3
     37# r10 =>            (scratch)
     38# r11 =>            (scratch)
     39# r13 =>            (scratch)
     40# r14 => cfr
     41# r15 => sp
     42#  pr => lr
     43
     44# FPR conventions, to match the baseline JIT
     45# We don't have fa2 or fa3!
     46#  dr0 => ft0, fr
     47#  dr2 => ft1
     48#  dr4 => ft2,   fa0
     49#  dr6 => ft3,   fa1
     50#  dr8 => ft4
     51# dr10 => ft5
     52# dr12 =>             (scratch)
     53
    2754class Node
    2855    def sh4SingleHi
     
    5279end
    5380
    54 SH4_TMP_GPRS = [ SpecialRegister.new("r3"), SpecialRegister.new("r11"), SpecialRegister.new("r13") ]
    55 SH4_TMP_FPRS = [ SpecialRegister.new("dr10") ]
     81SH4_TMP_GPRS = [ SpecialRegister.new("r10"), SpecialRegister.new("r11"), SpecialRegister.new("r13") ]
     82SH4_TMP_FPRS = [ SpecialRegister.new("dr12") ]
    5683
    5784class RegisterID
    5885    def sh4Operand
    5986        case name
    60         when "t0"
     87        when "a0"
     88            "r4"
     89        when "a1"
     90            "r5"
     91        when "r0", "t0"
    6192            "r0"
    62         when "t1"
     93        when "r1", "t1"
    6394            "r1"
    64         when "t2"
     95        when "a2", "t2"
     96            "r6"
     97        when "a3", "t3"
     98            "r7"
     99        when "t4"
    65100            "r2"
    66         when "t3"
    67             "r10"
    68         when "t4", "a0"
    69             "r4"
    70         when "t5", "a1"
    71             "r5"
    72         when "t6", "a2"
    73             "r6"
    74         when "t7", "a3"
    75             "r7"
    76         when "t8"
    77             "r8"
    78         when "t9"
    79             "r9"
     101        when "t5"
     102            "r3"
    80103        when "cfr"
    81104            "r14"
     
    97120        when "ft1"
    98121            "dr2"
    99         when "ft2"
     122        when "ft2", "fa0"
    100123            "dr4"
    101         when "ft3"
     124        when "ft3", "fa1"
    102125            "dr6"
    103126        when "ft4"
    104127            "dr8"
    105         when "fa0"
    106             "dr12"
     128        when "ft5"
     129            "dr10"
    107130        else
    108131            raise "Bad register #{name} for SH4 at #{codeOriginString}"
Note: See TracChangeset for help on using the changeset viewer.