summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/JavaScriptCore/dfg/DFGVariableAccessData.h
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGVariableAccessData.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGVariableAccessData.h37
1 files changed, 27 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGVariableAccessData.h b/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
index e734e6387..6d8e89799 100644
--- a/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
+++ b/Source/JavaScriptCore/dfg/DFGVariableAccessData.h
@@ -37,10 +37,10 @@
namespace JSC { namespace DFG {
+enum DoubleBallot { VoteValue, VoteDouble };
+
class VariableAccessData : public UnionFind<VariableAccessData> {
public:
- enum Ballot { VoteValue, VoteDouble };
-
VariableAccessData()
: m_local(static_cast<VirtualRegister>(std::numeric_limits<int>::min()))
, m_prediction(SpecNone)
@@ -49,6 +49,7 @@ public:
, m_doubleFormatState(EmptyDoubleFormatState)
, m_isCaptured(false)
, m_isArgumentsAlias(false)
+ , m_structureCheckHoistingFailed(false)
{
clearVotes();
}
@@ -61,6 +62,7 @@ public:
, m_doubleFormatState(EmptyDoubleFormatState)
, m_isCaptured(isCaptured)
, m_isArgumentsAlias(false)
+ , m_structureCheckHoistingFailed(false)
{
clearVotes();
}
@@ -90,6 +92,20 @@ public:
return m_isCaptured;
}
+ bool mergeStructureCheckHoistingFailed(bool failed)
+ {
+ bool newFailed = m_structureCheckHoistingFailed | failed;
+ if (newFailed == m_structureCheckHoistingFailed)
+ return false;
+ m_structureCheckHoistingFailed = newFailed;
+ return true;
+ }
+
+ bool structureCheckHoistingFailed()
+ {
+ return m_structureCheckHoistingFailed;
+ }
+
bool mergeIsArgumentsAlias(bool isArgumentsAlias)
{
bool newIsArgumentsAlias = m_isArgumentsAlias | isArgumentsAlias;
@@ -136,20 +152,20 @@ public:
void clearVotes()
{
ASSERT(find() == this);
- m_votes[VoteValue] = 0;
- m_votes[VoteDouble] = 0;
+ m_votes[0] = 0;
+ m_votes[1] = 0;
}
- void vote(Ballot ballot)
+ void vote(unsigned ballot)
{
- ASSERT(static_cast<unsigned>(ballot) < 2);
+ ASSERT(ballot < 2);
m_votes[ballot]++;
}
- double doubleVoteRatio()
+ double voteRatio()
{
ASSERT(find() == this);
- return static_cast<double>(m_votes[VoteDouble]) / m_votes[VoteValue];
+ return static_cast<double>(m_votes[1]) / m_votes[0];
}
bool shouldUseDoubleFormatAccordingToVote()
@@ -176,7 +192,7 @@ public:
// If the variable has been voted to become a double, then make it a
// double.
- if (doubleVoteRatio() >= Options::doubleVoteRatioForDoubleFormat())
+ if (voteRatio() >= Options::doubleVoteRatioForDoubleFormat())
return true;
return false;
@@ -250,11 +266,12 @@ private:
SpeculatedType m_argumentAwarePrediction;
NodeFlags m_flags;
- float m_votes[2];
+ float m_votes[2]; // Used primarily for double voting but may be reused for other purposes.
DoubleFormatState m_doubleFormatState;
bool m_isCaptured;
bool m_isArgumentsAlias;
+ bool m_structureCheckHoistingFailed;
};
} } // namespace JSC::DFG