Changeset 237972 in webkit for trunk/Source/JavaScriptCore/bytecode/ArithProfile.h
- Timestamp:
- Nov 7, 2018, 5:47:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecode/ArithProfile.h
r237547 r237972 69 69 struct ArithProfile { 70 70 private: 71 static constexpr uint32_t numberOfFlagBits = 5;71 static constexpr uint32_t numberOfFlagBits = 6; 72 72 static constexpr uint32_t rhsResultTypeShift = numberOfFlagBits; 73 73 static constexpr uint32_t lhsResultTypeShift = rhsResultTypeShift + ResultType::numBitsNeeded; … … 122 122 constexpr ObservedType observedInt32 { ObservedType().withInt32() }; 123 123 constexpr uint32_t bits = observedInt32.bits() << lhsObservedTypeShift; 124 static_assert(bits == 0x 400000, "");124 static_assert(bits == 0x800000, ""); 125 125 return fromInt(bits); 126 126 } … … 129 129 constexpr ObservedType observedNumber { ObservedType().withNumber() }; 130 130 constexpr uint32_t bits = observedNumber.bits() << lhsObservedTypeShift; 131 static_assert(bits == 0x 800000, "");131 static_assert(bits == 0x1000000, ""); 132 132 return fromInt(bits); 133 133 } … … 136 136 constexpr ObservedType observedInt32 { ObservedType().withInt32() }; 137 137 constexpr uint32_t bits = (observedInt32.bits() << lhsObservedTypeShift) | (observedInt32.bits() << rhsObservedTypeShift); 138 static_assert(bits == 0x 480000, "");138 static_assert(bits == 0x900000, ""); 139 139 return fromInt(bits); 140 140 } … … 144 144 constexpr ObservedType observedInt32 { ObservedType().withInt32() }; 145 145 constexpr uint32_t bits = (observedNumber.bits() << lhsObservedTypeShift) | (observedInt32.bits() << rhsObservedTypeShift); 146 static_assert(bits == 0x 880000, "");146 static_assert(bits == 0x1100000, ""); 147 147 return fromInt(bits); 148 148 } … … 152 152 constexpr ObservedType observedInt32 { ObservedType().withInt32() }; 153 153 constexpr uint32_t bits = (observedInt32.bits() << lhsObservedTypeShift) | (observedNumber.bits() << rhsObservedTypeShift); 154 static_assert(bits == 0x 500000, "");154 static_assert(bits == 0xa00000, ""); 155 155 return fromInt(bits); 156 156 } … … 159 159 constexpr ObservedType observedNumber { ObservedType().withNumber() }; 160 160 constexpr uint32_t bits = (observedNumber.bits() << lhsObservedTypeShift) | (observedNumber.bits() << rhsObservedTypeShift); 161 static_assert(bits == 0x 900000, "");161 static_assert(bits == 0x1200000, ""); 162 162 return fromInt(bits); 163 163 } … … 166 166 NonNegZeroDouble = 1 << 0, 167 167 NegZeroDouble = 1 << 1, 168 NonNum ber= 1 << 2,168 NonNumeric = 1 << 2, 169 169 Int32Overflow = 1 << 3, 170 170 Int52Overflow = 1 << 4, 171 BigInt = 1 << 5, 171 172 }; 172 173 … … 196 197 bool tookSpecialFastPath() const { return m_bits & specialFastPathBit; } 197 198 198 bool didObserveNonInt32() const { return hasBits(NonNegZeroDouble | NegZeroDouble | NonNum ber); }199 bool didObserveNonInt32() const { return hasBits(NonNegZeroDouble | NegZeroDouble | NonNumeric | BigInt); } 199 200 bool didObserveDouble() const { return hasBits(NonNegZeroDouble | NegZeroDouble); } 200 201 bool didObserveNonNegZeroDouble() const { return hasBits(NonNegZeroDouble); } 201 202 bool didObserveNegZeroDouble() const { return hasBits(NegZeroDouble); } 202 bool didObserveNonNumber() const { return hasBits(NonNumber); } 203 bool didObserveNonNumeric() const { return hasBits(NonNumeric); } 204 bool didObserveBigInt() const { return hasBits(BigInt); } 203 205 bool didObserveInt32Overflow() const { return hasBits(Int32Overflow); } 204 206 bool didObserveInt52Overflow() const { return hasBits(Int52Overflow); } … … 206 208 void setObservedNonNegZeroDouble() { setBit(NonNegZeroDouble); } 207 209 void setObservedNegZeroDouble() { setBit(NegZeroDouble); } 208 void setObservedNonNumber() { setBit(NonNumber); } 210 void setObservedNonNumeric() { setBit(NonNumeric); } 211 void setObservedBigInt() { setBit(BigInt); } 209 212 void setObservedInt32Overflow() { setBit(Int32Overflow); } 210 213 void setObservedInt52Overflow() { setBit(Int52Overflow); } … … 220 223 return; 221 224 } 222 m_bits |= NonNumber; 225 if (value && value.isBigInt()) { 226 m_bits |= BigInt; 227 return; 228 } 229 m_bits |= NonNumeric; 223 230 } 224 231 … … 262 269 #if ENABLE(JIT) 263 270 // Sets (Int32Overflow | Int52Overflow | NonNegZeroDouble | NegZeroDouble) if it sees a 264 // double. Sets NonNum ber if it sees a non-number.271 // double. Sets NonNumeric if it sees a non-numeric. 265 272 void emitObserveResult(CCallHelpers&, JSValueRegs, TagRegistersMode = HaveTagRegisters); 266 273 … … 270 277 271 278 // Sets NonNumber. 272 void emitSetNonNumber(CCallHelpers&) const; 273 bool shouldEmitSetNonNumber() const; 279 void emitSetNonNumeric(CCallHelpers&) const; 280 bool shouldEmitSetNonNumeric() const; 281 282 // Sets BigInt 283 void emitSetBigInt(CCallHelpers&) const; 284 bool shouldEmitSetBigInt() const; 274 285 #endif // ENABLE(JIT) 275 286
Note:
See TracChangeset
for help on using the changeset viewer.