Changeset 141222 in webkit
- Timestamp:
- Jan 29, 2013 9:43:47 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r141202 r141222 1 2013-01-29 Geoffrey Garen <ggaren@apple.com> 2 3 Be a little more conservative about emitting table-based switches 4 https://bugs.webkit.org/show_bug.cgi?id=108292 5 6 Reviewed by Filip Pizlo. 7 8 Profiling shows we're using op_switch in cases where it's a regression. 9 10 * bytecompiler/NodesCodegen.cpp: 11 (JSC): 12 (JSC::length): 13 (JSC::CaseBlockNode::tryTableSwitch): 14 (JSC::CaseBlockNode::emitBytecodeForBlock): 15 * parser/Nodes.h: 16 (CaseBlockNode): 17 1 18 2013-01-29 Sheriff Bot <webkit.review.bot@gmail.com> 2 19 -
trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
r140594 r141222 1852 1852 } 1853 1853 } 1854 1855 SwitchInfo::SwitchType CaseBlockNode::tryOptimizedSwitch(Vector<ExpressionNode*, 8>& literalVector, int32_t& min_num, int32_t& max_num) 1856 { 1854 1855 static inline size_t length(ClauseListNode* list1, ClauseListNode* list2) 1856 { 1857 size_t length = 0; 1858 for (ClauseListNode* node = list1; node; node = node->getNext()) 1859 ++length; 1860 for (ClauseListNode* node = list2; node; node = node->getNext()) 1861 ++length; 1862 return length; 1863 } 1864 1865 SwitchInfo::SwitchType CaseBlockNode::tryTableSwitch(Vector<ExpressionNode*, 8>& literalVector, int32_t& min_num, int32_t& max_num) 1866 { 1867 if (length(m_list1, m_list2) < s_tableSwitchMinimum) 1868 return SwitchInfo::SwitchNone; 1869 1857 1870 SwitchKind typeForTable = SwitchUnset; 1858 1871 bool singleCharacterSwitch = true; … … 1889 1902 int32_t min_num = std::numeric_limits<int32_t>::max(); 1890 1903 int32_t max_num = std::numeric_limits<int32_t>::min(); 1891 SwitchInfo::SwitchType switchType = try OptimizedSwitch(literalVector, min_num, max_num);1904 SwitchInfo::SwitchType switchType = tryTableSwitch(literalVector, min_num, max_num); 1892 1905 1893 1906 if (switchType != SwitchInfo::SwitchNone) { -
trunk/Source/JavaScriptCore/parser/Nodes.h
r140947 r141222 1510 1510 1511 1511 private: 1512 SwitchInfo::SwitchType tryOptimizedSwitch(Vector<ExpressionNode*, 8>& literalVector, int32_t& min_num, int32_t& max_num); 1512 SwitchInfo::SwitchType tryTableSwitch(Vector<ExpressionNode*, 8>& literalVector, int32_t& min_num, int32_t& max_num); 1513 static const size_t s_tableSwitchMinimum = 10; 1513 1514 ClauseListNode* m_list1; 1514 1515 CaseClauseNode* m_defaultClause;
Note: See TracChangeset
for help on using the changeset viewer.