summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-20 14:01:09 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-20 14:01:09 +0200
commit6dbcd09121fe266c7704a524b5cbd7f2754659c0 (patch)
tree5ae0d16cec0cc61f576d51c57b3a4613c7e91e22 /Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
parent6bbb7fbbac94d0f511a7bd0cbd50854ab643bfb2 (diff)
downloadqtwebkit-6dbcd09121fe266c7704a524b5cbd7f2754659c0.tar.gz
Imported WebKit commit 080af0beaa6f0ba8ff8f44cb8bd8b5dcf75ac0af (http://svn.webkit.org/repository/webkit/trunk@129119)
New snapshot with prospective build fix for incorrect QtWebKit master module header file creation
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
index f8ef37b03..fb897ff5b 100644
--- a/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
+++ b/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
@@ -828,26 +828,29 @@ private:
Array::Mode getArrayMode(ArrayProfile* profile)
{
profile->computeUpdatedPrediction();
- return fromObserved(profile->observedArrayModes(), false);
+ return fromObserved(profile, Array::Read, false);
}
- Array::Mode getArrayModeAndEmitChecks(ArrayProfile* profile, NodeIndex base)
+ Array::Mode getArrayModeAndEmitChecks(ArrayProfile* profile, Array::Action action, NodeIndex base)
{
profile->computeUpdatedPrediction();
- if (profile->hasDefiniteStructure())
- addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
#if DFG_ENABLE(DEBUG_PROPAGATION_VERBOSE)
if (m_inlineStackTop->m_profiledBlock->numberOfRareCaseProfiles())
dataLog("Slow case profile for bc#%u: %u\n", m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);
- dataLog("Array profile for bc#%u: %p%s, %u\n", m_currentIndex, profile->expectedStructure(), profile->structureIsPolymorphic() ? " (polymorphic)" : "", profile->observedArrayModes());
+ dataLog("Array profile for bc#%u: %p%s%s, %u\n", m_currentIndex, profile->expectedStructure(), profile->structureIsPolymorphic() ? " (polymorphic)" : "", profile->mayInterceptIndexedAccesses() ? " (may intercept)" : "", profile->observedArrayModes());
#endif
bool makeSafe =
m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)
|| m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, OutOfBounds);
- return fromObserved(profile->observedArrayModes(), makeSafe);
+ Array::Mode result = fromObserved(profile, action, makeSafe);
+
+ if (profile->hasDefiniteStructure() && benefitsFromStructureCheck(result))
+ addToGraph(CheckStructure, OpInfo(m_graph.addStructureSet(profile->expectedStructure())), base);
+
+ return result;
}
NodeIndex makeSafe(NodeIndex nodeIndex)
@@ -2188,7 +2191,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
SpeculatedType prediction = getPrediction();
NodeIndex base = get(currentInstruction[2].u.operand);
- Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, base);
+ Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, Array::Read, base);
NodeIndex property = get(currentInstruction[3].u.operand);
NodeIndex getByVal = addToGraph(GetByVal, OpInfo(arrayMode), OpInfo(prediction), base, property);
set(currentInstruction[1].u.operand, getByVal);
@@ -2199,7 +2202,7 @@ bool ByteCodeParser::parseBlock(unsigned limit)
case op_put_by_val: {
NodeIndex base = get(currentInstruction[1].u.operand);
- Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, base);
+ Array::Mode arrayMode = getArrayModeAndEmitChecks(currentInstruction[4].u.arrayProfile, Array::Write, base);
NodeIndex property = get(currentInstruction[2].u.operand);
NodeIndex value = get(currentInstruction[3].u.operand);