summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGGraph.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-03-12 14:11:15 +0100
commitdd91e772430dc294e3bf478c119ef8d43c0a3358 (patch)
tree6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Source/JavaScriptCore/dfg/DFGGraph.h
parentad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff)
downloadqtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGGraph.h')
-rw-r--r--Source/JavaScriptCore/dfg/DFGGraph.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGGraph.h b/Source/JavaScriptCore/dfg/DFGGraph.h
index 88d6a4eec..bacbac827 100644
--- a/Source/JavaScriptCore/dfg/DFGGraph.h
+++ b/Source/JavaScriptCore/dfg/DFGGraph.h
@@ -177,6 +177,12 @@ public:
return Node::shouldSpeculateInteger(left, right) && add.canSpeculateInteger();
}
+ bool negateShouldSpeculateInteger(Node& negate)
+ {
+ ASSERT(negate.op == ArithNegate);
+ return at(negate.child1()).shouldSpeculateInteger() && negate.canSpeculateInteger();
+ }
+
bool addShouldSpeculateInteger(NodeIndex nodeIndex)
{
return addShouldSpeculateInteger(at(nodeIndex));
@@ -305,6 +311,41 @@ public:
return MethodOfGettingAValueProfile(valueProfileFor(nodeIndex));
}
+ bool needsActivation() const
+ {
+#if DFG_ENABLE(ALL_VARIABLES_CAPTURED)
+ return true;
+#else
+ return m_codeBlock->needsFullScopeChain() && m_codeBlock->codeType() != GlobalCode;
+#endif
+ }
+
+ // Pass an argument index. Currently it's ignored, but that's somewhat
+ // of a bug.
+ bool argumentIsCaptured(int) const
+ {
+ return needsActivation();
+ }
+ bool localIsCaptured(int operand) const
+ {
+#if DFG_ENABLE(ALL_VARIABLES_CAPTURED)
+ return operand < m_codeBlock->m_numVars;
+#else
+ return operand < m_codeBlock->m_numCapturedVars;
+#endif
+ }
+
+ bool isCaptured(int operand) const
+ {
+ if (operandIsArgument(operand))
+ return argumentIsCaptured(operandToArgument(operand));
+ return localIsCaptured(operand);
+ }
+ bool isCaptured(VirtualRegister virtualRegister) const
+ {
+ return isCaptured(static_cast<int>(virtualRegister));
+ }
+
JSGlobalData& m_globalData;
CodeBlock* m_codeBlock;
CodeBlock* m_profiledBlock;