summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGOSRExitBase.h
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2017-06-27 06:07:23 +0000
commit1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch)
tree46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/dfg/DFGOSRExitBase.h
parent32761a6cee1d0dee366b885b7b9c777e67885688 (diff)
downloadWebKitGtk-tarball-master.tar.gz
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGOSRExitBase.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGOSRExitBase.h43
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
-