diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGOSRExitBase.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGOSRExitBase.h | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGOSRExitBase.h b/Source/JavaScriptCore/dfg/DFGOSRExitBase.h index ee1d69de7..310963d84 100644 --- a/Source/JavaScriptCore/dfg/DFGOSRExitBase.h +++ b/Source/JavaScriptCore/dfg/DFGOSRExitBase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2015 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,10 +23,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DFGOSRExitBase_h -#define DFGOSRExitBase_h - -#include <wtf/Platform.h> +#pragma once #if ENABLE(DFG_JIT) @@ -42,36 +39,48 @@ struct Node; // and the FTL. struct OSRExitBase { - OSRExitBase(ExitKind kind, CodeOrigin origin, CodeOrigin originForProfile) + OSRExitBase(ExitKind kind, CodeOrigin origin, CodeOrigin originForProfile, bool wasHoisted) : m_kind(kind) - , m_count(0) + , m_wasHoisted(wasHoisted) , m_codeOrigin(origin) , m_codeOriginForExitProfile(originForProfile) { ASSERT(m_codeOrigin.isSet()); ASSERT(m_codeOriginForExitProfile.isSet()); } - + + uint32_t m_count { 0 }; ExitKind m_kind; - uint32_t m_count; + bool m_wasHoisted; CodeOrigin m_codeOrigin; CodeOrigin m_codeOriginForExitProfile; + CallSiteIndex m_exceptionHandlerCallSiteIndex; + + ALWAYS_INLINE bool isExceptionHandler() const + { + return m_kind == ExceptionCheck || m_kind == GenericUnwind; + } - bool considerAddingAsFrequentExitSite(CodeBlock* profiledCodeBlock) + // True if this exit is used as an exception handler for unwinding. This happens to only be set when + // isExceptionHandler is true, but all this actually means is that the OSR exit will assume that the + // machine state is as it would be coming out of genericUnwind. + ALWAYS_INLINE bool isGenericUnwindHandler() const { - if (!m_count) - return false; - return considerAddingAsFrequentExitSiteSlow(profiledCodeBlock); + return m_kind == GenericUnwind; + } + +protected: + void considerAddingAsFrequentExitSite(CodeBlock* profiledCodeBlock, ExitingJITType jitType) + { + if (m_count) + considerAddingAsFrequentExitSiteSlow(profiledCodeBlock, jitType); } private: - bool considerAddingAsFrequentExitSiteSlow(CodeBlock* profiledCodeBlock); + void considerAddingAsFrequentExitSiteSlow(CodeBlock* profiledCodeBlock, ExitingJITType); }; } } // namespace JSC::DFG #endif // ENABLE(DFG_JIT) - -#endif // DFGOSRExitBase_h - |