Ignore:
Timestamp:
Feb 14, 2022, 10:39:19 AM (3 years ago)
Author:
[email protected]
Message:

CallLinkInfo::emitFastPathImpl() should avoid external scratch register use on RISCV64
https://bugs.webkit.org/show_bug.cgi?id=236064

Patch by Zan Dobersek <[email protected]> on 2022-02-14
Reviewed by Yusuke Suzuki.

Avoid external scratch register usage in CallLinkInfo::emitFastPathImpl()
for RISCV64 since the scratch register ends up having to be used in the
branchTestPtr implementation of RISCV64's MacroAssembler.

The RISCV64-specific alternative is to suffer resolving and loading from
the callee address for both branching operations. Other platforms
continue to operate with the external scratch register as they either
use a wider set of scratch registers or don't even have to use scratch
registers for the load and branching operations used here.

  • assembler/CPU.h: Add isRISCV64(). Also impose a more sensible order.

(JSC::isMIPS):
(JSC::isRISCV64):

  • bytecode/CallLinkInfo.cpp:

(JSC::CallLinkInfo::emitFastPathImpl):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/assembler/CPU.h

    r261179 r289740  
    7979}
    8080
     81constexpr bool isMIPS()
     82{
     83#if CPU(MIPS)
     84    return true;
     85#else
     86    return false;
     87#endif
     88}
     89
     90constexpr bool isRISCV64()
     91{
     92#if CPU(RISCV64)
     93    return true;
     94#else
     95    return false;
     96#endif
     97}
     98
    8199constexpr bool is64Bit()
    82100{
     
    101119{
    102120    return !isAddress64Bit();
    103 }
    104 
    105 constexpr bool isMIPS()
    106 {
    107 #if CPU(MIPS)
    108     return true;
    109 #else
    110     return false;
    111 #endif
    112121}
    113122
Note: See TracChangeset for help on using the changeset viewer.