Changeset 154157 in webkit for trunk/Source/JavaScriptCore
- Timestamp:
- Aug 15, 2013, 7:30:37 PM (12 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r154156 r154157 1 2013-08-15 Filip Pizlo <[email protected]> 2 3 Sometimes, the DFG uses a GetById for typed array length accesses despite profiling data that indicates that it's a typed array length access 4 https://bugs.webkit.org/show_bug.cgi?id=119874 5 6 Reviewed by Oliver Hunt and Mark Hahnenberg. 7 8 It was a confusion between heuristics in DFG::ArrayMode that are assuming that 9 you'll use ForceExit if array profiles are empty, the JIT creating empty profiles 10 sometimes for typed array length accesses, and the FixupPhase assuming that a 11 ForceExit ArrayMode means that it should continue using a generic GetById. 12 13 This fixes the confusion. 14 15 * dfg/DFGFixupPhase.cpp: 16 (JSC::DFG::FixupPhase::fixupNode): 17 1 18 2013-08-15 Mark Lam <[email protected]> 2 19 -
trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
r154038 r154157 726 726 } 727 727 728 case GetById: { 728 case GetById: 729 case GetByIdFlush: { 729 730 if (!node->child1()->shouldSpeculateCell()) 730 731 break; … … 742 743 arrayProfile->computeUpdatedPrediction(locker, profiledBlock); 743 744 arrayMode = ArrayMode::fromObserved(locker, arrayProfile, Array::Read, false); 744 arrayMode = arrayMode.refine(node->child1()->prediction(), node->prediction()); 745 } else 746 arrayMode = arrayMode.refine(node->child1()->prediction(), node->prediction()); 745 if (arrayMode.type() == Array::Unprofiled) { 746 // For normal array operations, it makes sense to treat Unprofiled 747 // accesses as ForceExit and get more data rather than using 748 // predictions and then possibly ending up with a Generic. But here, 749 // we treat anything that is Unprofiled as Generic and keep the 750 // GetById. I.e. ForceExit = Generic. So, there is no harm - and only 751 // profit - from treating the Unprofiled case as 752 // SelectUsingPredictions. 753 arrayMode = ArrayMode(Array::SelectUsingPredictions); 754 } 755 } 756 757 arrayMode = arrayMode.refine(node->child1()->prediction(), node->prediction()); 747 758 748 759 if (arrayMode.type() == Array::Generic) { … … 769 780 770 781 node->child2() = Edge(storage); 771 break;772 }773 774 case GetByIdFlush: {775 if (node->child1()->shouldSpeculateCell())776 setUseKindAndUnboxIfProfitable<CellUse>(node->child1());777 782 break; 778 783 }
Note:
See TracChangeset
for help on using the changeset viewer.