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/DFGGenerationInfo.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGGenerationInfo.h')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGGenerationInfo.h | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGGenerationInfo.h b/Source/JavaScriptCore/dfg/DFGGenerationInfo.h index e3330fa3b..e9df84106 100644 --- a/Source/JavaScriptCore/dfg/DFGGenerationInfo.h +++ b/Source/JavaScriptCore/dfg/DFGGenerationInfo.h @@ -23,8 +23,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DFGGenerationInfo_h -#define DFGGenerationInfo_h +#pragma once #if ENABLE(DFG_JIT) @@ -38,9 +37,9 @@ namespace JSC { namespace DFG { // === GenerationInfo === // -// This class is used to track the current status of a live values during code generation. +// This class is used to track the current status of live values during code generation. // Can provide information as to whether a value is in machine registers, and if so which, -// whether a value has been spilled to the RegsiterFile, and if so may be able to provide +// whether a value has been spilled to the RegisterFile, and if so may be able to provide // details of the format in memory (all values are spilled in a boxed form, but we may be // able to track the type of box), and tracks how many outstanding uses of a value remain, // so that we know when the value is dead and the machine registers associated with it @@ -153,8 +152,6 @@ public: void noticeOSRBirth(VariableEventStream& stream, Node* node, VirtualRegister virtualRegister) { - if (m_isConstant) - return; if (m_node != node) return; if (!alive()) @@ -164,7 +161,9 @@ public: m_bornForOSR = true; - if (m_registerFormat != DataFormatNone) + if (m_isConstant) + appendBirth(stream); + else if (m_registerFormat != DataFormatNone) appendFill(BirthToFill, stream); else if (m_spillFormat != DataFormatNone) appendSpill(BirthToSpill, stream, virtualRegister); @@ -189,10 +188,10 @@ public: // Used to check the operands of operations to see if they are on // their last use; in some cases it may be safe to reuse the same // machine register for the result of the operation. - bool canReuse() + uint32_t useCount() { ASSERT(m_useCount); - return m_useCount == 1; + return m_useCount; } // Get the format of the value in machine registers (or 'none'). @@ -378,7 +377,35 @@ public: return m_useCount; } + ValueRecovery recovery(VirtualRegister spillSlot) const + { + if (m_isConstant) + return ValueRecovery::constant(m_node->constant()->value()); + + if (m_registerFormat == DataFormatDouble) + return ValueRecovery::inFPR(u.fpr, DataFormatDouble); + +#if USE(JSVALUE32_64) + if (m_registerFormat & DataFormatJS) { + if (m_registerFormat == DataFormatJS) + return ValueRecovery::inPair(u.v.tagGPR, u.v.payloadGPR); + return ValueRecovery::inGPR(u.v.payloadGPR, static_cast<DataFormat>(m_registerFormat & ~DataFormatJS)); + } +#endif + if (m_registerFormat) + return ValueRecovery::inGPR(u.gpr, m_registerFormat); + + ASSERT(m_spillFormat); + + return ValueRecovery::displacedInJSStack(spillSlot, m_spillFormat); + } + private: + void appendBirth(VariableEventStream& stream) + { + stream.appendAndLog(VariableEvent::birth(MinifiedID(m_node))); + } + void appendFill(VariableEventKind kind, VariableEventStream& stream) { ASSERT(m_bornForOSR); @@ -424,4 +451,3 @@ private: } } // namespace JSC::DFG #endif -#endif |