diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-24 08:29:43 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-08-24 08:29:43 +0200 |
commit | 2e2ba8ff45915f40ed3e014101269c175f2a89a0 (patch) | |
tree | 3b94a9a9fa83efa384b8dac611cf8c6495532a62 /Source/JavaScriptCore/dfg/DFGAbstractState.cpp | |
parent | f53e6f8e798362ed712d4a51633b0d0b03dbc213 (diff) | |
download | qtwebkit-2e2ba8ff45915f40ed3e014101269c175f2a89a0.tar.gz |
Imported WebKit commit bf0b0213bbf3886c96610020602012ca7d11b084 (http://svn.webkit.org/repository/webkit/trunk@126545)
New snapshot with clang and python build fixes
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGAbstractState.cpp')
-rw-r--r-- | Source/JavaScriptCore/dfg/DFGAbstractState.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp index cfe915947..43b5a03f3 100644 --- a/Source/JavaScriptCore/dfg/DFGAbstractState.cpp +++ b/Source/JavaScriptCore/dfg/DFGAbstractState.cpp @@ -618,7 +618,7 @@ bool AbstractState::execute(unsigned indexInBlock) case LogicalNot: { JSValue childConst = forNode(node.child1()).value(); - if (childConst && trySetConstant(nodeIndex, jsBoolean(!childConst.toBoolean()))) { + if (childConst && trySetConstant(nodeIndex, jsBoolean(!childConst.toBoolean(m_codeBlock->globalObjectFor(node.codeOrigin)->globalExec())))) { m_foundConstants = true; node.setCanExit(false); break; @@ -650,16 +650,23 @@ bool AbstractState::execute(unsigned indexInBlock) case IsString: case IsObject: case IsFunction: { - node.setCanExit(false); + node.setCanExit(node.op() == IsUndefined && m_codeBlock->globalObjectFor(node.codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()); JSValue child = forNode(node.child1()).value(); if (child) { bool constantWasSet; switch (node.op()) { case IsUndefined: - constantWasSet = trySetConstant(nodeIndex, jsBoolean( - child.isCell() - ? child.asCell()->structure()->typeInfo().masqueradesAsUndefined() - : child.isUndefined())); + if (m_codeBlock->globalObjectFor(node.codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()) { + constantWasSet = trySetConstant(nodeIndex, jsBoolean( + child.isCell() + ? false + : child.isUndefined())); + } else { + constantWasSet = trySetConstant(nodeIndex, jsBoolean( + child.isCell() + ? child.asCell()->structure()->masqueradesAsUndefined(m_codeBlock->globalObjectFor(node.codeOrigin)) + : child.isUndefined())); + } break; case IsBoolean: constantWasSet = trySetConstant(nodeIndex, jsBoolean(child.isBoolean())); @@ -739,8 +746,8 @@ bool AbstractState::execute(unsigned indexInBlock) && m_graph.valueOfJSConstant(node.child1().index()).isNull()) || (m_graph.isConstant(node.child2().index()) && m_graph.valueOfJSConstant(node.child2().index()).isNull())) { - // We know that this won't clobber the world. But that's all we know. - node.setCanExit(false); + // We can exit if we haven't fired the MasqueradesAsUndefind watchpoint yet. + node.setCanExit(m_codeBlock->globalObjectFor(node.codeOrigin)->masqueradesAsUndefinedWatchpoint()->isStillValid()); break; } @@ -1077,7 +1084,7 @@ bool AbstractState::execute(unsigned indexInBlock) case Branch: { JSValue value = forNode(node.child1()).value(); if (value) { - bool booleanValue = value.toBoolean(); + bool booleanValue = value.toBoolean(m_codeBlock->globalObjectFor(node.codeOrigin)->globalExec()); if (booleanValue) m_branchDirection = TakeTrue; else |