Ignore:
Timestamp:
Jul 5, 2011, 6:30:53 PM (14 years ago)
Author:
[email protected]
Message:

2011-07-05 Oliver Hunt <[email protected]>

Force inlining of simple functions that show up as not being inlined
https://bugs.webkit.org/show_bug.cgi?id=63964

Reviewed by Gavin Barraclough.

Looking at profile data indicates the gcc is failing to inline a
number of trivial functions. This patch hits the ones that show
up in profiles with the ALWAYS_INLINE hammer.

We also replace the memcpy() call in linking with a manual loop.
Apparently memcpy() is almost never faster than an inlined loop.

  • assembler/ARMv7Assembler.h: (JSC::ARMv7Assembler::add): (JSC::ARMv7Assembler::add_S): (JSC::ARMv7Assembler::ARM_and): (JSC::ARMv7Assembler::asr): (JSC::ARMv7Assembler::b): (JSC::ARMv7Assembler::blx): (JSC::ARMv7Assembler::bx): (JSC::ARMv7Assembler::clz): (JSC::ARMv7Assembler::cmn): (JSC::ARMv7Assembler::cmp): (JSC::ARMv7Assembler::eor): (JSC::ARMv7Assembler::it): (JSC::ARMv7Assembler::ldr): (JSC::ARMv7Assembler::ldrCompact): (JSC::ARMv7Assembler::ldrh): (JSC::ARMv7Assembler::ldrb): (JSC::ARMv7Assembler::lsl): (JSC::ARMv7Assembler::lsr): (JSC::ARMv7Assembler::movT3): (JSC::ARMv7Assembler::mov): (JSC::ARMv7Assembler::movt): (JSC::ARMv7Assembler::mvn): (JSC::ARMv7Assembler::neg): (JSC::ARMv7Assembler::orr): (JSC::ARMv7Assembler::orr_S): (JSC::ARMv7Assembler::ror): (JSC::ARMv7Assembler::smull): (JSC::ARMv7Assembler::str): (JSC::ARMv7Assembler::sub): (JSC::ARMv7Assembler::sub_S): (JSC::ARMv7Assembler::tst): (JSC::ARMv7Assembler::linkRecordSourceComparator): (JSC::ARMv7Assembler::link): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp5Reg3Imm8): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp5Imm5Reg3Reg3): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp7Reg3Reg3Reg3): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp8Imm8): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp8RegReg143): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp9Imm7): (JSC::ARMv7Assembler::ARMInstructionFormatter::oneWordOp10Reg3Reg3): (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp12Reg4FourFours): (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp16FourFours): (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp16Op16): (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp5i6Imm4Reg4EncodedImm): (JSC::ARMv7Assembler::ARMInstructionFormatter::twoWordOp12Reg4Reg4Imm12): (JSC::ARMv7Assembler::ARMInstructionFormatter::vfpOp): (JSC::ARMv7Assembler::ARMInstructionFormatter::vfpMemOp):
  • assembler/LinkBuffer.h: (JSC::LinkBuffer::linkCode):
  • assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::nearCall): (JSC::MacroAssemblerARMv7::call): (JSC::MacroAssemblerARMv7::ret): (JSC::MacroAssemblerARMv7::moveWithPatch): (JSC::MacroAssemblerARMv7::branchPtrWithPatch): (JSC::MacroAssemblerARMv7::storePtrWithPatch): (JSC::MacroAssemblerARMv7::tailRecursiveCall): (JSC::MacroAssemblerARMv7::makeTailRecursiveCall): (JSC::MacroAssemblerARMv7::jump): (JSC::MacroAssemblerARMv7::makeBranch):
File:
1 edited

