Changeset 252021 in webkit for trunk/Source/JavaScriptCore/bytecode/ArithProfile.cpp
- Timestamp:
- Nov 4, 2019, 3:47:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/ArithProfile.cpp
r252015 r252021 33 33 34 34 #if ENABLE(JIT) 35 template<typename BitfieldType> 36 void ArithProfile<BitfieldType>::emitObserveResult(CCallHelpers& jit, JSValueRegs regs, TagRegistersMode mode) 35 void ArithProfile::emitObserveResult(CCallHelpers& jit, JSValueRegs regs, TagRegistersMode mode) 37 36 { 38 37 if (!shouldEmitSetDouble() && !shouldEmitSetNonNumeric() && !shouldEmitSetBigInt()) … … 60 59 } 61 60 62 template<typename BitfieldType> 63 bool ArithProfile<BitfieldType>::shouldEmitSetDouble() const 61 bool ArithProfile::shouldEmitSetDouble() const 64 62 { 65 uint32_t mask = Int32Overflow | Int52Overflow | NegZeroDouble |NonNegZeroDouble;63 uint32_t mask = ArithProfile::Int32Overflow | ArithProfile::Int52Overflow | ArithProfile::NegZeroDouble | ArithProfile::NonNegZeroDouble; 66 64 return (m_bits & mask) != mask; 67 65 } 68 66 69 template<typename BitfieldType> 70 void ArithProfile<BitfieldType>::emitSetDouble(CCallHelpers& jit) const 67 void ArithProfile::emitSetDouble(CCallHelpers& jit) const 71 68 { 72 69 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())); 74 71 } 75 72 76 template<typename BitfieldType> 77 bool ArithProfile<BitfieldType>::shouldEmitSetNonNumeric() const 73 bool ArithProfile::shouldEmitSetNonNumeric() const 78 74 { 79 75 uint32_t mask = ArithProfile::NonNumeric; … … 81 77 } 82 78 83 template<typename BitfieldType> 84 bool ArithProfile<BitfieldType>::shouldEmitSetBigInt() const 79 bool ArithProfile::shouldEmitSetBigInt() const 85 80 { 86 81 uint32_t mask = ArithProfile::BigInt; … … 88 83 } 89 84 90 template<typename BitfieldType> 91 void ArithProfile<BitfieldType>::emitSetNonNumeric(CCallHelpers& jit) const 85 void ArithProfile::emitSetNonNumeric(CCallHelpers& jit) const 92 86 { 93 87 if (shouldEmitSetNonNumeric()) 94 jit.or32(CCallHelpers::TrustedImm32( NonNumeric), CCallHelpers::AbsoluteAddress(addressOfBits()));88 jit.or32(CCallHelpers::TrustedImm32(ArithProfile::NonNumeric), CCallHelpers::AbsoluteAddress(addressOfBits())); 95 89 } 96 90 97 template<typename BitfieldType> 98 void ArithProfile<BitfieldType>::emitSetBigInt(CCallHelpers& jit) const 91 void ArithProfile::emitSetBigInt(CCallHelpers& jit) const 99 92 { 100 93 if (shouldEmitSetBigInt()) 101 jit.or32(CCallHelpers::TrustedImm32( BigInt), CCallHelpers::AbsoluteAddress(addressOfBits()));94 jit.or32(CCallHelpers::TrustedImm32(ArithProfile::BigInt), CCallHelpers::AbsoluteAddress(addressOfBits())); 102 95 } 103 104 // Generate the implementations of the functions above for UnaryArithProfile/BinaryArithProfile105 // If changing the size of either, add the corresponding lines here.106 template class ArithProfile<uint16_t>;107 96 #endif // ENABLE(JIT) 108 97 … … 113 102 using namespace JSC; 114 103 115 template <typename T> 116 void printInternal(PrintStream& out, const ArithProfile<T>& profile) 104 void printInternal(PrintStream& out, const ArithProfile& profile) 117 105 { 118 106 const char* separator = ""; … … 148 136 } 149 137 } 138 if (profile.tookSpecialFastPath()) 139 out.print(separator, "Took special fast path."); 150 140 out.print(">"); 151 }152 153 void printInternal(PrintStream& out, const UnaryArithProfile& profile)154 {155 printInternal(out, static_cast<ArithProfile<UnaryArithProfileBase>>(profile));156 157 out.print(" Arg ObservedType:<");158 out.print(profile.argObservedType());159 out.print(">");160 }161 162 void printInternal(PrintStream& out, const BinaryArithProfile& profile)163 {164 printInternal(out, static_cast<ArithProfile<UnaryArithProfileBase>>(profile));165 166 if (profile.tookSpecialFastPath())167 out.print(" Took special fast path.");168 141 169 142 out.print(" LHS ObservedType:<"); … … 171 144 out.print("> RHS ObservedType:<"); 172 145 out.print(profile.rhsObservedType()); 146 out.print(">"); 147 148 out.print(" LHS ResultType:<", RawPointer(bitwise_cast<void*>(static_cast<uintptr_t>(profile.lhsResultType().bits())))); 149 out.print("> RHS ResultType:<", RawPointer(bitwise_cast<void*>(static_cast<uintptr_t>(profile.rhsResultType().bits())))); 173 150 out.print(">"); 174 151 }
Note:
See TracChangeset
for help on using the changeset viewer.