Ignore:
Timestamp:
Nov 30, 2021, 7:44:25 AM (3 years ago)
Author:
[email protected]
Message:

[JSC] Unify most Baseline ops between JSVALUE64 and JSVALUE32_64
https://bugs.webkit.org/show_bug.cgi?id=233424

Patch by Geza Lore <Geza Lore> on 2021-11-30
Reviewed by Yusuke Suzuki.

This patch unifies the Baseline JIT implementations of most bytecode
ops between the JSVALUE32_64 and JSVALUE64 platforms. There are very
few changes to the generated code on JSVALUE64 (and all are fairly
trivial, e.g.: removal of redundant moves in the slow path), apart
from machine register substitutions. My measurements on x86_64
indicate the patch is performance neutral there (which is what we
expect).

On ARMv7/Thumb-2 JetStream2 shows a 0.4% improvement. This is due to
some of the improved implementations picked up from the JSVALUE64
versions.

Also remove various unused code.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • Sources.txt:
  • bytecode/StructureStubInfo.cpp:

(JSC::StructureStubInfo::initializeFromUnlinkedStructureStubInfo):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::branchIfBoolean):
(JSC::AssemblyHelpers::branchIfNotBoolean):
(JSC::AssemblyHelpers::isUndefined):

  • jit/GPRInfo.h:
  • jit/JIT.cpp:
  • jit/JIT.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_compareAndJumpImpl):
(JSC::JIT::emit_compareUnsignedAndJumpImpl):
(JSC::JIT::emit_compareUnsignedImpl):
(JSC::JIT::emit_compareAndJumpSlowImpl):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emit_op_mod):
(JSC::JIT::emitBitBinaryOpFastPath):
(JSC::JIT::emit_op_bitnot):
(JSC::JIT::emitRightShiftFastPath):
(JSC::JIT::emitMathICFast):
(JSC::JIT::emitMathICSlow):
(JSC::JIT::emit_op_div):

  • jit/JITArithmetic32_64.cpp: Removed.
  • jit/JITInlineCacheGenerator.h:
  • jit/JITInlines.h:

(JSC::JIT::emitGetVirtualRegisterPayload):
(JSC::JIT::emitPutVirtualRegister):
(JSC::JIT::emitJumpSlowCaseIfNotInt):
(JSC::JIT::loadCodeBlockConstantPayload):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_typeof_is_undefined):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_big_int):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_to_primitive):
(JSC::JIT::emit_op_to_property_key):
(JSC::JIT::emit_op_not):
(JSC::JIT::emit_op_jundefined_or_null):
(JSC::JIT::emit_op_jnundefined_or_null):
(JSC::JIT::emit_op_jeq_ptr):
(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_numeric):
(JSC::JIT::emit_op_to_string):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emit_op_get_parent_scope):
(JSC::JIT::emit_op_get_scope):
(JSC::JIT::emit_op_to_this):
(JSC::JIT::emit_op_check_tdz):
(JSC::JIT::emit_op_new_regexp):
(JSC::JIT::emit_op_get_rest_length):
(JSC::JIT::emit_op_get_prototype_of):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::compileOpEqCommon):
(JSC::JIT::compileOpEqSlowCommon):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::emit_op_jeq):
(JSC::JIT::emit_op_jneq):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_jeq):
(JSC::JIT::emitSlow_op_jneq):
(JSC::JIT::compileOpStrictEqCommon):
(JSC::JIT::emit_op_stricteq):
(JSC::JIT::emit_op_nstricteq):
(JSC::JIT::emit_op_jstricteq):
(JSC::JIT::emit_op_jnstricteq):
(JSC::JIT::emitSlow_op_jstricteq):
(JSC::JIT::emitSlow_op_jnstricteq):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::generateGetByValSlowCase):
(JSC::JIT::emitSlow_op_get_private_name):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_enumerator_get_by_val):
(JSC::JIT::emit_enumerator_has_propertyImpl):
(JSC::JIT::emitWriteBarrier):

  • jit/JSInterfaceJIT.h:

(JSC::JSInterfaceJIT::emitLoadJSCell):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h

    r286111 r286296  
    5050        inline Jump emitLoadDouble(VirtualRegister, FPRegisterID dst, RegisterID scratch);
    5151
    52 #if USE(JSVALUE32_64)
    53         inline Jump emitJumpIfNotJSCell(VirtualRegister);
    54 #endif
    55 
    56         void emitGetFromCallFrameHeaderPtr(VirtualRegister entry, RegisterID to, RegisterID from = callFrameRegister);
    57         void emitPutToCallFrameHeader(RegisterID from, VirtualRegister entry);
    58         void emitPutToCallFrameHeader(void* value, VirtualRegister entry);
    59         void emitPutCellToCallFrameHeader(RegisterID from, VirtualRegister entry);
    60 
    6152        VM* vm() const { return m_vm; }
    6253
     
    6758    inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadJSCell(VirtualRegister virtualRegister, RegisterID payload)
    6859    {
     60        ASSERT(virtualRegister < VirtualRegister(FirstConstantRegisterIndex));
    6961        loadPtr(payloadFor(virtualRegister), payload);
    70         return emitJumpIfNotJSCell(virtualRegister);
     62        return branch32(NotEqual, tagFor(virtualRegister), TrustedImm32(JSValue::CellTag));
    7163    }
    7264
    73     inline JSInterfaceJIT::Jump JSInterfaceJIT::emitJumpIfNotJSCell(VirtualRegister virtualRegister)
    74     {
    75         ASSERT(virtualRegister < VirtualRegister(FirstConstantRegisterIndex));
    76         return branch32(NotEqual, tagFor(virtualRegister), TrustedImm32(JSValue::CellTag));
    77     }
    78    
    7965    inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadInt32(VirtualRegister virtualRegister, RegisterID dst)
    8066    {
     
    9884        return notInt;
    9985    }
    100 
    101 #endif
    102 
    103 #if USE(JSVALUE64)
     86#elif USE(JSVALUE64)
    10487    inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadJSCell(VirtualRegister virtualRegister, RegisterID dst)
    10588    {
     
    10790        return branchIfNotCell(dst);
    10891    }
    109    
     92
    11093    inline JSInterfaceJIT::Jump JSInterfaceJIT::emitLoadInt32(VirtualRegister virtualRegister, RegisterID dst)
    11194    {
     
    130113#endif
    131114
    132     ALWAYS_INLINE void JSInterfaceJIT::emitGetFromCallFrameHeaderPtr(VirtualRegister entry, RegisterID to, RegisterID from)
    133     {
    134         loadPtr(Address(from, entry.offset() * sizeof(Register)), to);
    135     }
    136 
    137     ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(RegisterID from, VirtualRegister entry)
    138     {
    139 #if USE(JSVALUE32_64)
    140         storePtr(from, payloadFor(entry));
    141 #else
    142         store64(from, addressFor(entry));
    143 #endif
    144     }
    145 
    146     ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, VirtualRegister entry)
    147     {
    148         storePtr(TrustedImmPtr(value), addressFor(entry));
    149     }
    150 
    151     ALWAYS_INLINE void JSInterfaceJIT::emitPutCellToCallFrameHeader(RegisterID from, VirtualRegister entry)
    152     {
    153 #if USE(JSVALUE32_64)
    154         store32(TrustedImm32(JSValue::CellTag), tagFor(entry));
    155         store32(from, payloadFor(entry));
    156 #else
    157         store64(from, addressFor(entry));
    158 #endif
    159     }
    160 
    161115} // namespace JSC
    162116
Note: See TracChangeset for help on using the changeset viewer.