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/arm64.rb

    r175514 r189293  
    3838# GPR conventions, to match the baseline JIT:
    3939#
    40 #  x0  => return value, cached result, first argument, t0, a0, r0
     40#  x0  => t0, a0, r0
    4141#  x1  => t1, a1, r1
    4242#  x2  => t2, a2
    43 #  x3  => a3
    44 #  x5  => t4
    45 #  x6  => t6
    46 #  x9  => (nonArgGPR1 in baseline)
    47 # x13  => scratch (unused in baseline)
    48 # x16  => scratch
    49 # x17  => scratch
    50 # x23  => t3
    51 # x24  => t5
    52 # x27  => csr1 (tagTypeNumber)
    53 # x28  => csr2 (tagMask)
     43#  x3  => t3, a3
     44#  x4  => t4
     45#  x5  => t5
     46# x13  =>                  (scratch)
     47# x16  =>                  (scratch)
     48# x17  =>                  (scratch)
     49# x26  =>             csr0 (PB)
     50# x27  =>             csr1 (tagTypeNumber)
     51# x28  =>             csr2 (tagMask)
    5452# x29  => cfr
    5553#  sp  => sp
    5654#  lr  => lr
    5755#
    58 # FPR conentions, to match the baseline JIT:
     56# FPR conventions, to match the baseline JIT:
    5957#
    60 #  q0  => ft0
    61 #  q1  => ft1
    62 #  q2  => ft2
    63 #  q3  => ft3
    64 #  q4  => ft4 (unused in baseline)
    65 #  q5  => ft5 (unused in baseline)
     58#  q0  => ft0, fa0, fr
     59#  q1  => ft1, fa1
     60#  q2  => ft2, fa2
     61#  q3  => ft3, fa3
     62#  q4  => ft4          (unused in baseline)
     63#  q5  => ft5          (unused in baseline)
    6664# q31  => scratch
    6765
     
    110108        when 't2', 'a2'
    111109            arm64GPRName('x2', kind)
    112         when 'a3'
     110        when 't3', 'a3'
    113111            arm64GPRName('x3', kind)
    114         when 't3'
    115             arm64GPRName('x23', kind)
    116112        when 't4'
     113            arm64GPRName('x4', kind)
     114        when 't5'
    117115            arm64GPRName('x5', kind)
    118         when 't5'
    119             arm64GPRName('x24', kind)
    120         when 't6'
    121             arm64GPRName('x6', kind)
    122         when 't7'
    123             arm64GPRName('x7', kind)
    124116        when 'cfr'
    125117            arm64GPRName('x29', kind)
     118        when 'csr0'
     119            arm64GPRName('x26', kind)
    126120        when 'csr1'
    127121            arm64GPRName('x27', kind)
     
    141135    def arm64Operand(kind)
    142136        case @name
    143         when 'ft0'
     137        when 'ft0', 'fr', 'fa0'
    144138            arm64FPRName('q0', kind)
    145         when 'ft1'
     139        when 'ft1', 'fa1'
    146140            arm64FPRName('q1', kind)
    147         when 'ft2'
     141        when 'ft2', 'fa2'
    148142            arm64FPRName('q2', kind)
    149         when 'ft3'
     143        when 'ft3', 'fa3'
    150144            arm64FPRName('q3', kind)
    151145        when 'ft4'
Note: See TracChangeset for help on using the changeset viewer.