summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGGenerationInfo.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGGenerationInfo.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGGenerationInfo.h46
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