diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGDominators.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGDominators.h | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGDominators.h b/Source/JavaScriptCore/dfg/DFGDominators.h index c63a84baf..5d266f598 100644 --- a/Source/JavaScriptCore/dfg/DFGDominators.h +++ b/Source/JavaScriptCore/dfg/DFGDominators.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Apple Inc. All rights reserved. + * Copyright (C) 2011, 2014, 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,51 +23,32 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DFGDominators_h -#define DFGDominators_h - -#include <wtf/Platform.h> +#pragma once #if ENABLE(DFG_JIT) -#include "DFGAnalysis.h" #include "DFGBasicBlock.h" +#include "DFGBlockMap.h" +#include "DFGBlockSet.h" +#include "DFGCFG.h" #include "DFGCommon.h" -#include <wtf/FastBitVector.h> +#include "DFGGraph.h" +#include <wtf/Dominators.h> +#include <wtf/FastMalloc.h> +#include <wtf/Noncopyable.h> namespace JSC { namespace DFG { -class Graph; - -class Dominators : public Analysis<Dominators> { +class Dominators : public WTF::Dominators<CFG> { + WTF_MAKE_NONCOPYABLE(Dominators); + WTF_MAKE_FAST_ALLOCATED; public: - Dominators(); - ~Dominators(); - - void compute(Graph& graph); - - bool dominates(BlockIndex from, BlockIndex to) const + Dominators(Graph& graph) + : WTF::Dominators<CFG>(*graph.m_cfg) { - ASSERT(isValid()); - return m_results[to].get(from); } - - bool dominates(BasicBlock* from, BasicBlock* to) const - { - return dominates(from->index, to->index); - } - - void dump(Graph& graph, PrintStream&) const; - -private: - bool pruneDominators(Graph&, BlockIndex); - - Vector<FastBitVector> m_results; // For each block, the bitvector of blocks that dominate it. - FastBitVector m_scratch; // A temporary bitvector with bit for each block. We recycle this to save new/deletes. }; } } // namespace JSC::DFG #endif // ENABLE(DFG_JIT) - -#endif // DFGDominators_h |