Legend:

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

    r90237 r90426  
    11271127    }
    11281128
    1129     Call nearCall()
     1129    ALWAYS_INLINE Call nearCall()
    11301130    {
    11311131        moveFixedWidthEncoding(TrustedImm32(0), dataTempRegister);
     
    11331133    }
    11341134
    1135     Call call()
     1135    ALWAYS_INLINE Call call()
    11361136    {
    11371137        moveFixedWidthEncoding(TrustedImm32(0), dataTempRegister);
     
    11391139    }
    11401140
    1141     Call call(RegisterID target)
     1141    ALWAYS_INLINE Call call(RegisterID target)
    11421142    {
    11431143        return Call(m_assembler.blx(target), Call::None);
    11441144    }
    11451145
    1146     Call call(Address address)
     1146    ALWAYS_INLINE Call call(Address address)
    11471147    {
    11481148        load32(address, dataTempRegister);
     
    11501150    }
    11511151
    1152     void ret()
     1152    ALWAYS_INLINE void ret()
    11531153    {
    11541154        m_assembler.bx(linkRegister);
     
    11991199    }
    12001200
    1201     DataLabel32 moveWithPatch(TrustedImm32 imm, RegisterID dst)
     1201    ALWAYS_INLINE DataLabel32 moveWithPatch(TrustedImm32 imm, RegisterID dst)
    12021202    {
    12031203        moveFixedWidthEncoding(imm, dst);
     
    12051205    }
    12061206
    1207     DataLabelPtr moveWithPatch(TrustedImmPtr imm, RegisterID dst)
     1207    ALWAYS_INLINE DataLabelPtr moveWithPatch(TrustedImmPtr imm, RegisterID dst)
    12081208    {
    12091209        moveFixedWidthEncoding(TrustedImm32(imm), dst);
     
    12111211    }
    12121212
    1213     Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
     1213    ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, RegisterID left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
    12141214    {
    12151215        dataLabel = moveWithPatch(initialRightValue, dataTempRegister);
     
    12171217    }
    12181218
    1219     Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
     1219    ALWAYS_INLINE Jump branchPtrWithPatch(RelationalCondition cond, Address left, DataLabelPtr& dataLabel, TrustedImmPtr initialRightValue = TrustedImmPtr(0))
    12201220    {
    12211221        load32(left, addressTempRegister);
     
    12241224    }
    12251225
    1226     DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
     1226    ALWAYS_INLINE DataLabelPtr storePtrWithPatch(TrustedImmPtr initialValue, ImplicitAddress address)
    12271227    {
    12281228        DataLabelPtr label = moveWithPatch(initialValue, dataTempRegister);
     
    12301230        return label;
    12311231    }
    1232     DataLabelPtr storePtrWithPatch(ImplicitAddress address) { return storePtrWithPatch(TrustedImmPtr(0), address); }
    1233 
    1234 
    1235     Call tailRecursiveCall()
     1232    ALWAYS_INLINE DataLabelPtr storePtrWithPatch(ImplicitAddress address) { return storePtrWithPatch(TrustedImmPtr(0), address); }
     1233
     1234
     1235    ALWAYS_INLINE Call tailRecursiveCall()
    12361236    {
    12371237        // Like a normal call, but don't link.
     
    12401240    }
    12411241
    1242     Call makeTailRecursiveCall(Jump oldJump)
     1242    ALWAYS_INLINE Call makeTailRecursiveCall(Jump oldJump)
    12431243    {
    12441244        oldJump.link(this);
     
    12581258    }
    12591259
    1260     Jump jump()
     1260    ALWAYS_INLINE Jump jump()
    12611261    {
    12621262        moveFixedWidthEncoding(TrustedImm32(0), dataTempRegister);
     
    12641264    }
    12651265
    1266     Jump makeBranch(ARMv7Assembler::Condition cond)
     1266    ALWAYS_INLINE Jump makeBranch(ARMv7Assembler::Condition cond)
    12671267    {
    12681268        m_assembler.it(cond, true, true);
     
    12701270        return Jump(m_assembler.bx(dataTempRegister), inUninterruptedSequence() ? ARMv7Assembler::JumpConditionFixedSize : ARMv7Assembler::JumpCondition, cond);
    12711271    }
    1272     Jump makeBranch(RelationalCondition cond) { return makeBranch(armV7Condition(cond)); }
    1273     Jump makeBranch(ResultCondition cond) { return makeBranch(armV7Condition(cond)); }
    1274     Jump makeBranch(DoubleCondition cond) { return makeBranch(armV7Condition(cond)); }
     1272    ALWAYS_INLINE Jump makeBranch(RelationalCondition cond) { return makeBranch(armV7Condition(cond)); }
     1273    ALWAYS_INLINE Jump makeBranch(ResultCondition cond) { return makeBranch(armV7Condition(cond)); }
     1274    ALWAYS_INLINE Jump makeBranch(DoubleCondition cond) { return makeBranch(armV7Condition(cond)); }
    12751275
    12761276    ArmAddress setupArmAddress(BaseIndex address)
Note: See TracChangeset for help on using the changeset viewer.