Changeset 156019 in webkit for trunk/Source/JavaScriptCore/ChangeLog
- Timestamp:
- Sep 17, 2013, 6:31:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r156017 r156019 1 2013-09-16 Filip Pizlo <[email protected]> 2 3 DFG should support Int52 for local variables 4 https://bugs.webkit.org/show_bug.cgi?id=121064 5 6 Reviewed by Oliver Hunt. 7 8 This adds Int52 support for local variables to the DFG and FTL. It's a speed-up on 9 programs that have local int32 overflows but where a larger int representation can 10 prevent us from having to convert all the way up to double. 11 12 It's a small speed-up for now. But we're just supporting Int52 for a handful of 13 operations (add, sub, mul, neg, compare, bitops, typed array access) and this lays 14 the groundwork for adding Int52 to JSValue, which will probably be a bigger 15 speed-up. 16 17 The basic approach is: 18 19 - We have a notion of Int52 in our typesystem. Int52 doesn't belong to BytecodeTop 20 or HeapTop - i.e. it doesn't arise from JSValues. 21 22 - DFG treats Int52 as being part of its FullTop and will treat it as being a 23 subtype of double unless instructed otherwise. 24 25 - Prediction propagator creates Int52s whenever we have a node going doubly but due 26 to large values rather than fractional values, and that node is known to be able 27 to produce Int52 natively in the DFG backend. 28 29 - Fixup phase converts edges to MachineIntUses in nodes that are known to be able 30 to deal with Int52, and where we have a subtype of Int32|Int52 as the predicted 31 input. 32 33 - The DFG backend and FTL LLVM IR lowering have two notions of Int52s - ones that 34 are left-shifted by 16 (great for overflow checks) and ones that are 35 sign-extended. Both backends know how to convert between Int52s and the other 36 representations. 37 38 * assembler/MacroAssemblerX86_64.h: 39 (JSC::MacroAssemblerX86_64::rshift64): 40 (JSC::MacroAssemblerX86_64::mul64): 41 (JSC::MacroAssemblerX86_64::branchMul64): 42 (JSC::MacroAssemblerX86_64::branchNeg64): 43 (JSC::MacroAssemblerX86_64::convertInt64ToDouble): 44 * assembler/X86Assembler.h: 45 (JSC::X86Assembler::imulq_rr): 46 (JSC::X86Assembler::cvtsi2sdq_rr): 47 * bytecode/DataFormat.h: 48 (JSC::dataFormatToString): 49 * bytecode/OperandsInlines.h: 50 (JSC::::dumpInContext): 51 * bytecode/SpeculatedType.cpp: 52 (JSC::dumpSpeculation): 53 (JSC::speculationToAbbreviatedString): 54 (JSC::speculationFromValue): 55 * bytecode/SpeculatedType.h: 56 (JSC::isInt32SpeculationForArithmetic): 57 (JSC::isMachineIntSpeculationForArithmetic): 58 (JSC::isBytecodeRealNumberSpeculation): 59 (JSC::isFullRealNumberSpeculation): 60 (JSC::isBytecodeNumberSpeculation): 61 (JSC::isFullNumberSpeculation): 62 (JSC::isBytecodeNumberSpeculationExpectingDefined): 63 (JSC::isFullNumberSpeculationExpectingDefined): 64 * bytecode/ValueRecovery.h: 65 (JSC::ValueRecovery::alreadyInJSStackAsUnboxedInt52): 66 (JSC::ValueRecovery::inGPR): 67 (JSC::ValueRecovery::displacedInJSStack): 68 (JSC::ValueRecovery::isAlreadyInJSStack): 69 (JSC::ValueRecovery::gpr): 70 (JSC::ValueRecovery::virtualRegister): 71 (JSC::ValueRecovery::dumpInContext): 72 * dfg/DFGAbstractInterpreter.h: 73 (JSC::DFG::AbstractInterpreter::needsTypeCheck): 74 (JSC::DFG::AbstractInterpreter::filterByType): 75 * dfg/DFGAbstractInterpreterInlines.h: 76 (JSC::DFG::::executeEffects): 77 * dfg/DFGAbstractValue.cpp: 78 (JSC::DFG::AbstractValue::set): 79 (JSC::DFG::AbstractValue::checkConsistency): 80 * dfg/DFGAbstractValue.h: 81 (JSC::DFG::AbstractValue::couldBeType): 82 (JSC::DFG::AbstractValue::isType): 83 (JSC::DFG::AbstractValue::checkConsistency): 84 (JSC::DFG::AbstractValue::validateType): 85 * dfg/DFGArrayMode.cpp: 86 (JSC::DFG::ArrayMode::refine): 87 * dfg/DFGAssemblyHelpers.h: 88 (JSC::DFG::AssemblyHelpers::boxInt52): 89 * dfg/DFGCSEPhase.cpp: 90 (JSC::DFG::CSEPhase::pureCSE): 91 (JSC::DFG::CSEPhase::getByValLoadElimination): 92 (JSC::DFG::CSEPhase::performNodeCSE): 93 * dfg/DFGClobberize.h: 94 (JSC::DFG::clobberize): 95 * dfg/DFGCommon.h: 96 (JSC::DFG::enableInt52): 97 * dfg/DFGFixupPhase.cpp: 98 (JSC::DFG::FixupPhase::run): 99 (JSC::DFG::FixupPhase::fixupNode): 100 (JSC::DFG::FixupPhase::fixupSetLocalsInBlock): 101 (JSC::DFG::FixupPhase::fixupUntypedSetLocalsInBlock): 102 (JSC::DFG::FixupPhase::observeUseKindOnNode): 103 (JSC::DFG::FixupPhase::fixEdge): 104 (JSC::DFG::FixupPhase::injectInt32ToDoubleNode): 105 (JSC::DFG::FixupPhase::attemptToMakeIntegerAdd): 106 * dfg/DFGFlushFormat.cpp: 107 (WTF::printInternal): 108 * dfg/DFGFlushFormat.h: 109 (JSC::DFG::resultFor): 110 (JSC::DFG::useKindFor): 111 * dfg/DFGGenerationInfo.h: 112 (JSC::DFG::GenerationInfo::initInt52): 113 (JSC::DFG::GenerationInfo::initStrictInt52): 114 (JSC::DFG::GenerationInfo::isFormat): 115 (JSC::DFG::GenerationInfo::isInt52): 116 (JSC::DFG::GenerationInfo::isStrictInt52): 117 (JSC::DFG::GenerationInfo::fillInt52): 118 (JSC::DFG::GenerationInfo::fillStrictInt52): 119 * dfg/DFGGraph.cpp: 120 (JSC::DFG::Graph::dump): 121 * dfg/DFGGraph.h: 122 (JSC::DFG::Graph::addShouldSpeculateMachineInt): 123 (JSC::DFG::Graph::mulShouldSpeculateMachineInt): 124 (JSC::DFG::Graph::negateShouldSpeculateMachineInt): 125 * dfg/DFGInPlaceAbstractState.cpp: 126 (JSC::DFG::InPlaceAbstractState::mergeStateAtTail): 127 * dfg/DFGJITCode.cpp: 128 (JSC::DFG::JITCode::reconstruct): 129 * dfg/DFGMinifiedNode.h: 130 (JSC::DFG::belongsInMinifiedGraph): 131 (JSC::DFG::MinifiedNode::hasChild): 132 * dfg/DFGNode.h: 133 (JSC::DFG::Node::shouldSpeculateNumber): 134 (JSC::DFG::Node::shouldSpeculateNumberExpectingDefined): 135 * dfg/DFGNodeFlags.h: 136 * dfg/DFGNodeType.h: 137 (JSC::DFG::forwardRewiringSelectionScore): 138 * dfg/DFGOSRExitCompiler.cpp: 139 * dfg/DFGOSRExitCompiler64.cpp: 140 (JSC::DFG::OSRExitCompiler::compileExit): 141 * dfg/DFGPredictionPropagationPhase.cpp: 142 (JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPrediction): 143 (JSC::DFG::PredictionPropagationPhase::propagate): 144 (JSC::DFG::PredictionPropagationPhase::doDoubleVoting): 145 * dfg/DFGSafeToExecute.h: 146 (JSC::DFG::SafeToExecuteEdge::operator()): 147 (JSC::DFG::safeToExecute): 148 * dfg/DFGSilentRegisterSavePlan.h: 149 * dfg/DFGSpeculativeJIT.cpp: 150 (JSC::DFG::SpeculativeJIT::silentSavePlanForGPR): 151 (JSC::DFG::SpeculativeJIT::silentFill): 152 (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch): 153 (JSC::DFG::SpeculativeJIT::compileInlineStart): 154 (JSC::DFG::SpeculativeJIT::compileDoublePutByVal): 155 (JSC::DFG::SpeculativeJIT::compileValueToInt32): 156 (JSC::DFG::SpeculativeJIT::compileInt32ToDouble): 157 (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray): 158 (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray): 159 (JSC::DFG::SpeculativeJIT::compileAdd): 160 (JSC::DFG::SpeculativeJIT::compileArithSub): 161 (JSC::DFG::SpeculativeJIT::compileArithNegate): 162 (JSC::DFG::SpeculativeJIT::compileArithMul): 163 (JSC::DFG::SpeculativeJIT::compare): 164 (JSC::DFG::SpeculativeJIT::compileStrictEq): 165 (JSC::DFG::SpeculativeJIT::speculateMachineInt): 166 (JSC::DFG::SpeculativeJIT::speculateNumber): 167 (JSC::DFG::SpeculativeJIT::speculateRealNumber): 168 (JSC::DFG::SpeculativeJIT::speculate): 169 * dfg/DFGSpeculativeJIT.h: 170 (JSC::DFG::SpeculativeJIT::canReuse): 171 (JSC::DFG::SpeculativeJIT::isFilled): 172 (JSC::DFG::SpeculativeJIT::isFilledDouble): 173 (JSC::DFG::SpeculativeJIT::use): 174 (JSC::DFG::SpeculativeJIT::isKnownInteger): 175 (JSC::DFG::SpeculativeJIT::isKnownCell): 176 (JSC::DFG::SpeculativeJIT::isKnownNotNumber): 177 (JSC::DFG::SpeculativeJIT::int52Result): 178 (JSC::DFG::SpeculativeJIT::strictInt52Result): 179 (JSC::DFG::SpeculativeJIT::initConstantInfo): 180 (JSC::DFG::SpeculativeJIT::isInteger): 181 (JSC::DFG::SpeculativeJIT::betterUseStrictInt52): 182 (JSC::DFG::SpeculativeJIT::generationInfo): 183 (JSC::DFG::SpeculateInt52Operand::SpeculateInt52Operand): 184 (JSC::DFG::SpeculateInt52Operand::~SpeculateInt52Operand): 185 (JSC::DFG::SpeculateInt52Operand::edge): 186 (JSC::DFG::SpeculateInt52Operand::node): 187 (JSC::DFG::SpeculateInt52Operand::gpr): 188 (JSC::DFG::SpeculateInt52Operand::use): 189 (JSC::DFG::SpeculateStrictInt52Operand::SpeculateStrictInt52Operand): 190 (JSC::DFG::SpeculateStrictInt52Operand::~SpeculateStrictInt52Operand): 191 (JSC::DFG::SpeculateStrictInt52Operand::edge): 192 (JSC::DFG::SpeculateStrictInt52Operand::node): 193 (JSC::DFG::SpeculateStrictInt52Operand::gpr): 194 (JSC::DFG::SpeculateStrictInt52Operand::use): 195 (JSC::DFG::SpeculateWhicheverInt52Operand::SpeculateWhicheverInt52Operand): 196 (JSC::DFG::SpeculateWhicheverInt52Operand::~SpeculateWhicheverInt52Operand): 197 (JSC::DFG::SpeculateWhicheverInt52Operand::edge): 198 (JSC::DFG::SpeculateWhicheverInt52Operand::node): 199 (JSC::DFG::SpeculateWhicheverInt52Operand::gpr): 200 (JSC::DFG::SpeculateWhicheverInt52Operand::use): 201 (JSC::DFG::SpeculateWhicheverInt52Operand::format): 202 * dfg/DFGSpeculativeJIT32_64.cpp: 203 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): 204 (JSC::DFG::SpeculativeJIT::compile): 205 * dfg/DFGSpeculativeJIT64.cpp: 206 (JSC::DFG::SpeculativeJIT::boxInt52): 207 (JSC::DFG::SpeculativeJIT::fillJSValue): 208 (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal): 209 (JSC::DFG::SpeculativeJIT::fillSpeculateInt52): 210 (JSC::DFG::SpeculativeJIT::fillSpeculateDouble): 211 (JSC::DFG::SpeculativeJIT::fillSpeculateCell): 212 (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean): 213 (JSC::DFG::SpeculativeJIT::compileInt52Compare): 214 (JSC::DFG::SpeculativeJIT::compilePeepHoleInt52Branch): 215 (JSC::DFG::SpeculativeJIT::compile): 216 * dfg/DFGUseKind.cpp: 217 (WTF::printInternal): 218 * dfg/DFGUseKind.h: 219 (JSC::DFG::typeFilterFor): 220 (JSC::DFG::isNumerical): 221 * dfg/DFGValueSource.cpp: 222 (JSC::DFG::ValueSource::dump): 223 * dfg/DFGValueSource.h: 224 (JSC::DFG::dataFormatToValueSourceKind): 225 (JSC::DFG::valueSourceKindToDataFormat): 226 (JSC::DFG::ValueSource::forFlushFormat): 227 (JSC::DFG::ValueSource::valueRecovery): 228 * dfg/DFGVariableAccessData.h: 229 (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote): 230 (JSC::DFG::VariableAccessData::flushFormat): 231 * ftl/FTLCArgumentGetter.cpp: 232 (JSC::FTL::CArgumentGetter::loadNextAndBox): 233 * ftl/FTLCArgumentGetter.h: 234 * ftl/FTLCapabilities.cpp: 235 (JSC::FTL::canCompile): 236 * ftl/FTLExitValue.cpp: 237 (JSC::FTL::ExitValue::dumpInContext): 238 * ftl/FTLExitValue.h: 239 (JSC::FTL::ExitValue::inJSStackAsInt52): 240 * ftl/FTLIntrinsicRepository.h: 241 * ftl/FTLLowerDFGToLLVM.cpp: 242 (JSC::FTL::LowerDFGToLLVM::createPhiVariables): 243 (JSC::FTL::LowerDFGToLLVM::compileNode): 244 (JSC::FTL::LowerDFGToLLVM::compileUpsilon): 245 (JSC::FTL::LowerDFGToLLVM::compilePhi): 246 (JSC::FTL::LowerDFGToLLVM::compileSetLocal): 247 (JSC::FTL::LowerDFGToLLVM::compileAdd): 248 (JSC::FTL::LowerDFGToLLVM::compileArithSub): 249 (JSC::FTL::LowerDFGToLLVM::compileArithMul): 250 (JSC::FTL::LowerDFGToLLVM::compileArithNegate): 251 (JSC::FTL::LowerDFGToLLVM::compilePutByVal): 252 (JSC::FTL::LowerDFGToLLVM::compileCompareEq): 253 (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq): 254 (JSC::FTL::LowerDFGToLLVM::compileCompareLess): 255 (JSC::FTL::LowerDFGToLLVM::compileCompareLessEq): 256 (JSC::FTL::LowerDFGToLLVM::compileCompareGreater): 257 (JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq): 258 (JSC::FTL::LowerDFGToLLVM::lowInt32): 259 (JSC::FTL::LowerDFGToLLVM::lowInt52): 260 (JSC::FTL::LowerDFGToLLVM::lowStrictInt52): 261 (JSC::FTL::LowerDFGToLLVM::betterUseStrictInt52): 262 (JSC::FTL::LowerDFGToLLVM::bestInt52Kind): 263 (JSC::FTL::LowerDFGToLLVM::opposite): 264 (JSC::FTL::LowerDFGToLLVM::Int52s::operator[]): 265 (JSC::FTL::LowerDFGToLLVM::lowWhicheverInt52): 266 (JSC::FTL::LowerDFGToLLVM::lowWhicheverInt52s): 267 (JSC::FTL::LowerDFGToLLVM::lowOpposingInt52s): 268 (JSC::FTL::LowerDFGToLLVM::lowCell): 269 (JSC::FTL::LowerDFGToLLVM::lowBoolean): 270 (JSC::FTL::LowerDFGToLLVM::lowDouble): 271 (JSC::FTL::LowerDFGToLLVM::lowJSValue): 272 (JSC::FTL::LowerDFGToLLVM::strictInt52ToInt32): 273 (JSC::FTL::LowerDFGToLLVM::strictInt52ToDouble): 274 (JSC::FTL::LowerDFGToLLVM::strictInt52ToJSValue): 275 (JSC::FTL::LowerDFGToLLVM::setInt52WithStrictValue): 276 (JSC::FTL::LowerDFGToLLVM::strictInt52ToInt52): 277 (JSC::FTL::LowerDFGToLLVM::int52ToStrictInt52): 278 (JSC::FTL::LowerDFGToLLVM::speculateRealNumber): 279 (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock): 280 (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall): 281 (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode): 282 (JSC::FTL::LowerDFGToLLVM::setInt52): 283 (JSC::FTL::LowerDFGToLLVM::setStrictInt52): 284 * ftl/FTLOSRExitCompiler.cpp: 285 (JSC::FTL::compileStub): 286 * ftl/FTLOutput.h: 287 (JSC::FTL::Output::addWithOverflow64): 288 (JSC::FTL::Output::subWithOverflow64): 289 (JSC::FTL::Output::mulWithOverflow64): 290 * ftl/FTLValueFormat.cpp: 291 (WTF::printInternal): 292 * ftl/FTLValueFormat.h: 293 * ftl/FTLValueSource.cpp: 294 (JSC::FTL::ValueSource::dump): 295 * ftl/FTLValueSource.h: 296 * interpreter/Register.h: 297 (JSC::Register::unboxedInt52): 298 * runtime/Arguments.cpp: 299 (JSC::Arguments::tearOffForInlineCallFrame): 300 * runtime/IndexingType.cpp: 301 (JSC::leastUpperBoundOfIndexingTypeAndType): 302 * runtime/JSCJSValue.h: 303 * runtime/JSCJSValueInlines.h: 304 (JSC::JSValue::isMachineInt): 305 (JSC::JSValue::asMachineInt): 306 1 307 2013-09-17 Filip Pizlo <[email protected]> 2 308
Note:
See TracChangeset
for help on using the changeset viewer.