Changeset 251106 in webkit for trunk/Source/JavaScriptCore/bytecode/ArithProfile.cpp
- Timestamp:
- Oct 14, 2019, 3:52:11 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/ArithProfile.cpp
r251090 r251106 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 template class ArithProfile<uint16_t>; // Generate the implementations for UnaryArithProfile105 template class ArithProfile<uint32_t>; // Generate the implementations for BinaryArithProfile106 96 #endif // ENABLE(JIT) 107 97 … … 112 102 using namespace JSC; 113 103 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) 104 void printInternal(PrintStream& out, const ArithProfile& profile) 160 105 { 161 106 const char* separator = "";
Note:
See TracChangeset
for help on using the changeset viewer.