Ignore:
Timestamp:
Nov 4, 2019, 3:47:07 PM (6 years ago)
Author:
Truitt Savell
Message:

Unreviewed, rolling out r252015.

Broke the Windows build

Reverted changeset:

"Split ArithProfile into a Unary and a Binary version"
https://bugs.webkit.org/show_bug.cgi?id=202832
https://trac.webkit.org/changeset/252015

File:
1 edited

Legend:

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

    r252015 r252021  
    5353#define ENABLE_MATH_IC_STATS 0
    5454
    55 template <typename GeneratorType, typename ArithProfileType>
     55template <typename GeneratorType, bool(*isProfileEmpty)(ArithProfile&)>
    5656class JITMathIC {
    5757    WTF_MAKE_FAST_ALLOCATED;
    5858public:
    59     JITMathIC(ArithProfileType* arithProfile)
     59    JITMathIC(ArithProfile* arithProfile)
    6060        : m_arithProfile(arithProfile)
    6161    {
     
    7272
    7373        if (m_arithProfile) {
    74             if (m_arithProfile->isObservedTypeEmpty()) {
     74            if (isProfileEmpty(*m_arithProfile)) {
    7575                // It looks like the MathIC has yet to execute. We don't want to emit code in this
    7676                // case for a couple reasons. First, the operation may never execute, so if we don't emit
     
    224224    }
    225225
    226     ArithProfileType* arithProfile() const { return m_arithProfile; }
     226    ArithProfile* arithProfile() const { return m_arithProfile; }
    227227
    228228#if ENABLE(MATH_IC_STATS)
     
    237237#endif
    238238
    239     ArithProfileType* m_arithProfile;
     239    ArithProfile* m_arithProfile;
    240240    MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code;
    241241    CodeLocationLabel<JSInternalPtrTag> m_inlineStart;
     
    247247};
    248248
     249inline bool isBinaryProfileEmpty(ArithProfile& arithProfile)
     250{
     251    return arithProfile.lhsObservedType().isEmpty() || arithProfile.rhsObservedType().isEmpty();
     252}
    249253template <typename GeneratorType>
    250 class JITBinaryMathIC : public JITMathIC<GeneratorType, BinaryArithProfile> {
     254class JITBinaryMathIC : public JITMathIC<GeneratorType, isBinaryProfileEmpty> {
    251255public:
    252     JITBinaryMathIC(BinaryArithProfile* arithProfile)
    253         : JITMathIC<GeneratorType, BinaryArithProfile>(arithProfile)
     256    JITBinaryMathIC(ArithProfile* arithProfile)
     257        : JITMathIC<GeneratorType, isBinaryProfileEmpty>(arithProfile)
    254258    {
    255259    }
     
    260264typedef JITBinaryMathIC<JITSubGenerator> JITSubIC;
    261265
     266
     267inline bool isUnaryProfileEmpty(ArithProfile& arithProfile)
     268{
     269    return arithProfile.lhsObservedType().isEmpty();
     270}
    262271template <typename GeneratorType>
    263 class JITUnaryMathIC : public JITMathIC<GeneratorType, UnaryArithProfile> {
     272class JITUnaryMathIC : public JITMathIC<GeneratorType, isUnaryProfileEmpty> {
    264273public:
    265     JITUnaryMathIC(UnaryArithProfile* arithProfile)
    266         : JITMathIC<GeneratorType, UnaryArithProfile>(arithProfile)
     274    JITUnaryMathIC(ArithProfile* arithProfile)
     275        : JITMathIC<GeneratorType, isUnaryProfileEmpty>(arithProfile)
    267276    {
    268277    }
Note: See TracChangeset for help on using the changeset viewer.