Changeset 94629 in webkit for trunk/Source/JavaScriptCore/ChangeLog
- Timestamp:
- Sep 6, 2011, 7:47:51 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r94627 r94629 1 2011-09-06 Filip Pizlo <[email protected]> 2 3 DFG JIT does not optimize booleans 4 https://bugs.webkit.org/show_bug.cgi?id=67670 5 6 Reviewed by Gavin Barraclough. 7 8 This adds boolean value profiling, boolean prediction in the DFG, 9 boolean forward flow propagation in the DFGPropagator, boolean 10 data format in DFG generation info, and comprehensive optimizations 11 based on both boolean prediction and boolean generation info. 12 This is brings the speed-up on v8-richards to 12%, and gives slight 13 speed-ups elsewhere as well. 14 15 Making this work right required navigating some subtleties in 16 value profiling. Some functions get compiled with insufficient 17 information because some important path of the function never 18 executed. In these cases, we wish to fall back on static 19 speculation. But to do so, we need to ensure that predictions that 20 are inherent in the code (like that GetById almost certainly takes 21 a cell operand) are reflected in predictions that we make in 22 DFGPropagator. Thus, DFGPropagator now does both backward and 23 forward flow, using a both forward and backward fixpoint. 24 25 The backward flow in DFGPropagator is a separate static analysis, 26 and needs to keep a set of backward flow abstract values for 27 variables, arguments, and globals. To make this easy, this patch 28 factors out DFGGraph's prediction tracking capability into 29 DFGPredictionTracker, which now gets used by both DFGGraph (for 30 forward flow predictions) and DFGPropagator (for backward flow 31 predictions). Backward flow predictions eventually get merged 32 into forward flow ones, but the two are not equivalent: a forward 33 flow prediction is a superset of the backward flow prediction. 34 35 Debugging these prediction issues required a better understanding 36 of where we fail speculation, and what our value predictions look 37 like. This patch also adds optional verbose speculation failure 38 (so an informative printf fires whenever speculation failure occurs) 39 and slight improvements to the verbosity in other places. 40 41 * bytecode/ValueProfile.h: 42 (JSC::ValueProfile::numberOfBooleans): 43 (JSC::ValueProfile::probabilityOfBoolean): 44 (JSC::ValueProfile::dump): 45 (JSC::ValueProfile::computeStatistics): 46 * dfg/DFGByteCodeParser.cpp: 47 (JSC::DFG::ByteCodeParser::stronglyPredict): 48 (JSC::DFG::ByteCodeParser::parseBlock): 49 * dfg/DFGGenerationInfo.h: 50 (JSC::DFG::dataFormatToString): 51 (JSC::DFG::needDataFormatConversion): 52 * dfg/DFGGraph.cpp: 53 (JSC::DFG::Graph::dump): 54 (JSC::DFG::Graph::predictArgumentTypes): 55 * dfg/DFGGraph.h: 56 (JSC::DFG::Graph::Graph): 57 (JSC::DFG::Graph::predictions): 58 (JSC::DFG::Graph::predict): 59 (JSC::DFG::Graph::predictGlobalVar): 60 (JSC::DFG::Graph::getPrediction): 61 (JSC::DFG::Graph::getGlobalVarPrediction): 62 (JSC::DFG::Graph::isBooleanConstant): 63 (JSC::DFG::Graph::valueOfBooleanConstant): 64 * dfg/DFGJITCodeGenerator.cpp: 65 (JSC::DFG::JITCodeGenerator::fillInteger): 66 (JSC::DFG::JITCodeGenerator::fillDouble): 67 (JSC::DFG::JITCodeGenerator::fillJSValue): 68 (JSC::DFG::JITCodeGenerator::isKnownNotInteger): 69 (JSC::DFG::JITCodeGenerator::isKnownBoolean): 70 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompareNull): 71 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeCompare): 72 (JSC::DFG::JITCodeGenerator::nonSpeculativeNonPeepholeStrictEq): 73 (JSC::DFG::JITCodeGenerator::emitBranch): 74 (JSC::DFG::JITCodeGenerator::speculationCheck): 75 (JSC::DFG::GPRTemporary::GPRTemporary): 76 * dfg/DFGJITCodeGenerator.h: 77 (JSC::DFG::JITCodeGenerator::isBooleanConstant): 78 (JSC::DFG::JITCodeGenerator::valueOfBooleanConstant): 79 * dfg/DFGJITCompiler.cpp: 80 (JSC::DFG::JITCompiler::jumpFromSpeculativeToNonSpeculative): 81 (JSC::DFG::JITCompiler::link): 82 * dfg/DFGJITCompiler.h: 83 (JSC::DFG::JITCompiler::debugCall): 84 (JSC::DFG::JITCompiler::isBooleanConstant): 85 (JSC::DFG::JITCompiler::valueOfBooleanConstant): 86 * dfg/DFGNode.h: 87 (JSC::DFG::isBooleanPrediction): 88 (JSC::DFG::predictionToString): 89 (JSC::DFG::mergePredictions): 90 (JSC::DFG::makePrediction): 91 (JSC::DFG::Node::isBooleanConstant): 92 (JSC::DFG::Node::valueOfBooleanConstant): 93 (JSC::DFG::Node::hasBooleanResult): 94 (JSC::DFG::Node::hasNumericResult): 95 (JSC::DFG::Node::predict): 96 * dfg/DFGOperations.cpp: 97 * dfg/DFGOperations.h: 98 * dfg/DFGPredictionTracker.h: Added. 99 (JSC::DFG::operandIsArgument): 100 (JSC::DFG::PredictionSlot::PredictionSlot): 101 (JSC::DFG::PredictionTracker::PredictionTracker): 102 (JSC::DFG::PredictionTracker::initializeSimilarTo): 103 (JSC::DFG::PredictionTracker::numberOfArguments): 104 (JSC::DFG::PredictionTracker::numberOfVariables): 105 (JSC::DFG::PredictionTracker::argumentIndexForOperand): 106 (JSC::DFG::PredictionTracker::predictArgument): 107 (JSC::DFG::PredictionTracker::predict): 108 (JSC::DFG::PredictionTracker::predictGlobalVar): 109 (JSC::DFG::PredictionTracker::getArgumentPrediction): 110 (JSC::DFG::PredictionTracker::getPrediction): 111 (JSC::DFG::PredictionTracker::getGlobalVarPrediction): 112 * dfg/DFGPropagator.cpp: 113 (JSC::DFG::Propagator::Propagator): 114 (JSC::DFG::Propagator::fixpoint): 115 (JSC::DFG::Propagator::setPrediction): 116 (JSC::DFG::Propagator::mergeUse): 117 (JSC::DFG::Propagator::mergePrediction): 118 (JSC::DFG::Propagator::propagateNode): 119 * dfg/DFGSpeculativeJIT.cpp: 120 (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal): 121 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): 122 (JSC::DFG::SpeculativeJIT::fillSpeculateCell): 123 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 124 (JSC::DFG::SpeculativeJIT::compare): 125 (JSC::DFG::SpeculativeJIT::compile): 126 * dfg/DFGSpeculativeJIT.h: 127 (JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand): 128 (JSC::DFG::SpeculateBooleanOperand::~SpeculateBooleanOperand): 129 (JSC::DFG::SpeculateBooleanOperand::index): 130 (JSC::DFG::SpeculateBooleanOperand::gpr): 131 (JSC::DFG::SpeculateBooleanOperand::use): 132 * runtime/JSGlobalData.h: 133 * runtime/JSValue.cpp: 134 (JSC::JSValue::description): 135 1 136 2011-09-06 Mark Hahnenberg <[email protected]> 2 137
Note:
See TracChangeset
for help on using the changeset viewer.