Changeset 149349 in webkit


Ignore:
Timestamp:
Apr 29, 2013 7:55:18 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[ARM] Expand the use of integer division
https://bugs.webkit.org/show_bug.cgi?id=115138

Patch by Cosmin Truta <ctruta@blackberry.com> on 2013-04-29
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

If availability of hardware integer division isn't known at compile
time, check the CPU flags and decide at runtime whether to fall back
to software. Currently, this OS-specific check is implemented on QNX.

Moreover, use operator % instead of fmod() in the calculation of the
software modulo. Even when it's software-emulated, operator % is faster
than fmod(): on ARM v7 QNX, without hardware division, we noticed

3% speedup on SunSpider.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • assembler/ARMv7Assembler.h:

(JSC::ARMv7Assembler::sdiv): Did not compile conditionally.
(JSC::ARMv7Assembler::udiv): Ditto.

  • assembler/AbstractMacroAssembler.h:

(JSC::isARMv7s): Removed.

  • assembler/MacroAssemblerARMv7.cpp: Added.

(JSC::isIntegerDivSupported): Added.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::supportsIntegerDiv): Added.

  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode): Checked MacroAssembler::supportsIntegerDiv() in ArithDiv case.

  • dfg/DFGOperations.cpp:

(JSC::DFG::operationModOnInts): Added.

  • dfg/DFGOperations.h:

(JSC::DFG::Z_DFGOperation_ZZ): Added.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileSoftModulo): Separated the X86-specific and ARM-specific codegen
from the common implementation; used operationModOnInts on ARM.
(JSC::DFG::SpeculativeJIT::compileIntegerArithDivForARM): Renamed from compileIntegerArithDivForARMv7.
(JSC::DFG::SpeculativeJIT::compileArithMod): Allowed run-time detection of integer div on ARM.

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::callOperation): Added overloads with Z_DFGOperation_ZZ arguments.

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile): Used compileIntegerArithDivForARM.

Source/WTF:

  • wtf/Platform.h: Added ENABLE_ARM_INTEGER_DIV.
