diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/JavaScriptCore/dfg/DFGDominators.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
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 |