Ignore:
Timestamp:
Oct 14, 2019, 3:52:11 PM (6 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r251090.
https://bugs.webkit.org/show_bug.cgi?id=202959

"broke tests" (Requested by RMorisset on #webkit).

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/251090

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/ArithProfile.cpp

    r251090 r251106  
    3333
    3434#if ENABLE(JIT)
    35 template<typename BitfieldType>
    36 void ArithProfile<BitfieldType>::emitObserveResult(CCallHelpers& jit, JSValueRegs regs, TagRegistersMode mode)
     35void ArithProfile::emitObserveResult(CCallHelpers& jit, JSValueRegs regs, TagRegistersMode mode)
    3736{
    3837    if (!shouldEmitSetDouble() && !shouldEmitSetNonNumeric() && !shouldEmitSetBigInt())
     
    6059}
    6160
    62 template<typename BitfieldType>
    63 bool ArithProfile<BitfieldType>::shouldEmitSetDouble() const
     61bool ArithProfile::shouldEmitSetDouble() const
    6462{
    65     uint32_t mask = Int32Overflow | Int52Overflow | NegZeroDouble | NonNegZeroDouble;
     63    uint32_t mask = ArithProfile::Int32Overflow | ArithProfile::Int52Overflow | ArithProfile::NegZeroDouble | ArithProfile::NonNegZeroDouble;
    6664    return (m_bits & mask) != mask;
    6765}
    6866
    69 template<typename BitfieldType>
    70 void ArithProfile<BitfieldType>::emitSetDouble(CCallHelpers& jit) const
     67void ArithProfile::emitSetDouble(CCallHelpers& jit) const
    7168{
    7269    if (shouldEmitSetDouble())
    73         jit.or32(CCallHelpers::TrustedImm32(Int32Overflow | Int52Overflow | NegZeroDouble | NonNegZeroDouble), CCallHelpers::AbsoluteAddress(addressOfBits()));
     70        jit.or32(CCallHelpers::TrustedImm32(ArithProfile::Int32Overflow | ArithProfile::Int52Overflow | ArithProfile::NegZeroDouble | ArithProfile::NonNegZeroDouble), CCallHelpers::AbsoluteAddress(addressOfBits()));
    7471}
    7572
    76 template<typename BitfieldType>
    77 bool ArithProfile<BitfieldType>::shouldEmitSetNonNumeric() const
     73bool ArithProfile::shouldEmitSetNonNumeric() const
    7874{
    7975    uint32_t mask = ArithProfile::NonNumeric;
     
    8177}
    8278
    83 template<typename BitfieldType>
    84 bool ArithProfile<BitfieldType>::shouldEmitSetBigInt() const
     79bool ArithProfile::shouldEmitSetBigInt() const
    8580{
    8681    uint32_t mask = ArithProfile::BigInt;
     
    8883}
    8984
    90 template<typename BitfieldType>
    91 void ArithProfile<BitfieldType>::emitSetNonNumeric(CCallHelpers& jit) const
     85void ArithProfile::emitSetNonNumeric(CCallHelpers& jit) const
    9286{
    9387    if (shouldEmitSetNonNumeric())
    94         jit.or32(CCallHelpers::TrustedImm32(NonNumeric), CCallHelpers::AbsoluteAddress(addressOfBits()));
     88        jit.or32(CCallHelpers::TrustedImm32(ArithProfile::NonNumeric), CCallHelpers::AbsoluteAddress(addressOfBits()));
    9589}
    9690
    97 template<typename BitfieldType>
    98 void ArithProfile<BitfieldType>::emitSetBigInt(CCallHelpers& jit) const
     91void ArithProfile::emitSetBigInt(CCallHelpers& jit) const
    9992{
    10093    if (shouldEmitSetBigInt())
    101         jit.or32(CCallHelpers::TrustedImm32(BigInt), CCallHelpers::AbsoluteAddress(addressOfBits()));
     94        jit.or32(CCallHelpers::TrustedImm32(ArithProfile::BigInt), CCallHelpers::AbsoluteAddress(addressOfBits()));
    10295}
    103 
    104 template class ArithProfile<uint16_t>; // Generate the implementations for UnaryArithProfile
    105 template class ArithProfile<uint32_t>; // Generate the implementations for BinaryArithProfile
    10696#endif // ENABLE(JIT)
    10797
     
    112102using namespace JSC;
    113103
    114 void printInternal(PrintStream& out, const UnaryArithProfile& profile)
    115 {
    116     const char* separator = "";
    117 
    118     out.print("Result:<");
    119     if (!profile.didObserveNonInt32()) {
    120         out.print("Int32");
    121         separator = "|";
    122     } else {
    123         if (profile.didObserveNegZeroDouble()) {
    124             out.print(separator, "NegZeroDouble");
    125             separator = "|";
    126         }
    127         if (profile.didObserveNonNegZeroDouble()) {
    128             out.print(separator, "NonNegZeroDouble");
    129             separator = "|";
    130         }
    131         if (profile.didObserveNonNumeric()) {
    132             out.print(separator, "NonNumeric");
    133             separator = "|";
    134         }
    135         if (profile.didObserveInt32Overflow()) {
    136             out.print(separator, "Int32Overflow");
    137             separator = "|";
    138         }
    139         if (profile.didObserveInt52Overflow()) {
    140             out.print(separator, "Int52Overflow");
    141             separator = "|";
    142         }
    143         if (profile.didObserveBigInt()) {
    144             out.print(separator, "BigInt");
    145             separator = "|";
    146         }
    147     }
    148     out.print(">");
    149 
    150     out.print(" Arg ObservedType:<");
    151     out.print(profile.argObservedType());
    152     out.print(">");
    153 
    154     out.print(" Arg ResultType:<");
    155     out.print(RawPointer(bitwise_cast<void*>(static_cast<uintptr_t>(profile.argResultType().bits()))));
    156     out.print(">");
    157 }
    158 
    159 void printInternal(PrintStream& out, const BinaryArithProfile& profile)
     104void printInternal(PrintStream& out, const ArithProfile& profile)
    160105{
    161106    const char* separator = "";
Note: See TracChangeset for help on using the changeset viewer.