Location:
trunk/Source
Files:
1 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/CMakeLists.txt

    r148696 r149349  
    518518        assembler/ARMv7Assembler.cpp
    519519        assembler/MacroAssemblerARM.cpp
     520        assembler/MacroAssemblerARMv7.cpp
    520521    )
    521522elseif (WTF_CPU_MIPS)
  • trunk/Source/JavaScriptCore/ChangeLog

    r149344 r149349  
     12013-04-29  Cosmin Truta  <ctruta@blackberry.com>
     2
     3        [ARM] Expand the use of integer division
     4        https://bugs.webkit.org/show_bug.cgi?id=115138
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        If availability of hardware integer division isn't known at compile
     9        time, check the CPU flags and decide at runtime whether to fall back
     10        to software. Currently, this OS-specific check is implemented on QNX.
     11
     12        Moreover, use operator % instead of fmod() in the calculation of the
     13        software modulo. Even when it's software-emulated, operator % is faster
     14        than fmod(): on ARM v7 QNX, without hardware division, we noticed
     15        >3% speedup on SunSpider.
     16
     17        * CMakeLists.txt:
     18        * GNUmakefile.list.am:
     19        * JavaScriptCore.xcodeproj/project.pbxproj:
     20        * assembler/ARMv7Assembler.h:
     21        (JSC::ARMv7Assembler::sdiv): Did not compile conditionally.
     22        (JSC::ARMv7Assembler::udiv): Ditto.
     23        * assembler/AbstractMacroAssembler.h:
     24        (JSC::isARMv7s): Removed.
     25        * assembler/MacroAssemblerARMv7.cpp: Added.
     26        (JSC::isIntegerDivSupported): Added.
     27        * assembler/MacroAssemblerARMv7.h:
     28        (JSC::MacroAssemblerARMv7::supportsIntegerDiv): Added.
     29        * dfg/DFGFixupPhase.cpp:
     30        (JSC::DFG::FixupPhase::fixupNode): Checked MacroAssembler::supportsIntegerDiv() in ArithDiv case.
     31        * dfg/DFGOperations.cpp:
     32        (JSC::DFG::operationModOnInts): Added.
     33        * dfg/DFGOperations.h:
     34        (JSC::DFG::Z_DFGOperation_ZZ): Added.
     35        * dfg/DFGSpeculativeJIT.cpp:
     36        (JSC::DFG::SpeculativeJIT::compileSoftModulo): Separated the X86-specific and ARM-specific codegen
     37        from the common implementation; used operationModOnInts on ARM.
     38        (JSC::DFG::SpeculativeJIT::compileIntegerArithDivForARM): Renamed from compileIntegerArithDivForARMv7.
     39        (JSC::DFG::SpeculativeJIT::compileArithMod): Allowed run-time detection of integer div on ARM.
     40        * dfg/DFGSpeculativeJIT.h:
     41        (JSC::DFG::SpeculativeJIT::callOperation): Added overloads with Z_DFGOperation_ZZ arguments.
     42        * dfg/DFGSpeculativeJIT32_64.cpp:
     43        (JSC::DFG::SpeculativeJIT::compile): Used compileIntegerArithDivForARM.
     44
    1452013-04-29  Benjamin Poulain  <benjamin@webkit.org>
    246
  • trunk/Source/JavaScriptCore/GNUmakefile.list.am

    r149277 r149349  
    7474        Source/JavaScriptCore/assembler/MacroAssemblerARM.cpp \
    7575        Source/JavaScriptCore/assembler/MacroAssemblerARM.h \
     76        Source/JavaScriptCore/assembler/MacroAssemblerARMv7.cpp \
    7677        Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h \
    7778        Source/JavaScriptCore/assembler/MacroAssemblerCodeRef.h \
  • trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r148696 r149349  
    575575                86C568E111A213EE0007F7F0 /* MacroAssemblerMIPS.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DE11A213EE0007F7F0 /* MacroAssemblerMIPS.h */; settings = {ATTRIBUTES = (Private, ); }; };
    576576                86C568E211A213EE0007F7F0 /* MIPSAssembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86C568DF11A213EE0007F7F0 /* MIPSAssembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
     577                86C568E4FB92867A16FD1002 /* MacroAssemblerARMv7.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86C568E3FB92867A16FD1002 /* MacroAssemblerARMv7.cpp */; };
    577578                86CA032E1038E8440028A609 /* Executable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 86CA032D1038E8440028A609 /* Executable.cpp */; };
    578579                86CAFEE31035DDE60028A609 /* Executable.h in Headers */ = {isa = PBXBuildFile; fileRef = 86CAFEE21035DDE60028A609 /* Executable.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    14781479                86C568DE11A213EE0007F7F0 /* MacroAssemblerMIPS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacroAssemblerMIPS.h; sourceTree = "<group>"; };
    14791480                86C568DF11A213EE0007F7F0 /* MIPSAssembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MIPSAssembler.h; sourceTree = "<group>"; };
     1481                86C568E3FB92867A16FD1002 /* MacroAssemblerARMv7.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MacroAssemblerARMv7.cpp; sourceTree = "<group>"; };
    14801482                86CA032D1038E8440028A609 /* Executable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Executable.cpp; sourceTree = "<group>"; };
    14811483                86CAFEE21035DDE60028A609 /* Executable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Executable.h; sourceTree = "<group>"; };
     
    28462848                                86C568DD11A213EE0007F7F0 /* MacroAssemblerARM.cpp */,
    28472849                                86D3B2C210156BDE002865E7 /* MacroAssemblerARM.h */,
     2850                                86C568E3FB92867A16FD1002 /* MacroAssemblerARMv7.cpp */,
    28482851                                86ADD1440FDDEA980006EEC2 /* MacroAssemblerARMv7.h */,
    28492852                                863B23DF0FC60E6200703AA4 /* MacroAssemblerCodeRef.h */,
     
    39783981                                0FEB3ECF16237F6C00AB67AD /* MacroAssembler.cpp in Sources */,
    39793982                                86C568E011A213EE0007F7F0 /* MacroAssemblerARM.cpp in Sources */,
     3983                                86C568E4FB92867A16FD1002 /* MacroAssemblerARMv7.cpp in Sources */,
    39803984                                86AE64A8135E5E1C00963012 /* MacroAssemblerSH4.cpp in Sources */,
    39813985                                C2B916C514DA040C00CBAC86 /* MarkedAllocator.cpp in Sources */,
  • trunk/Source/JavaScriptCore/assembler/ARMv7Assembler.h

    r148942 r149349  
    662662        OP_CLZ          = 0xFAB0,
    663663        OP_SMULL_T1     = 0xFB80,
    664 #if CPU(APPLE_ARMV7S)
    665664        OP_SDIV_T1      = 0xFB90,
    666665        OP_UDIV_T1      = 0xFBB0,
    667 #endif
    668666    } OpcodeID1;
    669667
     
    14081406    }
    14091407
    1410 #if CPU(APPLE_ARMV7S)
    14111408    ALWAYS_INLINE void sdiv(RegisterID rd, RegisterID rn, RegisterID rm)
    14121409    {
     
    14161413        m_formatter.twoWordOp12Reg4FourFours(OP_SDIV_T1, rn, FourFours(0xf, rd, 0xf, rm));
    14171414    }
    1418 #endif
    14191415
    14201416    ALWAYS_INLINE void smull(RegisterID rdLo, RegisterID rdHi, RegisterID rn, RegisterID rm)
     
    17541750    }
    17551751
    1756 #if CPU(APPLE_ARMV7S)
    17571752    ALWAYS_INLINE void udiv(RegisterID rd, RegisterID rn, RegisterID rm)
    17581753    {
     
    17621757        m_formatter.twoWordOp12Reg4FourFours(OP_UDIV_T1, rn, FourFours(0xf, rd, 0xf, rm));
    17631758    }
    1764 #endif
    17651759
    17661760    void vadd(FPDoubleRegisterID rd, FPDoubleRegisterID rn, FPDoubleRegisterID rm)
  • trunk/Source/JavaScriptCore/assembler/AbstractMacroAssembler.h

    r149082 r149349  
    4747namespace JSC {
    4848
    49 inline bool isARMv7s()
    50 {
    51 #if CPU(APPLE_ARMV7S)
    52     return true;
    53 #else
    54     return false;
    55 #endif
    56 }
    57 
    5849inline bool isX86()
    5950{
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h

    r149152 r149349  
    794794#endif
    795795
    796     // Floating-point operations:
    797 
     796    // Integer operations.
     797    static bool supportsIntegerDiv()
     798    {
     799#if CPU(APPLE_ARMV7S)
     800        return true;
     801#elif OS(QNX)
     802        return s_isIntegerDivSupported;
     803#else
     804        return false;
     805#endif
     806    }
     807
     808    // Floating-point operations.
    798809    static bool supportsFloatingPoint() { return true; }
    799810    static bool supportsFloatingPointTruncate() { return true; }
     
    19081919
    19091920    bool m_makeJumpPatchable;
     1921
     1922#if OS(QNX)
     1923    static const bool s_isIntegerDivSupported;
     1924#endif
    19101925};
    19111926
  • trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp

    r149162 r149349  
    215215            if (Node::shouldSpeculateIntegerForArithmetic(node->child1().node(), node->child2().node())
    216216                && node->canSpeculateInteger()) {
    217                 if (isX86() || isARMv7s()) {
     217#if CPU(X86) || CPU(X86_64)
     218                const bool cpuSupportsIntegerDiv = true;
     219#elif CPU(ARM_THUMB2)
     220                const bool cpuSupportsIntegerDiv = MacroAssembler::supportsIntegerDiv();
     221#else
     222                const bool cpuSupportsIntegerDiv = false;
     223#endif
     224                if (cpuSupportsIntegerDiv) {
    218225                    setUseKindAndUnboxIfProfitable<Int32Use>(node->child1());
    219226                    setUseKindAndUnboxIfProfitable<Int32Use>(node->child2());
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.cpp

    r148696 r149349  
    4646#include "Operations.h"
    4747#include "StringConstructor.h"
     48#include <stdlib.h>
    4849#include <wtf/InlineASM.h>
    4950
     
    15991600
    16001601    return JSRopeString::create(vm, a, b, c);
     1602}
     1603
     1604int32_t DFG_OPERATION operationModOnInts(int32_t a, int32_t b)
     1605{
     1606    return a % b;
    16011607}
    16021608
  • trunk/Source/JavaScriptCore/dfg/DFGOperations.h

    r147985 r149349  
    9898typedef double DFG_OPERATION (*D_DFGOperation_EJ)(ExecState*, EncodedJSValue);
    9999typedef int32_t DFG_OPERATION (*Z_DFGOperation_D)(double);
     100typedef int32_t DFG_OPERATION (*Z_DFGOperation_ZZ)(int32_t, int32_t);
    100101typedef size_t DFG_OPERATION (*S_DFGOperation_ECC)(ExecState*, JSCell*, JSCell*);
    101102typedef size_t DFG_OPERATION (*S_DFGOperation_EJ)(ExecState*, EncodedJSValue);
     
    209210JSCell* DFG_OPERATION operationNewFunction(ExecState*, JSCell*) WTF_INTERNAL;
    210211JSCell* DFG_OPERATION operationNewFunctionExpression(ExecState*, JSCell*) WTF_INTERNAL;
     212int32_t DFG_OPERATION operationModOnInts(int32_t, int32_t) WTF_INTERNAL;
    211213double DFG_OPERATION operationFModOnInts(int32_t, int32_t) WTF_INTERNAL;
    212214size_t DFG_OPERATION operationIsObject(ExecState*, EncodedJSValue) WTF_INTERNAL;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r149159 r149349  
    28782878}
    28792879
     2880#if CPU(X86) || CPU(X86_64)
    28802881void SpeculativeJIT::compileSoftModulo(Node* node)
    28812882{
     
    28832884    // (in case of |dividend| < |divisor|), so we speculate it as strict int32.
    28842885    SpeculateStrictInt32Operand op1(this, node->child1());
    2885 #if CPU(X86) || CPU(X86_64)
    28862886    if (isInt32Constant(node->child2().node())) {
    28872887        int32_t divisor = valueOfInt32Constant(node->child2().node());
     
    29232923        }
    29242924    }
    2925 #elif CPU(APPLE_ARMV7S) || CPU(ARM_THUMB2)
    2926     if (isInt32Constant(node->child2().node())) {
    2927         int32_t divisor = valueOfInt32Constant(node->child2().node());
    2928         if (divisor > 0 && hasOneBitSet(divisor)) { // If power of 2 then just mask
    2929             GPRReg dividendGPR = op1.gpr();
    2930             GPRTemporary result(this);
    2931             GPRReg resultGPR = result.gpr();
    2932 
    2933             m_jit.assembler().cmp(dividendGPR, ARMThumbImmediate::makeEncodedImm(0));
    2934             m_jit.assembler().it(ARMv7Assembler::ConditionLT, false);
    2935             m_jit.assembler().neg(resultGPR, dividendGPR);
    2936             m_jit.assembler().mov(resultGPR, dividendGPR);
    2937             m_jit.and32(TrustedImm32(divisor - 1), resultGPR);
    2938             m_jit.assembler().it(ARMv7Assembler::ConditionLT);
    2939             m_jit.assembler().neg(resultGPR, resultGPR);
    2940 
    2941             if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
    2942                 // Check that we're not about to create negative zero.
    2943                 JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
    2944                 speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, resultGPR));
    2945                 numeratorPositive.link(&m_jit);
    2946             }
    2947             integerResult(resultGPR, node);
    2948             return;
    2949         }
    2950     }
    2951 #endif
    29522925
    29532926    SpeculateIntegerOperand op2(this, node->child2());
    2954 #if CPU(X86) || CPU(X86_64)
     2927
    29552928    GPRTemporary eax(this, X86Registers::eax);
    29562929    GPRTemporary edx(this, X86Registers::edx);
     
    30172990    if (op1SaveGPR != op1GPR)
    30182991        unlock(op1SaveGPR);
    3019            
     2992
    30202993    integerResult(edx.gpr(), node);
    3021 
    3022 #elif CPU(APPLE_ARMV7S)
    3023     GPRTemporary temp(this);
    3024     GPRTemporary quotientThenRemainder(this);
    3025     GPRTemporary multiplyAnswer(this);
     2994}
     2995#elif CPU(ARM_THUMB2)
     2996void SpeculativeJIT::compileSoftModulo(Node* node)
     2997{
     2998    // In the fast path, the dividend value could be the final result
     2999    // (in case of |dividend| < |divisor|), so we speculate it as strict int32.
     3000    SpeculateStrictInt32Operand op1(this, node->child1());
     3001    if (isInt32Constant(node->child2().node())) {
     3002        int32_t divisor = valueOfInt32Constant(node->child2().node());
     3003        if (divisor > 0 && hasOneBitSet(divisor)) { // If power of 2 then just mask
     3004            GPRReg dividendGPR = op1.gpr();
     3005            GPRTemporary result(this);
     3006            GPRReg resultGPR = result.gpr();
     3007
     3008            m_jit.assembler().cmp(dividendGPR, ARMThumbImmediate::makeEncodedImm(0));
     3009            m_jit.assembler().it(ARMv7Assembler::ConditionLT, false);
     3010            m_jit.assembler().neg(resultGPR, dividendGPR);
     3011            m_jit.assembler().mov(resultGPR, dividendGPR);
     3012            m_jit.and32(TrustedImm32(divisor - 1), resultGPR);
     3013            m_jit.assembler().it(ARMv7Assembler::ConditionLT);
     3014            m_jit.assembler().neg(resultGPR, resultGPR);
     3015
     3016            if (!nodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
     3017                // Check that we're not about to create negative zero.
     3018                JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
     3019                speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, resultGPR));
     3020                numeratorPositive.link(&m_jit);
     3021            }
     3022            integerResult(resultGPR, node);
     3023            return;
     3024        }
     3025    }
     3026
     3027    SpeculateIntegerOperand op2(this, node->child2());
     3028
    30263029    GPRReg dividendGPR = op1.gpr();
    30273030    GPRReg divisorGPR = op2.gpr();
    3028     GPRReg quotientThenRemainderGPR = quotientThenRemainder.gpr();
    3029     GPRReg multiplyAnswerGPR = multiplyAnswer.gpr();
    3030 
    3031     m_jit.assembler().sdiv(quotientThenRemainderGPR, dividendGPR, divisorGPR);
    3032     speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, quotientThenRemainderGPR, divisorGPR, multiplyAnswerGPR));
    3033     m_jit.assembler().sub(quotientThenRemainderGPR, dividendGPR, multiplyAnswerGPR);
     3031
     3032    GPRResult result(this);
     3033    GPRReg resultGPR = result.gpr();
     3034
     3035    if (MacroAssembler::supportsIntegerDiv()) {
     3036        GPRTemporary multiplyAnswer(this);
     3037        GPRReg multiplyAnswerGPR = multiplyAnswer.gpr();
     3038        m_jit.assembler().sdiv(resultGPR, dividendGPR, divisorGPR);
     3039        speculationCheck(Overflow, JSValueRegs(), 0, m_jit.branchMul32(JITCompiler::Overflow, resultGPR, divisorGPR, multiplyAnswerGPR));
     3040        m_jit.assembler().sub(resultGPR, dividendGPR, multiplyAnswerGPR);
     3041    } else {
     3042        flushRegisters();
     3043        callOperation(operationModOnInts, resultGPR, dividendGPR, divisorGPR);
     3044    }
    30343045
    30353046    // If the user cares about negative zero, then speculate that we're not about
     
    30383049        // Check that we're not about to create negative zero.
    30393050        JITCompiler::Jump numeratorPositive = m_jit.branch32(JITCompiler::GreaterThanOrEqual, dividendGPR, TrustedImm32(0));
    3040         speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, quotientThenRemainderGPR));
     3051        speculationCheck(NegativeZero, JSValueRegs(), 0, m_jit.branchTest32(JITCompiler::Zero, resultGPR));
    30413052        numeratorPositive.link(&m_jit);
    30423053    }
    30433054
    3044     integerResult(quotientThenRemainderGPR, node);
    3045 #else // not architecture that can do integer division
     3055    integerResult(resultGPR, node);
     3056}
     3057#else // CPU type without integer division
     3058void SpeculativeJIT::compileSoftModulo(Node* node)
     3059{
     3060    SpeculateStrictInt32Operand op1(this, node->child1());
     3061    SpeculateIntegerOperand op2(this, node->child2());
     3062
    30463063    // Do this the *safest* way possible: call out to a C function that will do the modulo,
    30473064    // and then attempt to convert back.
    3048     GPRReg op1GPR = op1.gpr();
    3049     GPRReg op2GPR = op2.gpr();
    3050    
     3065    GPRReg dividendGPR = op1.gpr();
     3066    GPRReg divisorGPR = op2.gpr();
     3067
    30513068    FPRResult result(this);
    3052    
     3069
    30533070    flushRegisters();
    3054     callOperation(operationFModOnInts, result.fpr(), op1GPR, op2GPR);
    3055    
     3071    callOperation(operationFModOnInts, result.fpr(), dividendGPR, divisorGPR);
     3072
    30563073    FPRTemporary scratch(this);
    30573074    GPRTemporary intResult(this);
     
    30653082        numeratorPositive.link(&m_jit);
    30663083    }
    3067    
     3084
    30683085    integerResult(intResult.gpr(), node);
    3069 #endif // CPU(X86) || CPU(X86_64)
    3070 }
     3086}
     3087#endif
    30713088
    30723089void SpeculativeJIT::compileAdd(Node* node)
     
    34773494    integerResult(eax.gpr(), node);
    34783495}
    3479 #elif CPU(APPLE_ARMV7S)
    3480 void SpeculativeJIT::compileIntegerArithDivForARMv7s(Node* node)
     3496#elif ENABLE(ARM_INTEGER_DIV)
     3497void SpeculativeJIT::compileIntegerArithDivForARM(Node* node)
    34813498{
    34823499    SpeculateIntegerOperand op1(this, node->child1());
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r149159 r149349  
    11111111        return call;
    11121112    }
     1113    JITCompiler::Call callOperation(Z_DFGOperation_ZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
     1114    {
     1115        m_jit.setupArguments(arg1, arg2);
     1116        JITCompiler::Call call = m_jit.appendCall(operation);
     1117        m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
     1118        return call;
     1119    }
    11131120    JITCompiler::Call callOperation(J_DFGOperation_EGriJsgI operation, GPRReg result, GPRReg arg1, GPRReg arg2, Identifier* identifier)
    11141121    {
     
    13121319        prepareForExternalCall();
    13131320        m_jit.setupArguments(arg1);
     1321        JITCompiler::Call call = m_jit.appendCall(operation);
     1322        m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
     1323        return call;
     1324    }
     1325    JITCompiler::Call callOperation(Z_DFGOperation_ZZ operation, GPRReg result, GPRReg arg1, GPRReg arg2)
     1326    {
     1327        m_jit.setupArguments(arg1, arg2);
    13141328        JITCompiler::Call call = m_jit.appendCall(operation);
    13151329        m_jit.zeroExtend32ToPtr(GPRInfo::returnValueGPR, result);
     
    19721986#if CPU(X86) || CPU(X86_64)
    19731987    void compileIntegerArithDivForX86(Node*);
    1974 #elif CPU(APPLE_ARMV7S)
    1975     void compileIntegerArithDivForARMv7s(Node*);
     1988#elif ENABLE(ARM_INTEGER_DIV)
     1989    void compileIntegerArithDivForARM(Node*);
    19761990#endif
    19771991    void compileArithMod(Node*);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r149159 r149349  
    22542254#if CPU(X86)
    22552255            compileIntegerArithDivForX86(node);
    2256 #elif CPU(APPLE_ARMV7S)
    2257             compileIntegerArithDivForARMv7s(node);
     2256#elif ENABLE(ARM_INTEGER_DIV)
     2257            ASSERT(MacroAssembler::supportsIntegerDiv());
     2258            compileIntegerArithDivForARM(node);
    22582259#else // CPU type without integer divide
    22592260            RELEASE_ASSERT_NOT_REACHED(); // should have been coverted into a double divide.
  • trunk/Source/WTF/ChangeLog

    r149341 r149349  
     12013-04-29  Cosmin Truta  <ctruta@blackberry.com>
     2
     3        [ARM] Expand the use of integer division
     4        https://bugs.webkit.org/show_bug.cgi?id=115138
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * wtf/Platform.h: Added ENABLE_ARM_INTEGER_DIV.
     9
    1102013-04-29  Anders Carlsson  <andersca@apple.com>
    211
  • trunk/Source/WTF/wtf/Platform.h

    r149293 r149349  
    927927#endif
    928928
     929#if CPU(APPLE_ARMV7S) || (CPU(ARM_THUMB2) && OS(QNX))
     930#define ENABLE_ARM_INTEGER_DIV 1
     931#endif
     932
    929933#define ENABLE_OBJECT_MARK_LOGGING 0
    930934
Note: See TracChangeset for help on using the changeset viewer.