diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGAvailability.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGAvailability.h | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGAvailability.h b/Source/JavaScriptCore/dfg/DFGAvailability.h index fd9bf6529..6d157f547 100644 --- a/Source/JavaScriptCore/dfg/DFGAvailability.h +++ b/Source/JavaScriptCore/dfg/DFGAvailability.h @@ -23,8 +23,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DFGAvailability_h -#define DFGAvailability_h +#pragma once #if ENABLE(DFG_JIT) @@ -81,10 +80,26 @@ public: return withNode(unavailableMarker()); } + void setFlush(FlushedAt flushedAt) + { + m_flushedAt = flushedAt; + } + + void setNode(Node* node) + { + m_node = node; + } + + void setNodeUnavailable() + { + m_node = unavailableMarker(); + } + bool nodeIsUndecided() const { return !m_node; } bool nodeIsUnavailable() const { return m_node == unavailableMarker(); } bool hasNode() const { return !nodeIsUndecided() && !nodeIsUnavailable(); } + bool shouldUseNode() const { return !isFlushUseful() && hasNode(); } Node* node() const { @@ -94,6 +109,12 @@ public: } FlushedAt flushedAt() const { return m_flushedAt; } + bool isFlushUseful() const + { + return flushedAt().format() != DeadFlush && flushedAt().format() != ConflictingFlush; + } + + bool isDead() const { return !isFlushUseful() && !hasNode(); } bool operator!() const { return nodeIsUnavailable() && flushedAt().format() == ConflictingFlush; } @@ -103,6 +124,11 @@ public: && m_flushedAt == other.m_flushedAt; } + bool operator!=(const Availability& other) const + { + return !(*this == other); + } + Availability merge(const Availability& other) const { return Availability( @@ -137,6 +163,3 @@ private: } } // namespace JSC::DFG #endif // ENABLE(DFG_JIT) - -#endif // DFGAvailability_h - |