Changeset 102694 in webkit for trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
- Timestamp:
- Dec 13, 2011, 11:49:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r102545 r102694 632 632 NodeIndex makeSafe(NodeIndex nodeIndex) 633 633 { 634 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) 634 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 635 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow) 636 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) 635 637 return nodeIndex; 636 638 637 639 #if DFG_ENABLE(DEBUG_VERBOSE) 638 printf("Making %s @%u safe at bc#%u because slow-case counter is at %u \n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);640 printf("Making %s @%u safe at bc#%u because slow-case counter is at %u and exit profiles say %d, %d\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)); 639 641 #endif 640 642 … … 649 651 650 652 case ArithMul: 651 if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex)) { 653 if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex) 654 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow)) { 652 655 #if DFG_ENABLE(DEBUG_VERBOSE) 653 656 printf("Making ArithMul @%u take deepest slow case.\n", nodeIndex); 654 657 #endif 655 658 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow | NodeMayNegZero); 656 } else { 659 } else if (m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 660 || m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) { 657 661 #if DFG_ENABLE(DEBUG_VERBOSE) 658 662 printf("Making ArithMul @%u take faster slow case.\n", nodeIndex); … … 680 684 // is what the special fast case counter tells us. 681 685 682 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSpecialFastCase(m_currentIndex)) 686 if (!m_inlineStackTop->m_profiledBlock->likelyToTakeSpecialFastCase(m_currentIndex) 687 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow) 688 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)) 683 689 return nodeIndex; 684 690 685 691 #if DFG_ENABLE(DEBUG_VERBOSE) 686 printf("Making %s @%u safe at bc#%u because special fast-case counter is at %u\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->specialFastCaseProfileForBytecodeOffset(m_currentIndex)->m_counter); 687 #endif 688 692 printf("Making %s @%u safe at bc#%u because special fast-case counter is at %u and exit profiles say %d, %d\n", Graph::opName(m_graph[nodeIndex].op), nodeIndex, m_currentIndex, m_inlineStackTop->m_profiledBlock->specialFastCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, NegativeZero)); 693 #endif 694 695 // FIXME: It might be possible to make this more granular. The DFG certainly can 696 // distinguish between negative zero and overflow in its exit profiles. 689 697 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow | NodeMayNegZero); 690 698 … … 794 802 ScriptExecutable* executable() { return m_codeBlock->ownerExecutable(); } 795 803 804 QueryableExitProfile m_exitProfile; 805 796 806 // Remapping of identifier and constant numbers from the code block being 797 807 // inlined (inline callee) to the code block that we're inlining into … … 888 898 889 899 #if DFG_ENABLE(DEBUG_VERBOSE) 890 printf("Slow case count for call at @%lu bc#%u: %u/%u .\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_profiledBlock->executionEntryCount());900 printf("Slow case count for call at @%lu bc#%u: %u/%u; exit profile: %d.\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_profiledBlock->executionEntryCount(), m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 891 901 #endif 892 902 893 903 if (m_graph.isFunctionConstant(m_codeBlock, callTarget)) 894 904 callType = ConstantFunction; 895 else if (!!m_inlineStackTop->m_profiledBlock->getCallLinkInfo(m_currentIndex).lastSeenCallee && !m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex)) 905 else if (!!m_inlineStackTop->m_profiledBlock->getCallLinkInfo(m_currentIndex).lastSeenCallee 906 && !m_inlineStackTop->m_profiledBlock->couldTakeSlowCase(m_currentIndex) 907 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) 896 908 callType = LinkedFunction; 897 909 else … … 1168 1180 return false; 1169 1181 1170 set(resultOperand, addToGraph(ArithAbs, OpInfo(NodeUseBottom), getToNumber(registerOffset + argumentToOperand(1)))); 1182 NodeIndex nodeIndex = addToGraph(ArithAbs, OpInfo(NodeUseBottom), getToNumber(registerOffset + argumentToOperand(1))); 1183 if (m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, Overflow)) 1184 m_graph[nodeIndex].mergeArithNodeFlags(NodeMayOverflow); 1185 set(resultOperand, nodeIndex); 1171 1186 return true; 1172 1187 } … … 1669 1684 MethodCallLinkInfo& methodCall = m_inlineStackTop->m_profiledBlock->getMethodCallLinkInfo(m_currentIndex); 1670 1685 1671 if (methodCall.seen && !!methodCall.cachedStructure && !stubInfo.seen) { 1686 if (methodCall.seen 1687 && !!methodCall.cachedStructure 1688 && !stubInfo.seen 1689 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1672 1690 // It's monomorphic as far as we can tell, since the method_check was linked 1673 1691 // but the slow path (i.e. the normal get_by_id) never fired. … … 1712 1730 1713 1731 #if DFG_ENABLE(DEBUG_VERBOSE) 1714 printf("Slow case count for GetById @%lu bc#%u: %u \n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);1732 printf("Slow case count for GetById @%lu bc#%u: %u; exit profile: %d\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 1715 1733 #endif 1716 1734 1717 1735 size_t offset = notFound; 1718 1736 StructureSet structureSet; 1719 if (stubInfo.seen && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) { 1737 if (stubInfo.seen 1738 && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 1739 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1720 1740 switch (stubInfo.accessType) { 1721 1741 case access_get_by_id_self: { … … 1806 1826 1807 1827 #if DFG_ENABLE(DEBUG_VERBOSE) 1808 printf("Slow case count for PutById @%lu bc#%u: %u \n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter);1828 printf("Slow case count for PutById @%lu bc#%u: %u; exit profile: %d\n", m_graph.size(), m_currentIndex, m_inlineStackTop->m_profiledBlock->rareCaseProfileForBytecodeOffset(m_currentIndex)->m_counter, m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)); 1809 1829 #endif 1810 1830 1811 if (stubInfo.seen && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex)) { 1831 if (stubInfo.seen 1832 && !m_inlineStackTop->m_profiledBlock->likelyToTakeSlowCase(m_currentIndex) 1833 && !m_inlineStackTop->m_exitProfile.hasExitSite(m_currentIndex, BadCache)) { 1812 1834 switch (stubInfo.accessType) { 1813 1835 case access_put_by_id_replace: { … … 2426 2448 , m_profiledBlock(profiledBlock) 2427 2449 , m_calleeVR(calleeVR) 2450 , m_exitProfile(profiledBlock->exitProfile()) 2428 2451 , m_callsiteBlockHead(callsiteBlockHead) 2429 2452 , m_returnValue(returnValueVR)
Note:
See TracChangeset
for help on using the changeset viewer.