Changeset 252021 in webkit for trunk/Source/JavaScriptCore/jit/JITMathIC.h
- Timestamp:
- Nov 4, 2019, 3:47:07 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITMathIC.h
r252015 r252021 53 53 #define ENABLE_MATH_IC_STATS 0 54 54 55 template <typename GeneratorType, typename ArithProfileType>55 template <typename GeneratorType, bool(*isProfileEmpty)(ArithProfile&)> 56 56 class JITMathIC { 57 57 WTF_MAKE_FAST_ALLOCATED; 58 58 public: 59 JITMathIC(ArithProfile Type* arithProfile)59 JITMathIC(ArithProfile* arithProfile) 60 60 : m_arithProfile(arithProfile) 61 61 { … … 72 72 73 73 if (m_arithProfile) { 74 if ( m_arithProfile->isObservedTypeEmpty()) {74 if (isProfileEmpty(*m_arithProfile)) { 75 75 // It looks like the MathIC has yet to execute. We don't want to emit code in this 76 76 // case for a couple reasons. First, the operation may never execute, so if we don't emit … … 224 224 } 225 225 226 ArithProfile Type* arithProfile() const { return m_arithProfile; }226 ArithProfile* arithProfile() const { return m_arithProfile; } 227 227 228 228 #if ENABLE(MATH_IC_STATS) … … 237 237 #endif 238 238 239 ArithProfile Type* m_arithProfile;239 ArithProfile* m_arithProfile; 240 240 MacroAssemblerCodeRef<JITStubRoutinePtrTag> m_code; 241 241 CodeLocationLabel<JSInternalPtrTag> m_inlineStart; … … 247 247 }; 248 248 249 inline bool isBinaryProfileEmpty(ArithProfile& arithProfile) 250 { 251 return arithProfile.lhsObservedType().isEmpty() || arithProfile.rhsObservedType().isEmpty(); 252 } 249 253 template <typename GeneratorType> 250 class JITBinaryMathIC : public JITMathIC<GeneratorType, BinaryArithProfile> {254 class JITBinaryMathIC : public JITMathIC<GeneratorType, isBinaryProfileEmpty> { 251 255 public: 252 JITBinaryMathIC( BinaryArithProfile* arithProfile)253 : JITMathIC<GeneratorType, BinaryArithProfile>(arithProfile)256 JITBinaryMathIC(ArithProfile* arithProfile) 257 : JITMathIC<GeneratorType, isBinaryProfileEmpty>(arithProfile) 254 258 { 255 259 } … … 260 264 typedef JITBinaryMathIC<JITSubGenerator> JITSubIC; 261 265 266 267 inline bool isUnaryProfileEmpty(ArithProfile& arithProfile) 268 { 269 return arithProfile.lhsObservedType().isEmpty(); 270 } 262 271 template <typename GeneratorType> 263 class JITUnaryMathIC : public JITMathIC<GeneratorType, UnaryArithProfile> {272 class JITUnaryMathIC : public JITMathIC<GeneratorType, isUnaryProfileEmpty> { 264 273 public: 265 JITUnaryMathIC( UnaryArithProfile* arithProfile)266 : JITMathIC<GeneratorType, UnaryArithProfile>(arithProfile)274 JITUnaryMathIC(ArithProfile* arithProfile) 275 : JITMathIC<GeneratorType, isUnaryProfileEmpty>(arithProfile) 267 276 { 268 277 }
Note:
See TracChangeset
for help on using the changeset viewer.