diff options
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h b/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h index 28bf505da..2433c040e 100644 --- a/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h +++ b/Source/JavaScriptCore/dfg/DFGOSRAvailabilityAnalysisPhase.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013 Apple Inc. All rights reserved. + * Copyright (C) 2013, 2014 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,13 +23,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DFGOSRAvailabilityAnalysisPhase_h -#define DFGOSRAvailabilityAnalysisPhase_h - -#include <wtf/Platform.h> +#pragma once #if ENABLE(DFG_JIT) +#include "DFGBasicBlock.h" #include "DFGCommon.h" namespace JSC { namespace DFG { @@ -37,13 +35,28 @@ namespace JSC { namespace DFG { class Graph; // Computes BasicBlock::ssa->availabiltiyAtHead/Tail. This is a forward flow type inference -// over MovHints and SetLocals. +// over MovHints and SetLocals. This analysis is run directly by the Plan for preparing for +// lowering to B3 IR, but it can also be used as a utility. Note that if you run it before +// stack layout, all of the flush availability will omit the virtual register - but it will +// tell you the format. bool performOSRAvailabilityAnalysis(Graph&); +// Local calculator for figuring out the availability at any node in a basic block. Requires +// having run the availability analysis. +class LocalOSRAvailabilityCalculator { +public: + LocalOSRAvailabilityCalculator(Graph&); + ~LocalOSRAvailabilityCalculator(); + + void beginBlock(BasicBlock*); + void endBlock(BasicBlock*); // Useful if you want to get data for the end of the block. You don't need to call this if you did beginBlock() and then executeNode() for every node. + void executeNode(Node*); + + AvailabilityMap m_availability; + Graph& m_graph; +}; + } } // namespace JSC::DFG #endif // ENABLE(DFG_JIT) - -#endif // DFGOSRAvailabilityAnalysisPhase_h - |