Ignore:
Timestamp:
Apr 20, 2022, 12:54:47 AM (3 years ago)
Author:
Mikhail R. Gadelha
Message:

Unify calls and checks for CellTag
https://bugs.webkit.org/show_bug.cgi?id=238025

Reviewed by Yusuke Suzuki.

This patch moves all the places where cell tags are written and checked
when branching: this will be needed when implementing the concurrency on
32 bits archs, so we can focus on changing storeCell, branchIfNotCell and
branchIfCell to implement the mutex locks/unlocks.

It also reduces the code size in JetStream2 by ~1% on average on 32
bits platforms.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::store8):
(JSC::MacroAssemblerARMv7::storePair32):

  • assembler/MacroAssemblerMIPS.h:

(JSC::MacroAssemblerMIPS::storePair32):

  • dfg/DFGOSRExit.cpp:

(JSC::DFG::OSRExit::compileExit):

  • dfg/DFGOSRExitCompilerCommon.cpp:

(JSC::DFG::reifyInlinedCallFrames):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::checkArgumentTypes):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::compilePeepHoleObjectStrictEquality):

  • jit/AssemblyHelpers.cpp:

(JSC::AssemblyHelpers::jitAssertIsCell):

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::storeCell):
(JSC::AssemblyHelpers::storeTrustedValue):
(JSC::AssemblyHelpers::branchIfNotCell):
(JSC::AssemblyHelpers::branchIfCell):

  • jit/CallFrameShuffler32_64.cpp:

(JSC::CallFrameShuffler::emitStore):

  • jit/JSInterfaceJIT.h:

(JSC::JSInterfaceJIT::emitLoadJSCell):

File:
1 edited

Legend:

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

    r292540 r293087  
    10591059    }
    10601060   
    1061     void store8(RegisterID src, const void *address)
     1061    void store8(RegisterID src, const void* address)
    10621062    {
    10631063        store8(src, setupArmAddress(AbsoluteAddress(address)));
    10641064    }
    10651065   
    1066     void store8(TrustedImm32 imm, const void *address)
     1066    void store8(TrustedImm32 imm, const void* address)
    10671067    {
    10681068        TrustedImm32 imm8(static_cast<int8_t>(imm.m_value));
     
    11021102        move(imm, dataTempRegister);
    11031103        store16(dataTempRegister, address);
     1104    }
     1105
     1106    void storePair32(RegisterID src1, TrustedImm32 imm, Address address)
     1107    {
     1108        RegisterID scratch = getCachedDataTempRegisterIDAndInvalidate();
     1109        move(imm, scratch);
     1110        storePair32(src1, scratch, address);
     1111    }
     1112
     1113    void storePair32(TrustedImmPtr immPtr, TrustedImm32 imm32, Address address)
     1114    {
     1115        RegisterID scratch1 = getCachedAddressTempRegisterIDAndInvalidate();
     1116        move(immPtr, scratch1);
     1117        RegisterID scratch2 = getCachedDataTempRegisterIDAndInvalidate();
     1118        move(imm32, scratch2);
     1119        storePair32(scratch1, scratch2, address);
     1120    }
     1121
     1122    void storePair32(TrustedImm32 imm1, TrustedImm32 imm2, Address address)
     1123    {
     1124        RegisterID scratch1 = getCachedAddressTempRegisterIDAndInvalidate();
     1125        move(imm1, scratch1);
     1126        RegisterID scratch2 = scratch1;
     1127        if (imm1.m_value != imm2.m_value) {
     1128            scratch2 = getCachedDataTempRegisterIDAndInvalidate();
     1129            move(imm2, scratch2);
     1130        }
     1131        storePair32(scratch1, scratch2, address);
    11041132    }
    11051133
     
    11391167        }
    11401168        storePair32(src1, src2, Address(scratch, address.offset));
     1169    }
     1170
     1171    void storePair32(TrustedImm32 imm1, TrustedImm32 imm2, BaseIndex address)
     1172    {
     1173        // We don't have enough temp registers to move both imm and calculate the address
     1174        store32(imm1, address);
     1175        store32(imm2, address.withOffset(4));
     1176    }
     1177
     1178    void storePair32(RegisterID src1, TrustedImm32 imm, const void* address)
     1179    {
     1180        ArmAddress armAddress = setupArmAddress(AbsoluteAddress(address));
     1181        ASSERT(armAddress.type == ArmAddress::HasOffset);
     1182        RegisterID scratch = getCachedDataTempRegisterIDAndInvalidate();
     1183        move(imm, scratch);
     1184        storePair32(src1, scratch, Address(armAddress.base, armAddress.u.offset));
    11411185    }
    11421186
Note: See TracChangeset for help on using the changeset viewer.