haikuwebkit/Source/WTF/wtf/IndexMap.h

106 lines
3.4 KiB
C
Raw Permalink Normal View History

Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
/*
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
* Copyright (C) 2015-2017 Apple Inc. All rights reserved.
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
[JSC] Move generic data structures out of B3 https://bugs.webkit.org/show_bug.cgi?id=161155 Reviewed by Saam Barati. Source/JavaScriptCore: Move B3's good generic data structures to WTF. They can be used for the other kind of basic blocks and nodes. For example, the generator patch[1] will make BytecodeBasicBlock usable with these structures. [1]: https://bugs.webkit.org/show_bug.cgi?id=152723 * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: * b3/B3BlockWorklist.h: * b3/B3CFG.h: * b3/B3DuplicateTails.cpp: * b3/B3FixSSA.cpp: * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::IndexMap): Deleted. (JSC::B3::IndexMap::resize): Deleted. (JSC::B3::IndexMap::clear): Deleted. (JSC::B3::IndexMap::size): Deleted. (JSC::B3::IndexMap::operator[]): Deleted. * b3/B3IndexSet.h: (JSC::B3::IndexSet::IndexSet): Deleted. (JSC::B3::IndexSet::add): Deleted. (JSC::B3::IndexSet::addAll): Deleted. (JSC::B3::IndexSet::remove): Deleted. (JSC::B3::IndexSet::contains): Deleted. (JSC::B3::IndexSet::size): Deleted. (JSC::B3::IndexSet::isEmpty): Deleted. (JSC::B3::IndexSet::Iterable::Iterable): Deleted. (JSC::B3::IndexSet::Iterable::iterator::iterator): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator*): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator++): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator==): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator!=): Deleted. (JSC::B3::IndexSet::Iterable::begin): Deleted. (JSC::B3::IndexSet::Iterable::end): Deleted. (JSC::B3::IndexSet::values): Deleted. (JSC::B3::IndexSet::indices): Deleted. (JSC::B3::IndexSet::dump): Deleted. * b3/B3LowerToAir.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.h: (JSC::B3::Procedure::iterator::iterator): Deleted. (JSC::B3::Procedure::iterator::operator*): Deleted. (JSC::B3::Procedure::iterator::operator++): Deleted. (JSC::B3::Procedure::iterator::operator==): Deleted. (JSC::B3::Procedure::iterator::operator!=): Deleted. (JSC::B3::Procedure::iterator::findNext): Deleted. * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirCode.h: * b3/air/AirEliminateDeadCode.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: * b3/air/AirGenerate.cpp: * b3/air/AirGenerationContext.h: * b3/air/AirLiveness.h: * b3/air/AirSpillEverything.cpp: Source/WTF: Add IndexSet, IndexMap, and IndexedContainerIterator. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/IndexMap.h: Copied from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): (WTF::IndexMap::size): (WTF::IndexMap::operator[]): * wtf/IndexSet.h: Renamed from Source/JavaScriptCore/b3/B3IndexSet.h. (WTF::IndexSet::IndexSet): (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::size): (WTF::IndexSet::isEmpty): (WTF::IndexSet::Iterable::Iterable): (WTF::IndexSet::Iterable::iterator::iterator): (WTF::IndexSet::Iterable::iterator::operator*): (WTF::IndexSet::Iterable::iterator::operator++): (WTF::IndexSet::Iterable::iterator::operator==): (WTF::IndexSet::Iterable::iterator::operator!=): (WTF::IndexSet::Iterable::begin): (WTF::IndexSet::Iterable::end): (WTF::IndexSet::values): (WTF::IndexSet::indices): (WTF::IndexSet::dump): * wtf/IndexedContainerIterator.h: Renamed from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexedContainerIterator::IndexedContainerIterator): (WTF::IndexedContainerIterator::operator++): (WTF::IndexedContainerIterator::operator==): (WTF::IndexedContainerIterator::operator!=): (WTF::IndexedContainerIterator::findNext): Canonical link: https://commits.webkit.org/179305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-24 19:35:41 +00:00
#pragma once
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
Air should support linear scan for optLevel<2 https://bugs.webkit.org/show_bug.cgi?id=170161 Reviewed by Saam Barati. Source/JavaScriptCore: This changes the default opt level of B3 to 2. It makes the other opt levels useful by adding a new register allocator. This new linear scan allocator will produce significantly worse code. But it will produce that code a lot faster than IRC or Briggs. The opt levels are: 0: no optimizations, linear scan 1: some optimizations, linear scan 2: full optimizations, graph coloring (IRC or Briggs based on CPU) What we used to call optLevel=1 is not called optLevel=2, or better yet, optLevel=B3::defaultOptLevel(). We no longer have anything like the old optLevel=0 (which did no optimizations but ran graph coloring). allocateRegistersByLinearScan() faithfully implements Massimiliano Poletto and Vivek Sarkar's famous algorithm. It uses the variant that handles clobbered registers by avoiding assigning ranges to those registers if the range overlaps a clobber. It's engineered to allocate registers very quickly and generate inefficient code without falling off a cliff. The new optLevel=1 speeds up B3 by a factor of 2, and results in a 80% throughput regression. Linear scan runs 4.7x faster than graph coloring on average. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: * b3/B3CFG.h: (JSC::B3::CFG::newMap): * b3/B3Common.h: (JSC::B3::defaultOptLevel): * b3/B3Compile.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3Generate.cpp: (JSC::B3::prepareForGeneration): (JSC::B3::generateToAir): * b3/B3Generate.h: * b3/B3HeapRange.cpp: Removed. * b3/B3HeapRange.h: (JSC::B3::HeapRange::HeapRange): Deleted. (JSC::B3::HeapRange::top): Deleted. (JSC::B3::HeapRange::operator==): Deleted. (JSC::B3::HeapRange::operator!=): Deleted. (JSC::B3::HeapRange::operator|): Deleted. (JSC::B3::HeapRange::operator bool): Deleted. (JSC::B3::HeapRange::begin): Deleted. (JSC::B3::HeapRange::end): Deleted. (JSC::B3::HeapRange::overlaps): Deleted. * b3/B3LowerToAir.cpp: * b3/B3MoveConstants.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::setBlockOrderImpl): * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByLinearScan.cpp: Added. (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirAllocateRegistersByLinearScan.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::activeAt): (JSC::B3::Air::Arg::timing): (JSC::B3::Air::Arg::forEachPhase): * b3/air/AirBasicBlock.h: * b3/air/AirBlockWorklist.h: * b3/air/AirCFG.h: (JSC::B3::Air::CFG::newMap): * b3/air/AirEliminateDeadCode.cpp: (JSC::B3::Air::eliminateDeadCode): * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: (JSC::B3::Air::fixPartialRegisterStalls): * b3/air/AirFixSpillsAfterTerminals.cpp: Added. (JSC::B3::Air::fixSpillsAfterTerminals): * b3/air/AirFixSpillsAfterTerminals.h: Added. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirGenerate.h: * b3/air/AirGenerationContext.h: * b3/air/AirInsertionSet.h: * b3/air/AirInst.cpp: (JSC::B3::Air::Inst::needsPadding): * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirLowerEntrySwitch.cpp: (JSC::B3::Air::lowerEntrySwitch): * b3/air/AirOpcode.opcodes: * b3/air/AirPhaseInsertionSet.cpp: Added. (JSC::B3::Air::PhaseInsertionSet::execute): * b3/air/AirPhaseInsertionSet.h: Added. (JSC::B3::Air::PhaseInsertion::PhaseInsertion): (JSC::B3::Air::PhaseInsertion::phase): (JSC::B3::Air::PhaseInsertion::operator<): (JSC::B3::Air::PhaseInsertionSet::PhaseInsertionSet): (JSC::B3::Air::PhaseInsertionSet::appendInsertion): (JSC::B3::Air::PhaseInsertionSet::insertInst): (JSC::B3::Air::PhaseInsertionSet::insert): * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: (JSC::B3::Air::Tmp::tmpForIndex): * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::Indexed::Indexed): (JSC::B3::Air::Tmp::Indexed::index): (JSC::B3::Air::Tmp::AbsolutelyIndexed::AbsolutelyIndexed): (JSC::B3::Air::Tmp::AbsolutelyIndexed::index): (JSC::B3::Air::Tmp::indexed): (JSC::B3::Air::Tmp::absolutelyIndexed): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): * b3/testb3.cpp: (JSC::B3::compile): (JSC::B3::testMulLoadTwice): * jit/RegisterSet.h: (JSC::RegisterSet::add): (JSC::RegisterSet::remove): * runtime/Options.h: * wasm/WasmB3IRGenerator.h: Source/WTF: This change introduces a new low-latency register allocator. It can allocate registers very quickly by doing a relatively poor job. Implementing this algorithm required beefing up some of our core algorithms. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Deque.h: Make it possible to do some basic priority queueing with this data structure. (WTF::inlineCapacity>::removeAllMatching): (WTF::inlineCapacity>::appendAndBubble): (WTF::inlineCapacity>::takeLast): * wtf/IndexKeyType.h: Added. This makes it possible to use IndexMap and IndexSet with value or pointer types. Previously they just worked with pointer types. (WTF::IndexKeyType::index): * wtf/IndexMap.h: Adopt IndexKeyType. (WTF::IndexMap::operator[]): (WTF::IndexMap::append): * wtf/IndexSet.h: Adopt IndexKeyType. (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::Iterable::iterator::operator*): * wtf/Range.h: Added. This used to be B3::HeapRange. This generalizes that data structure to any kind of range stuff. (WTF::Range::Range): (WTF::Range::top): (WTF::Range::operator==): (WTF::Range::operator!=): (WTF::Range::operator bool): (WTF::Range::operator|): (WTF::Range::operator|=): (WTF::Range::begin): (WTF::Range::end): (WTF::Range::overlaps): (WTF::Range::dump): * wtf/RangeSet.h: (WTF::RangeSet::add): Tools: This makes us run a bunch of JS tests at optLevel=1 to force testing of this new compiler pipeline. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/187230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-30 22:55:44 +00:00
#include <wtf/IndexKeyType.h>
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
#include <wtf/Vector.h>
[JSC] Move generic data structures out of B3 https://bugs.webkit.org/show_bug.cgi?id=161155 Reviewed by Saam Barati. Source/JavaScriptCore: Move B3's good generic data structures to WTF. They can be used for the other kind of basic blocks and nodes. For example, the generator patch[1] will make BytecodeBasicBlock usable with these structures. [1]: https://bugs.webkit.org/show_bug.cgi?id=152723 * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: * b3/B3BlockWorklist.h: * b3/B3CFG.h: * b3/B3DuplicateTails.cpp: * b3/B3FixSSA.cpp: * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::IndexMap): Deleted. (JSC::B3::IndexMap::resize): Deleted. (JSC::B3::IndexMap::clear): Deleted. (JSC::B3::IndexMap::size): Deleted. (JSC::B3::IndexMap::operator[]): Deleted. * b3/B3IndexSet.h: (JSC::B3::IndexSet::IndexSet): Deleted. (JSC::B3::IndexSet::add): Deleted. (JSC::B3::IndexSet::addAll): Deleted. (JSC::B3::IndexSet::remove): Deleted. (JSC::B3::IndexSet::contains): Deleted. (JSC::B3::IndexSet::size): Deleted. (JSC::B3::IndexSet::isEmpty): Deleted. (JSC::B3::IndexSet::Iterable::Iterable): Deleted. (JSC::B3::IndexSet::Iterable::iterator::iterator): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator*): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator++): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator==): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator!=): Deleted. (JSC::B3::IndexSet::Iterable::begin): Deleted. (JSC::B3::IndexSet::Iterable::end): Deleted. (JSC::B3::IndexSet::values): Deleted. (JSC::B3::IndexSet::indices): Deleted. (JSC::B3::IndexSet::dump): Deleted. * b3/B3LowerToAir.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.h: (JSC::B3::Procedure::iterator::iterator): Deleted. (JSC::B3::Procedure::iterator::operator*): Deleted. (JSC::B3::Procedure::iterator::operator++): Deleted. (JSC::B3::Procedure::iterator::operator==): Deleted. (JSC::B3::Procedure::iterator::operator!=): Deleted. (JSC::B3::Procedure::iterator::findNext): Deleted. * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirCode.h: * b3/air/AirEliminateDeadCode.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: * b3/air/AirGenerate.cpp: * b3/air/AirGenerationContext.h: * b3/air/AirLiveness.h: * b3/air/AirSpillEverything.cpp: Source/WTF: Add IndexSet, IndexMap, and IndexedContainerIterator. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/IndexMap.h: Copied from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): (WTF::IndexMap::size): (WTF::IndexMap::operator[]): * wtf/IndexSet.h: Renamed from Source/JavaScriptCore/b3/B3IndexSet.h. (WTF::IndexSet::IndexSet): (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::size): (WTF::IndexSet::isEmpty): (WTF::IndexSet::Iterable::Iterable): (WTF::IndexSet::Iterable::iterator::iterator): (WTF::IndexSet::Iterable::iterator::operator*): (WTF::IndexSet::Iterable::iterator::operator++): (WTF::IndexSet::Iterable::iterator::operator==): (WTF::IndexSet::Iterable::iterator::operator!=): (WTF::IndexSet::Iterable::begin): (WTF::IndexSet::Iterable::end): (WTF::IndexSet::values): (WTF::IndexSet::indices): (WTF::IndexSet::dump): * wtf/IndexedContainerIterator.h: Renamed from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexedContainerIterator::IndexedContainerIterator): (WTF::IndexedContainerIterator::operator++): (WTF::IndexedContainerIterator::operator==): (WTF::IndexedContainerIterator::operator!=): (WTF::IndexedContainerIterator::findNext): Canonical link: https://commits.webkit.org/179305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-24 19:35:41 +00:00
namespace WTF {
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
// This is a map for keys that have an index(). It's super efficient for BasicBlocks. It's only
// efficient for Values if you don't create too many of these maps, since Values can have very
// sparse indices and there are a lot of Values.
template<typename Key, typename Value>
class IndexMap {
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced https://bugs.webkit.org/show_bug.cgi?id=200611 Reviewed by Saam Barati. Source/JavaScriptCore: This patch aggressively puts many classes into FastMalloc. In JSC side, we grep `std::make_unique` etc. to find potentially system-malloc-allocated classes. After this patch, all the JSC related allocations in JetStream2 cli is done from bmalloc. In the future, it would be nice that we add `WTF::makeUnique<T>` helper function and throw a compile error if `T` is not FastMalloc annotated[1]. Putting WebKit classes in FastMalloc has many benefits. 1. Simply, it is fast. 2. vmmap can tell the amount of memory used for WebKit. 3. bmalloc can isolate WebKit memory allocation from the rest of the world. This is useful since we can know more about what component is corrupting the memory from the memory corruption crash. [1]: https://bugs.webkit.org/show_bug.cgi?id=200620 * API/ObjCCallbackFunction.mm: * assembler/AbstractMacroAssembler.h: * b3/B3PhiChildren.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirDisassembler.h: * bytecode/AccessCaseSnippetParams.h: * bytecode/CallVariant.h: * bytecode/DeferredSourceDump.h: * bytecode/ExecutionCounter.h: * bytecode/GetByIdStatus.h: * bytecode/GetByIdVariant.h: * bytecode/InByIdStatus.h: * bytecode/InByIdVariant.h: * bytecode/InstanceOfStatus.h: * bytecode/InstanceOfVariant.h: * bytecode/PutByIdStatus.h: * bytecode/PutByIdVariant.h: * bytecode/ValueProfile.h: * dfg/DFGAbstractInterpreter.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::newVariableAccessData): * dfg/DFGFlowIndexing.h: * dfg/DFGFlowMap.h: * dfg/DFGLiveCatchVariablePreservationPhase.cpp: (JSC::DFG::LiveCatchVariablePreservationPhase::newVariableAccessData): * dfg/DFGMaximalFlushInsertionPhase.cpp: (JSC::DFG::MaximalFlushInsertionPhase::newVariableAccessData): * dfg/DFGOSRExit.h: * dfg/DFGSpeculativeJIT.h: * dfg/DFGVariableAccessData.h: * disassembler/ARM64/A64DOpcode.h: * inspector/remote/socket/RemoteInspectorMessageParser.h: * inspector/remote/socket/RemoteInspectorSocket.h: * inspector/remote/socket/RemoteInspectorSocketEndpoint.h: * jit/PCToCodeOriginMap.h: * runtime/BasicBlockLocation.h: * runtime/DoublePredictionFuzzerAgent.h: * runtime/JSRunLoopTimer.h: * runtime/PromiseDeferredTimer.h: (JSC::PromiseDeferredTimer::create): PromiseDeferredTimer should be allocated as `Ref<>` instead of `std::unique_ptr` since it is inheriting ThreadSafeRefCounted<>. Holding such a class with std::unique_ptr could lead to potentially dangerous operations (like, someone holds it with Ref<> while it is deleted by std::unique_ptr<>). * runtime/RandomizingFuzzerAgent.h: * runtime/SymbolTable.h: * runtime/VM.cpp: (JSC::VM::VM): * runtime/VM.h: * tools/JSDollarVM.cpp: * tools/SigillCrashAnalyzer.cpp: * wasm/WasmFormat.h: * wasm/WasmMemory.cpp: * wasm/WasmSignature.h: * yarr/YarrJIT.h: Source/WebCore: Changed the accessor since we changed std::unique_ptr to Ref for this field. No behavior change. * bindings/js/WorkerScriptController.cpp: (WebCore::WorkerScriptController::addTimerSetNotification): (WebCore::WorkerScriptController::removeTimerSetNotification): Source/WTF: WTF has many data structures, in particular, containers. And these containers can be allocated like `std::make_unique<Container>()`. Without WTF_MAKE_FAST_ALLOCATED, this container itself is allocated from the system malloc. This patch attaches WTF_MAKE_FAST_ALLOCATED more aggressively not to allocate them from the system malloc. And we add some `final` to containers and classes that would be never inherited. * wtf/Assertions.cpp: * wtf/Atomics.h: * wtf/AutodrainedPool.h: * wtf/Bag.h: (WTF::Bag::Bag): Deleted. (WTF::Bag::~Bag): Deleted. (WTF::Bag::clear): Deleted. (WTF::Bag::add): Deleted. (WTF::Bag::iterator::iterator): Deleted. (WTF::Bag::iterator::operator! const): Deleted. (WTF::Bag::iterator::operator* const): Deleted. (WTF::Bag::iterator::operator++): Deleted. (WTF::Bag::iterator::operator== const): Deleted. (WTF::Bag::iterator::operator!= const): Deleted. (WTF::Bag::begin): Deleted. (WTF::Bag::begin const): Deleted. (WTF::Bag::end const): Deleted. (WTF::Bag::isEmpty const): Deleted. (WTF::Bag::unwrappedHead const): Deleted. * wtf/BitVector.h: (WTF::BitVector::BitVector): Deleted. (WTF::BitVector::~BitVector): Deleted. (WTF::BitVector::operator=): Deleted. (WTF::BitVector::size const): Deleted. (WTF::BitVector::ensureSize): Deleted. (WTF::BitVector::quickGet const): Deleted. (WTF::BitVector::quickSet): Deleted. (WTF::BitVector::quickClear): Deleted. (WTF::BitVector::get const): Deleted. (WTF::BitVector::contains const): Deleted. (WTF::BitVector::set): Deleted. (WTF::BitVector::add): Deleted. (WTF::BitVector::ensureSizeAndSet): Deleted. (WTF::BitVector::clear): Deleted. (WTF::BitVector::remove): Deleted. (WTF::BitVector::merge): Deleted. (WTF::BitVector::filter): Deleted. (WTF::BitVector::exclude): Deleted. (WTF::BitVector::bitCount const): Deleted. (WTF::BitVector::isEmpty const): Deleted. (WTF::BitVector::findBit const): Deleted. (WTF::BitVector::isEmptyValue const): Deleted. (WTF::BitVector::isDeletedValue const): Deleted. (WTF::BitVector::isEmptyOrDeletedValue const): Deleted. (WTF::BitVector::operator== const): Deleted. (WTF::BitVector::hash const): Deleted. (WTF::BitVector::iterator::iterator): Deleted. (WTF::BitVector::iterator::operator* const): Deleted. (WTF::BitVector::iterator::operator++): Deleted. (WTF::BitVector::iterator::isAtEnd const): Deleted. (WTF::BitVector::iterator::operator== const): Deleted. (WTF::BitVector::iterator::operator!= const): Deleted. (WTF::BitVector::begin const): Deleted. (WTF::BitVector::end const): Deleted. (WTF::BitVector::bitsInPointer): Deleted. (WTF::BitVector::maxInlineBits): Deleted. (WTF::BitVector::byteCount): Deleted. (WTF::BitVector::makeInlineBits): Deleted. (WTF::BitVector::cleanseInlineBits): Deleted. (WTF::BitVector::bitCount): Deleted. (WTF::BitVector::findBitFast const): Deleted. (WTF::BitVector::findBitSimple const): Deleted. (WTF::BitVector::OutOfLineBits::numBits const): Deleted. (WTF::BitVector::OutOfLineBits::numWords const): Deleted. (WTF::BitVector::OutOfLineBits::bits): Deleted. (WTF::BitVector::OutOfLineBits::bits const): Deleted. (WTF::BitVector::OutOfLineBits::OutOfLineBits): Deleted. (WTF::BitVector::isInline const): Deleted. (WTF::BitVector::outOfLineBits const): Deleted. (WTF::BitVector::outOfLineBits): Deleted. (WTF::BitVector::bits): Deleted. (WTF::BitVector::bits const): Deleted. * wtf/Bitmap.h: (WTF::Bitmap::size): Deleted. (WTF::Bitmap::iterator::iterator): Deleted. (WTF::Bitmap::iterator::operator* const): Deleted. (WTF::Bitmap::iterator::operator++): Deleted. (WTF::Bitmap::iterator::operator== const): Deleted. (WTF::Bitmap::iterator::operator!= const): Deleted. (WTF::Bitmap::begin const): Deleted. (WTF::Bitmap::end const): Deleted. * wtf/Box.h: * wtf/BumpPointerAllocator.h: * wtf/CPUTime.h: * wtf/CheckedBoolean.h: * wtf/CommaPrinter.h: (WTF::CommaPrinter::CommaPrinter): Deleted. (WTF::CommaPrinter::dump const): Deleted. (WTF::CommaPrinter::didPrint const): Deleted. * wtf/CompactPointerTuple.h: (WTF::CompactPointerTuple::encodeType): Deleted. (WTF::CompactPointerTuple::decodeType): Deleted. (WTF::CompactPointerTuple::CompactPointerTuple): Deleted. (WTF::CompactPointerTuple::pointer const): Deleted. (WTF::CompactPointerTuple::setPointer): Deleted. (WTF::CompactPointerTuple::type const): Deleted. (WTF::CompactPointerTuple::setType): Deleted. * wtf/CompilationThread.h: (WTF::CompilationScope::CompilationScope): Deleted. (WTF::CompilationScope::~CompilationScope): Deleted. (WTF::CompilationScope::leaveEarly): Deleted. * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): (WTF::Detail::CallableWrapper<CompletionHandler<Out): (WTF::CompletionHandlerCallingScope::CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::~CompletionHandlerCallingScope): Deleted. (WTF::CompletionHandlerCallingScope::CompletionHandler<void): Deleted. * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::~ConcurrentBuffer): Deleted. (WTF::ConcurrentBuffer::growExact): Deleted. (WTF::ConcurrentBuffer::grow): Deleted. (WTF::ConcurrentBuffer::array const): Deleted. (WTF::ConcurrentBuffer::operator[]): Deleted. (WTF::ConcurrentBuffer::operator[] const): Deleted. (WTF::ConcurrentBuffer::createArray): Deleted. * wtf/ConcurrentPtrHashSet.h: (WTF::ConcurrentPtrHashSet::contains): Deleted. (WTF::ConcurrentPtrHashSet::add): Deleted. (WTF::ConcurrentPtrHashSet::size const): Deleted. (WTF::ConcurrentPtrHashSet::Table::maxLoad const): Deleted. (WTF::ConcurrentPtrHashSet::hash): Deleted. (WTF::ConcurrentPtrHashSet::cast): Deleted. (WTF::ConcurrentPtrHashSet::containsImpl const): Deleted. (WTF::ConcurrentPtrHashSet::addImpl): Deleted. * wtf/ConcurrentVector.h: (WTF::ConcurrentVector::~ConcurrentVector): Deleted. (WTF::ConcurrentVector::size const): Deleted. (WTF::ConcurrentVector::isEmpty const): Deleted. (WTF::ConcurrentVector::at): Deleted. (WTF::ConcurrentVector::at const): Deleted. (WTF::ConcurrentVector::operator[]): Deleted. (WTF::ConcurrentVector::operator[] const): Deleted. (WTF::ConcurrentVector::first): Deleted. (WTF::ConcurrentVector::first const): Deleted. (WTF::ConcurrentVector::last): Deleted. (WTF::ConcurrentVector::last const): Deleted. (WTF::ConcurrentVector::takeLast): Deleted. (WTF::ConcurrentVector::append): Deleted. (WTF::ConcurrentVector::alloc): Deleted. (WTF::ConcurrentVector::removeLast): Deleted. (WTF::ConcurrentVector::grow): Deleted. (WTF::ConcurrentVector::begin): Deleted. (WTF::ConcurrentVector::end): Deleted. (WTF::ConcurrentVector::segmentExistsFor): Deleted. (WTF::ConcurrentVector::segmentFor): Deleted. (WTF::ConcurrentVector::subscriptFor): Deleted. (WTF::ConcurrentVector::ensureSegmentsFor): Deleted. (WTF::ConcurrentVector::ensureSegment): Deleted. (WTF::ConcurrentVector::allocateSegment): Deleted. * wtf/Condition.h: (WTF::Condition::waitUntil): Deleted. (WTF::Condition::waitFor): Deleted. (WTF::Condition::wait): Deleted. (WTF::Condition::notifyOne): Deleted. (WTF::Condition::notifyAll): Deleted. * wtf/CountingLock.h: (WTF::CountingLock::LockHooks::lockHook): Deleted. (WTF::CountingLock::LockHooks::unlockHook): Deleted. (WTF::CountingLock::LockHooks::parkHook): Deleted. (WTF::CountingLock::LockHooks::handoffHook): Deleted. (WTF::CountingLock::tryLock): Deleted. (WTF::CountingLock::lock): Deleted. (WTF::CountingLock::unlock): Deleted. (WTF::CountingLock::isHeld const): Deleted. (WTF::CountingLock::isLocked const): Deleted. (WTF::CountingLock::Count::operator bool const): Deleted. (WTF::CountingLock::Count::operator== const): Deleted. (WTF::CountingLock::Count::operator!= const): Deleted. (WTF::CountingLock::tryOptimisticRead): Deleted. (WTF::CountingLock::validate): Deleted. (WTF::CountingLock::doOptimizedRead): Deleted. (WTF::CountingLock::tryOptimisticFencelessRead): Deleted. (WTF::CountingLock::fencelessValidate): Deleted. (WTF::CountingLock::doOptimizedFencelessRead): Deleted. (WTF::CountingLock::getCount): Deleted. * wtf/CrossThreadQueue.h: * wtf/CrossThreadTask.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/DataMutex.h: * wtf/DateMath.h: * wtf/Deque.h: (WTF::Deque::size const): Deleted. (WTF::Deque::isEmpty const): Deleted. (WTF::Deque::begin): Deleted. (WTF::Deque::end): Deleted. (WTF::Deque::begin const): Deleted. (WTF::Deque::end const): Deleted. (WTF::Deque::rbegin): Deleted. (WTF::Deque::rend): Deleted. (WTF::Deque::rbegin const): Deleted. (WTF::Deque::rend const): Deleted. (WTF::Deque::first): Deleted. (WTF::Deque::first const): Deleted. (WTF::Deque::last): Deleted. (WTF::Deque::last const): Deleted. (WTF::Deque::append): Deleted. * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/Expected.h: * wtf/FastBitVector.h: * wtf/FileMetadata.h: * wtf/FileSystem.h: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.h: (WTF::GregorianDateTime::GregorianDateTime): Deleted. (WTF::GregorianDateTime::year const): Deleted. (WTF::GregorianDateTime::month const): Deleted. (WTF::GregorianDateTime::yearDay const): Deleted. (WTF::GregorianDateTime::monthDay const): Deleted. (WTF::GregorianDateTime::weekDay const): Deleted. (WTF::GregorianDateTime::hour const): Deleted. (WTF::GregorianDateTime::minute const): Deleted. (WTF::GregorianDateTime::second const): Deleted. (WTF::GregorianDateTime::utcOffset const): Deleted. (WTF::GregorianDateTime::isDST const): Deleted. (WTF::GregorianDateTime::setYear): Deleted. (WTF::GregorianDateTime::setMonth): Deleted. (WTF::GregorianDateTime::setYearDay): Deleted. (WTF::GregorianDateTime::setMonthDay): Deleted. (WTF::GregorianDateTime::setWeekDay): Deleted. (WTF::GregorianDateTime::setHour): Deleted. (WTF::GregorianDateTime::setMinute): Deleted. (WTF::GregorianDateTime::setSecond): Deleted. (WTF::GregorianDateTime::setUtcOffset): Deleted. (WTF::GregorianDateTime::setIsDST): Deleted. (WTF::GregorianDateTime::operator tm const): Deleted. (WTF::GregorianDateTime::copyFrom): Deleted. * wtf/HashTable.h: * wtf/Hasher.h: * wtf/HexNumber.h: * wtf/Indenter.h: * wtf/IndexMap.h: * wtf/IndexSet.h: * wtf/IndexSparseSet.h: * wtf/IndexedContainerIterator.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/KeyValuePair.h: * wtf/ListHashSet.h: (WTF::ListHashSet::begin): Deleted. (WTF::ListHashSet::end): Deleted. (WTF::ListHashSet::begin const): Deleted. (WTF::ListHashSet::end const): Deleted. (WTF::ListHashSet::random): Deleted. (WTF::ListHashSet::random const): Deleted. (WTF::ListHashSet::rbegin): Deleted. (WTF::ListHashSet::rend): Deleted. (WTF::ListHashSet::rbegin const): Deleted. (WTF::ListHashSet::rend const): Deleted. * wtf/Liveness.h: * wtf/LocklessBag.h: (WTF::LocklessBag::LocklessBag): Deleted. (WTF::LocklessBag::add): Deleted. (WTF::LocklessBag::iterate): Deleted. (WTF::LocklessBag::consumeAll): Deleted. (WTF::LocklessBag::consumeAllWithNode): Deleted. (WTF::LocklessBag::~LocklessBag): Deleted. * wtf/LoggingHashID.h: * wtf/MD5.h: * wtf/MachSendRight.h: * wtf/MainThreadData.h: * wtf/Markable.h: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.h: * wtf/MessageQueue.h: (WTF::MessageQueue::MessageQueue): Deleted. * wtf/MetaAllocator.h: * wtf/MonotonicTime.h: (WTF::MonotonicTime::MonotonicTime): Deleted. (WTF::MonotonicTime::fromRawSeconds): Deleted. (WTF::MonotonicTime::infinity): Deleted. (WTF::MonotonicTime::nan): Deleted. (WTF::MonotonicTime::secondsSinceEpoch const): Deleted. (WTF::MonotonicTime::approximateMonotonicTime const): Deleted. (WTF::MonotonicTime::operator bool const): Deleted. (WTF::MonotonicTime::operator+ const): Deleted. (WTF::MonotonicTime::operator- const): Deleted. (WTF::MonotonicTime::operator% const): Deleted. (WTF::MonotonicTime::operator+=): Deleted. (WTF::MonotonicTime::operator-=): Deleted. (WTF::MonotonicTime::operator== const): Deleted. (WTF::MonotonicTime::operator!= const): Deleted. (WTF::MonotonicTime::operator< const): Deleted. (WTF::MonotonicTime::operator> const): Deleted. (WTF::MonotonicTime::operator<= const): Deleted. (WTF::MonotonicTime::operator>= const): Deleted. (WTF::MonotonicTime::isolatedCopy const): Deleted. (WTF::MonotonicTime::encode const): Deleted. (WTF::MonotonicTime::decode): Deleted. * wtf/NaturalLoops.h: * wtf/NoLock.h: * wtf/OSAllocator.h: * wtf/OptionSet.h: * wtf/Optional.h: * wtf/OrderMaker.h: * wtf/Packed.h: (WTF::alignof): * wtf/PackedIntVector.h: (WTF::PackedIntVector::PackedIntVector): Deleted. (WTF::PackedIntVector::operator=): Deleted. (WTF::PackedIntVector::size const): Deleted. (WTF::PackedIntVector::ensureSize): Deleted. (WTF::PackedIntVector::resize): Deleted. (WTF::PackedIntVector::clearAll): Deleted. (WTF::PackedIntVector::get const): Deleted. (WTF::PackedIntVector::set): Deleted. (WTF::PackedIntVector::mask): Deleted. * wtf/PageBlock.h: * wtf/ParallelJobsOpenMP.h: * wtf/ParkingLot.h: * wtf/PriorityQueue.h: (WTF::PriorityQueue::size const): Deleted. (WTF::PriorityQueue::isEmpty const): Deleted. (WTF::PriorityQueue::enqueue): Deleted. (WTF::PriorityQueue::peek const): Deleted. (WTF::PriorityQueue::dequeue): Deleted. (WTF::PriorityQueue::decreaseKey): Deleted. (WTF::PriorityQueue::increaseKey): Deleted. (WTF::PriorityQueue::begin const): Deleted. (WTF::PriorityQueue::end const): Deleted. (WTF::PriorityQueue::isValidHeap const): Deleted. (WTF::PriorityQueue::parentOf): Deleted. (WTF::PriorityQueue::leftChildOf): Deleted. (WTF::PriorityQueue::rightChildOf): Deleted. (WTF::PriorityQueue::siftUp): Deleted. (WTF::PriorityQueue::siftDown): Deleted. * wtf/RandomDevice.h: * wtf/Range.h: * wtf/RangeSet.h: (WTF::RangeSet::RangeSet): Deleted. (WTF::RangeSet::~RangeSet): Deleted. (WTF::RangeSet::add): Deleted. (WTF::RangeSet::contains const): Deleted. (WTF::RangeSet::overlaps const): Deleted. (WTF::RangeSet::clear): Deleted. (WTF::RangeSet::dump const): Deleted. (WTF::RangeSet::dumpRaw const): Deleted. (WTF::RangeSet::begin const): Deleted. (WTF::RangeSet::end const): Deleted. (WTF::RangeSet::addAll): Deleted. (WTF::RangeSet::compact): Deleted. (WTF::RangeSet::overlapsNonEmpty): Deleted. (WTF::RangeSet::subsumesNonEmpty): Deleted. (WTF::RangeSet::findRange const): Deleted. * wtf/RecursableLambda.h: * wtf/RedBlackTree.h: (WTF::RedBlackTree::Node::successor const): Deleted. (WTF::RedBlackTree::Node::predecessor const): Deleted. (WTF::RedBlackTree::Node::successor): Deleted. (WTF::RedBlackTree::Node::predecessor): Deleted. (WTF::RedBlackTree::Node::reset): Deleted. (WTF::RedBlackTree::Node::parent const): Deleted. (WTF::RedBlackTree::Node::setParent): Deleted. (WTF::RedBlackTree::Node::left const): Deleted. (WTF::RedBlackTree::Node::setLeft): Deleted. (WTF::RedBlackTree::Node::right const): Deleted. (WTF::RedBlackTree::Node::setRight): Deleted. (WTF::RedBlackTree::Node::color const): Deleted. (WTF::RedBlackTree::Node::setColor): Deleted. (WTF::RedBlackTree::RedBlackTree): Deleted. (WTF::RedBlackTree::insert): Deleted. (WTF::RedBlackTree::remove): Deleted. (WTF::RedBlackTree::findExact const): Deleted. (WTF::RedBlackTree::findLeastGreaterThanOrEqual const): Deleted. (WTF::RedBlackTree::findGreatestLessThanOrEqual const): Deleted. (WTF::RedBlackTree::first const): Deleted. (WTF::RedBlackTree::last const): Deleted. (WTF::RedBlackTree::size): Deleted. (WTF::RedBlackTree::isEmpty): Deleted. (WTF::RedBlackTree::treeMinimum): Deleted. (WTF::RedBlackTree::treeMaximum): Deleted. (WTF::RedBlackTree::treeInsert): Deleted. (WTF::RedBlackTree::leftRotate): Deleted. (WTF::RedBlackTree::rightRotate): Deleted. (WTF::RedBlackTree::removeFixup): Deleted. * wtf/ResourceUsage.h: * wtf/RunLoop.cpp: * wtf/RunLoopTimer.h: * wtf/SHA1.h: * wtf/Seconds.h: (WTF::Seconds::Seconds): Deleted. (WTF::Seconds::value const): Deleted. (WTF::Seconds::minutes const): Deleted. (WTF::Seconds::seconds const): Deleted. (WTF::Seconds::milliseconds const): Deleted. (WTF::Seconds::microseconds const): Deleted. (WTF::Seconds::nanoseconds const): Deleted. (WTF::Seconds::minutesAs const): Deleted. (WTF::Seconds::secondsAs const): Deleted. (WTF::Seconds::millisecondsAs const): Deleted. (WTF::Seconds::microsecondsAs const): Deleted. (WTF::Seconds::nanosecondsAs const): Deleted. (WTF::Seconds::fromMinutes): Deleted. (WTF::Seconds::fromHours): Deleted. (WTF::Seconds::fromMilliseconds): Deleted. (WTF::Seconds::fromMicroseconds): Deleted. (WTF::Seconds::fromNanoseconds): Deleted. (WTF::Seconds::infinity): Deleted. (WTF::Seconds::nan): Deleted. (WTF::Seconds::operator bool const): Deleted. (WTF::Seconds::operator+ const): Deleted. (WTF::Seconds::operator- const): Deleted. (WTF::Seconds::operator* const): Deleted. (WTF::Seconds::operator/ const): Deleted. (WTF::Seconds::operator% const): Deleted. (WTF::Seconds::operator+=): Deleted. (WTF::Seconds::operator-=): Deleted. (WTF::Seconds::operator*=): Deleted. (WTF::Seconds::operator/=): Deleted. (WTF::Seconds::operator%=): Deleted. (WTF::Seconds::operator== const): Deleted. (WTF::Seconds::operator!= const): Deleted. (WTF::Seconds::operator< const): Deleted. (WTF::Seconds::operator> const): Deleted. (WTF::Seconds::operator<= const): Deleted. (WTF::Seconds::operator>= const): Deleted. (WTF::Seconds::isolatedCopy const): Deleted. (WTF::Seconds::encode const): Deleted. (WTF::Seconds::decode): Deleted. * wtf/SegmentedVector.h: (WTF::SegmentedVector::~SegmentedVector): Deleted. (WTF::SegmentedVector::size const): Deleted. (WTF::SegmentedVector::isEmpty const): Deleted. (WTF::SegmentedVector::at): Deleted. (WTF::SegmentedVector::at const): Deleted. (WTF::SegmentedVector::operator[]): Deleted. (WTF::SegmentedVector::operator[] const): Deleted. (WTF::SegmentedVector::first): Deleted. (WTF::SegmentedVector::first const): Deleted. (WTF::SegmentedVector::last): Deleted. (WTF::SegmentedVector::last const): Deleted. (WTF::SegmentedVector::takeLast): Deleted. (WTF::SegmentedVector::append): Deleted. (WTF::SegmentedVector::alloc): Deleted. (WTF::SegmentedVector::removeLast): Deleted. (WTF::SegmentedVector::grow): Deleted. (WTF::SegmentedVector::clear): Deleted. (WTF::SegmentedVector::begin): Deleted. (WTF::SegmentedVector::end): Deleted. (WTF::SegmentedVector::shrinkToFit): Deleted. (WTF::SegmentedVector::deleteAllSegments): Deleted. (WTF::SegmentedVector::segmentExistsFor): Deleted. (WTF::SegmentedVector::segmentFor): Deleted. (WTF::SegmentedVector::subscriptFor): Deleted. (WTF::SegmentedVector::ensureSegmentsFor): Deleted. (WTF::SegmentedVector::ensureSegment): Deleted. (WTF::SegmentedVector::allocateSegment): Deleted. * wtf/SetForScope.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SmallPtrSet.h: * wtf/SpanningTree.h: * wtf/Spectrum.h: * wtf/StackBounds.h: * wtf/StackShot.h: * wtf/StackShotProfiler.h: * wtf/StackStats.h: * wtf/StackTrace.h: * wtf/StreamBuffer.h: * wtf/SynchronizedFixedQueue.h: (WTF::SynchronizedFixedQueue::create): Deleted. (WTF::SynchronizedFixedQueue::open): Deleted. (WTF::SynchronizedFixedQueue::close): Deleted. (WTF::SynchronizedFixedQueue::isOpen): Deleted. (WTF::SynchronizedFixedQueue::enqueue): Deleted. (WTF::SynchronizedFixedQueue::dequeue): Deleted. (WTF::SynchronizedFixedQueue::SynchronizedFixedQueue): Deleted. * wtf/SystemTracing.h: * wtf/ThreadGroup.h: (WTF::ThreadGroup::create): Deleted. (WTF::ThreadGroup::threads const): Deleted. (WTF::ThreadGroup::getLock): Deleted. (WTF::ThreadGroup::weakFromThis): Deleted. * wtf/ThreadSpecific.h: * wtf/ThreadingPrimitives.h: (WTF::Mutex::impl): Deleted. * wtf/TimeWithDynamicClockType.h: (WTF::TimeWithDynamicClockType::TimeWithDynamicClockType): Deleted. (WTF::TimeWithDynamicClockType::fromRawSeconds): Deleted. (WTF::TimeWithDynamicClockType::secondsSinceEpoch const): Deleted. (WTF::TimeWithDynamicClockType::clockType const): Deleted. (WTF::TimeWithDynamicClockType::withSameClockAndRawSeconds const): Deleted. (WTF::TimeWithDynamicClockType::operator bool const): Deleted. (WTF::TimeWithDynamicClockType::operator+ const): Deleted. (WTF::TimeWithDynamicClockType::operator- const): Deleted. (WTF::TimeWithDynamicClockType::operator+=): Deleted. (WTF::TimeWithDynamicClockType::operator-=): Deleted. (WTF::TimeWithDynamicClockType::operator== const): Deleted. (WTF::TimeWithDynamicClockType::operator!= const): Deleted. * wtf/TimingScope.h: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/URLParser.cpp: * wtf/URLParser.h: * wtf/Unexpected.h: * wtf/Variant.h: * wtf/WTFSemaphore.h: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::signal): Deleted. (WTF::Semaphore::waitUntil): Deleted. (WTF::Semaphore::waitFor): Deleted. (WTF::Semaphore::wait): Deleted. * wtf/WallTime.h: (WTF::WallTime::WallTime): Deleted. (WTF::WallTime::fromRawSeconds): Deleted. (WTF::WallTime::infinity): Deleted. (WTF::WallTime::nan): Deleted. (WTF::WallTime::secondsSinceEpoch const): Deleted. (WTF::WallTime::approximateWallTime const): Deleted. (WTF::WallTime::operator bool const): Deleted. (WTF::WallTime::operator+ const): Deleted. (WTF::WallTime::operator- const): Deleted. (WTF::WallTime::operator+=): Deleted. (WTF::WallTime::operator-=): Deleted. (WTF::WallTime::operator== const): Deleted. (WTF::WallTime::operator!= const): Deleted. (WTF::WallTime::operator< const): Deleted. (WTF::WallTime::operator> const): Deleted. (WTF::WallTime::operator<= const): Deleted. (WTF::WallTime::operator>= const): Deleted. (WTF::WallTime::isolatedCopy const): Deleted. * wtf/WeakHashSet.h: (WTF::WeakHashSet::WeakHashSetConstIterator::WeakHashSetConstIterator): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::get const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator* const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator-> const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator++): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::skipEmptyBuckets): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator== const): Deleted. (WTF::WeakHashSet::WeakHashSetConstIterator::operator!= const): Deleted. (WTF::WeakHashSet::WeakHashSet): Deleted. (WTF::WeakHashSet::begin const): Deleted. (WTF::WeakHashSet::end const): Deleted. (WTF::WeakHashSet::add): Deleted. (WTF::WeakHashSet::remove): Deleted. (WTF::WeakHashSet::contains const): Deleted. (WTF::WeakHashSet::capacity const): Deleted. (WTF::WeakHashSet::computesEmpty const): Deleted. (WTF::WeakHashSet::hasNullReferences const): Deleted. (WTF::WeakHashSet::computeSize const): Deleted. (WTF::WeakHashSet::checkConsistency const): Deleted. * wtf/WeakRandom.h: (WTF::WeakRandom::WeakRandom): Deleted. (WTF::WeakRandom::setSeed): Deleted. (WTF::WeakRandom::seed const): Deleted. (WTF::WeakRandom::get): Deleted. (WTF::WeakRandom::getUint32): Deleted. (WTF::WeakRandom::lowOffset): Deleted. (WTF::WeakRandom::highOffset): Deleted. (WTF::WeakRandom::nextState): Deleted. (WTF::WeakRandom::generate): Deleted. (WTF::WeakRandom::advance): Deleted. * wtf/WordLock.h: (WTF::WordLock::lock): Deleted. (WTF::WordLock::unlock): Deleted. (WTF::WordLock::isHeld const): Deleted. (WTF::WordLock::isLocked const): Deleted. (WTF::WordLock::isFullyReset const): Deleted. * wtf/generic/MainThreadGeneric.cpp: * wtf/glib/GMutexLocker.h: * wtf/linux/CurrentProcessMemoryStatus.h: * wtf/posix/ThreadingPOSIX.cpp: (WTF::Semaphore::Semaphore): Deleted. (WTF::Semaphore::~Semaphore): Deleted. (WTF::Semaphore::wait): Deleted. (WTF::Semaphore::post): Deleted. * wtf/text/ASCIILiteral.h: (WTF::ASCIILiteral::operator const char* const): Deleted. (WTF::ASCIILiteral::fromLiteralUnsafe): Deleted. (WTF::ASCIILiteral::null): Deleted. (WTF::ASCIILiteral::characters const): Deleted. (WTF::ASCIILiteral::ASCIILiteral): Deleted. * wtf/text/AtomString.h: (WTF::AtomString::operator=): Deleted. (WTF::AtomString::isHashTableDeletedValue const): Deleted. (WTF::AtomString::existingHash const): Deleted. (WTF::AtomString::operator const String& const): Deleted. (WTF::AtomString::string const): Deleted. (WTF::AtomString::impl const): Deleted. (WTF::AtomString::is8Bit const): Deleted. (WTF::AtomString::characters8 const): Deleted. (WTF::AtomString::characters16 const): Deleted. (WTF::AtomString::length const): Deleted. (WTF::AtomString::operator[] const): Deleted. (WTF::AtomString::contains const): Deleted. (WTF::AtomString::containsIgnoringASCIICase const): Deleted. (WTF::AtomString::find const): Deleted. (WTF::AtomString::findIgnoringASCIICase const): Deleted. (WTF::AtomString::startsWith const): Deleted. (WTF::AtomString::startsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::endsWith const): Deleted. (WTF::AtomString::endsWithIgnoringASCIICase const): Deleted. (WTF::AtomString::toInt const): Deleted. (WTF::AtomString::toDouble const): Deleted. (WTF::AtomString::toFloat const): Deleted. (WTF::AtomString::percentage const): Deleted. (WTF::AtomString::isNull const): Deleted. (WTF::AtomString::isEmpty const): Deleted. (WTF::AtomString::operator NSString * const): Deleted. * wtf/text/AtomStringImpl.h: (WTF::AtomStringImpl::lookUp): Deleted. (WTF::AtomStringImpl::add): Deleted. (WTF::AtomStringImpl::addWithStringTableProvider): Deleted. * wtf/text/CString.h: (WTF::CStringBuffer::data): Deleted. (WTF::CStringBuffer::length const): Deleted. (WTF::CStringBuffer::CStringBuffer): Deleted. (WTF::CStringBuffer::mutableData): Deleted. (WTF::CString::CString): Deleted. (WTF::CString::data const): Deleted. (WTF::CString::length const): Deleted. (WTF::CString::isNull const): Deleted. (WTF::CString::buffer const): Deleted. (WTF::CString::isHashTableDeletedValue const): Deleted. * wtf/text/ExternalStringImpl.h: (WTF::ExternalStringImpl::freeExternalBuffer): Deleted. * wtf/text/LineBreakIteratorPoolICU.h: * wtf/text/NullTextBreakIterator.h: * wtf/text/OrdinalNumber.h: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.h: * wtf/text/StringConcatenateNumbers.h: * wtf/text/StringHasher.h: * wtf/text/StringImpl.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: (WTF::StringView::left const): Deleted. (WTF::StringView::right const): Deleted. (WTF::StringView::underlyingStringIsValid const): Deleted. (WTF::StringView::setUnderlyingString): Deleted. * wtf/text/SymbolImpl.h: (WTF::SymbolImpl::StaticSymbolImpl::StaticSymbolImpl): Deleted. (WTF::SymbolImpl::StaticSymbolImpl::operator SymbolImpl&): Deleted. (WTF::PrivateSymbolImpl::PrivateSymbolImpl): Deleted. (WTF::RegisteredSymbolImpl::symbolRegistry const): Deleted. (WTF::RegisteredSymbolImpl::clearSymbolRegistry): Deleted. (WTF::RegisteredSymbolImpl::RegisteredSymbolImpl): Deleted. * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.h: * wtf/text/WTFString.h: (WTF::String::swap): Deleted. (WTF::String::adopt): Deleted. (WTF::String::isNull const): Deleted. (WTF::String::isEmpty const): Deleted. (WTF::String::impl const): Deleted. (WTF::String::releaseImpl): Deleted. (WTF::String::length const): Deleted. (WTF::String::characters8 const): Deleted. (WTF::String::characters16 const): Deleted. (WTF::String::is8Bit const): Deleted. (WTF::String::sizeInBytes const): Deleted. (WTF::String::operator[] const): Deleted. (WTF::String::find const): Deleted. (WTF::String::findIgnoringASCIICase const): Deleted. (WTF::String::reverseFind const): Deleted. (WTF::String::contains const): Deleted. (WTF::String::containsIgnoringASCIICase const): Deleted. (WTF::String::startsWith const): Deleted. (WTF::String::startsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixStartingAt const): Deleted. (WTF::String::endsWith const): Deleted. (WTF::String::endsWithIgnoringASCIICase const): Deleted. (WTF::String::hasInfixEndingAt const): Deleted. (WTF::String::append): Deleted. (WTF::String::left const): Deleted. (WTF::String::right const): Deleted. (WTF::String::createUninitialized): Deleted. (WTF::String::fromUTF8WithLatin1Fallback): Deleted. (WTF::String::isAllASCII const): Deleted. (WTF::String::isAllLatin1 const): Deleted. (WTF::String::isSpecialCharacter const): Deleted. (WTF::String::isHashTableDeletedValue const): Deleted. (WTF::String::hash const): Deleted. (WTF::String::existingHash const): Deleted. * wtf/text/cf/TextBreakIteratorCF.h: * wtf/text/icu/TextBreakIteratorICU.h: * wtf/text/icu/UTextProviderLatin1.h: * wtf/threads/BinarySemaphore.h: (WTF::BinarySemaphore::waitFor): Deleted. (WTF::BinarySemaphore::wait): Deleted. * wtf/unicode/Collator.h: * wtf/win/GDIObject.h: * wtf/win/PathWalker.h: * wtf/win/Win32Handle.h: Canonical link: https://commits.webkit.org/214396@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248546 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-08-12 20:57:15 +00:00
WTF_MAKE_FAST_ALLOCATED;
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
public:
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
IndexMap() = default;
IndexMap(IndexMap&&) = default;
IndexMap& operator=(IndexMap&&) = default;
IndexMap(const IndexMap&) = default;
IndexMap& operator=(const IndexMap&) = default;
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
template<typename... Args>
explicit IndexMap(size_t size, Args&&... args)
{
m_vector.fill(Value(std::forward<Args>(args)...), size);
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
}
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
template<typename... Args>
void resize(size_t size, Args&&... args)
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
{
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
m_vector.fill(Value(std::forward<Args>(args)...), size);
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
}
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
template<typename... Args>
void clear(Args&&... args)
Get rid of anonymous stack slots https://bugs.webkit.org/show_bug.cgi?id=151128 Reviewed by Mark Lam. Source/JavaScriptCore: When I first designed stack slots, the idea was that an "anonymous" stack slot was one that behaved exactly like a C variable: if it never escaped, it would not need to get stack space for the entire lifetime of the function - it could get any slab of stack so long as it didn't interfere with other stack slots that would be live at the same time. The reason I called them "anonymous" is that external code could not get its address. This felt like it gave the stack slot anonymity. But it was never a good name for this concept. Then I had the register allocator lower temporaries to anonymous stack slots when it spilled them. Spilling became the sole client of anonymous stack slots. Then I realized that there was an aspect of how spill slots work that make them want slightly different semantics than a normal C variable. A C variable is a proper memory location - you could do a store to only some bytes in the variable, and it's reasonable to expect that this will not destroy the other bytes in the variable. But that means that to compute their liveness, you have to do something like a per-byte liveness. That's overkill for spill slots. You want any store to the spill slot to kill the whole slot even if it writes to just part of the slot. This matches how temporaries work. So rather than implement per-byte liveness, I decided to change the semantics of anonymous stack slots to make them work like how I wanted spill slots to work. This was quite dirty, and put B3 in the awkward situation that B3's anonymous stack slots behaved like spill slots. But it was OK since nobody used anonymous stack slots in B3. Then I added tail duplication, which required having a mechanism for introducing non-SSA variables in B3. I decided to use anonymous stack slots for this purpose. All of a sudden this all felt like it made sense: anonymous stack slots were just like variables! Hooray for the amazing foresight of anonymous stack slots! But then I realized that this was all very bad. We want B3 to be able to optimize Store and Load operations by reasoning about how they affect bytes in memory. For example, if you do a Load of a 64-bit value, and then you modify just the low 32 bits of that value, and then you do a 64-bit store back to the same location, then it would be better to transform this into 32-bit operations. We don't do this optimization yet, but it's the kind of thing that we want B3 to be able to do. To do it, we need Store to mean that it only affects N bytes starting at the pointer, where N is the size of the thing being stored. But that's not what Store means for anonymous stack slots. For anonymous slots, storing to any byte in the slot clobbers all bytes in the slot. We were never clear if you need to store directly to an anonymous slot to get this behavior, or if any pointer that points to an anoymous slot must exhibit this behavior when stored to. Neither kinds of semantics make sense to me. This change fixes the problem by eradicating anonymous stack slots. In B3, they are replaced with Variables. In Air, they are replaced with a different stack slot kind, called Spill. There is no such thing as stack slot kinds in B3 anymore, all B3 stack slots are locked. In Air, there is still the concept of stack slot kind - Locked or Spill. B3 Variables are awesome. They are exactly what they seem to be. They have a type. They are declared at the top level in the Procedure. You can access them with new opcodes, Get and Set. This greatly simplifies demoting SSA values to variables and promoting them back to SSA. I even made the instruction selector do the right things for variables, which means that introducing variables won't hurt instruction selection (there will be extra moves, but IRC will kill them). It's great to have non-SSA variables as an explicit concept in IR because it means that you don't have to do any magic to use them - they Just Work. Air spill slots behave almost like anonymous stack slots, with one exception: you cannot escape them. We validate this by making it illegal to UseAddr on a spill slot. This removes the need to answer awkward questions like: does a 32-bit Def on a pointer that may point to a 64-bit spill slot do anything to the 32 bits above the pointer? Does it write zero to it? Does it write zero to it just when the pointer actually points to a spill slot or always? These are silly questions, and we don't have to answer them because the only way to refer to a spill slot is directly. No escaping means no aliasing. This doesn't affect performance. It just makes the compiler more fun to work with by removing some cognitive dissonance. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3ArgumentRegValue.h: * b3/B3CCallValue.h: * b3/B3CheckValue.cpp: (JSC::B3::CheckValue::cloneImpl): (JSC::B3::CheckValue::CheckValue): * b3/B3CheckValue.h: * b3/B3Const32Value.h: * b3/B3Const64Value.h: * b3/B3ConstDoubleValue.h: * b3/B3ConstFloatValue.h: * b3/B3ConstPtrValue.h: (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: (JSC::B3::ControlValue::convertToJump): (JSC::B3::ControlValue::convertToOops): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: * b3/B3Effects.cpp: (JSC::B3::Effects::interferes): (JSC::B3::Effects::dump): * b3/B3Effects.h: (JSC::B3::Effects::mustExecute): * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::clear): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::size): (JSC::B3::IndexSet::isEmpty): * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::lower): * b3/B3MemoryValue.h: * b3/B3Opcode.cpp: (WTF::printInternal): * b3/B3Opcode.h: * b3/B3PatchpointValue.cpp: (JSC::B3::PatchpointValue::cloneImpl): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PatchpointValue.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::addStackSlot): (JSC::B3::Procedure::addVariable): (JSC::B3::Procedure::clone): (JSC::B3::Procedure::addIntConstant): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteStackSlot): (JSC::B3::Procedure::deleteVariable): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::calleeSaveRegisters): (JSC::B3::Procedure::addValueImpl): (JSC::B3::Procedure::setBlockOrderImpl): (JSC::B3::Procedure::addAnonymousStackSlot): Deleted. (JSC::B3::Procedure::addStackSlotIndex): Deleted. (JSC::B3::Procedure::addValueIndex): Deleted. * b3/B3Procedure.h: (JSC::B3::Procedure::setBlockOrder): (JSC::B3::Procedure::stackSlots): (JSC::B3::Procedure::variables): (JSC::B3::Procedure::values): (JSC::B3::Procedure::StackSlotsCollection::StackSlotsCollection): Deleted. (JSC::B3::Procedure::StackSlotsCollection::size): Deleted. (JSC::B3::Procedure::StackSlotsCollection::at): Deleted. (JSC::B3::Procedure::StackSlotsCollection::operator[]): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::iterator): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator*): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator++): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator==): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator!=): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::findNext): Deleted. (JSC::B3::Procedure::StackSlotsCollection::begin): Deleted. (JSC::B3::Procedure::StackSlotsCollection::end): Deleted. (JSC::B3::Procedure::ValuesCollection::ValuesCollection): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::iterator): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator*): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator++): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator==): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::findNext): Deleted. (JSC::B3::Procedure::ValuesCollection::begin): Deleted. (JSC::B3::Procedure::ValuesCollection::end): Deleted. (JSC::B3::Procedure::ValuesCollection::size): Deleted. (JSC::B3::Procedure::ValuesCollection::at): Deleted. (JSC::B3::Procedure::ValuesCollection::operator[]): Deleted. * b3/B3ProcedureInlines.h: (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: * b3/B3SlotBaseValue.h: * b3/B3SparseCollection.h: Added. (JSC::B3::SparseCollection::SparseCollection): (JSC::B3::SparseCollection::add): (JSC::B3::SparseCollection::addNew): (JSC::B3::SparseCollection::remove): (JSC::B3::SparseCollection::size): (JSC::B3::SparseCollection::isEmpty): (JSC::B3::SparseCollection::at): (JSC::B3::SparseCollection::operator[]): (JSC::B3::SparseCollection::iterator::iterator): (JSC::B3::SparseCollection::iterator::operator*): (JSC::B3::SparseCollection::iterator::operator++): (JSC::B3::SparseCollection::iterator::operator==): (JSC::B3::SparseCollection::iterator::operator!=): (JSC::B3::SparseCollection::iterator::findNext): (JSC::B3::SparseCollection::begin): (JSC::B3::SparseCollection::end): * b3/B3StackSlot.cpp: (JSC::B3::StackSlot::deepDump): (JSC::B3::StackSlot::StackSlot): * b3/B3StackSlot.h: (JSC::B3::StackSlot::byteSize): (JSC::B3::StackSlot::index): (JSC::B3::StackSlot::setOffsetFromFP): (JSC::B3::StackSlot::kind): Deleted. (JSC::B3::StackSlot::isLocked): Deleted. * b3/B3StackSlotKind.cpp: Removed. * b3/B3StackSlotKind.h: Removed. * b3/B3StackmapValue.cpp: (JSC::B3::StackmapValue::dumpMeta): (JSC::B3::StackmapValue::StackmapValue): * b3/B3StackmapValue.h: * b3/B3SwitchValue.cpp: (JSC::B3::SwitchValue::cloneImpl): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: * b3/B3UpsilonValue.h: * b3/B3Validate.cpp: * b3/B3Value.cpp: (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::replaceWithPhi): (JSC::B3::Value::dump): (JSC::B3::Value::effects): (JSC::B3::Value::checkOpcode): * b3/B3Value.h: * b3/B3Variable.cpp: Added. (JSC::B3::Variable::~Variable): (JSC::B3::Variable::dump): (JSC::B3::Variable::deepDump): (JSC::B3::Variable::Variable): * b3/B3Variable.h: Added. (JSC::B3::Variable::type): (JSC::B3::Variable::index): (JSC::B3::DeepVariableDump::DeepVariableDump): (JSC::B3::DeepVariableDump::dump): (JSC::B3::deepDump): * b3/B3VariableValue.cpp: Added. (JSC::B3::VariableValue::~VariableValue): (JSC::B3::VariableValue::dumpMeta): (JSC::B3::VariableValue::cloneImpl): (JSC::B3::VariableValue::VariableValue): * b3/B3VariableValue.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): * b3/air/AirCode.h: (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::forAllTmps): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::size): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::at): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::operator[]): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::begin): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::end): Deleted. (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): Deleted. (JSC::B3::Air::Code::SpecialsCollection::size): Deleted. (JSC::B3::Air::Code::SpecialsCollection::at): Deleted. (JSC::B3::Air::Code::SpecialsCollection::operator[]): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): Deleted. (JSC::B3::Air::Code::SpecialsCollection::begin): Deleted. (JSC::B3::Air::Code::SpecialsCollection::end): Deleted. * b3/air/AirFixObviousSpills.cpp: * b3/air/AirInstInlines.h: * b3/air/AirIteratedRegisterCoalescing.cpp: * b3/air/AirLiveness.h: * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirSpecial.cpp: (JSC::B3::Air::Special::Special): * b3/air/AirSpecial.h: * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirStackSlot.cpp: (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::isLocked): (JSC::B3::Air::StackSlot::isSpill): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::ensureSize): * b3/air/AirStackSlotKind.cpp: Copied from Source/JavaScriptCore/b3/B3StackSlotKind.cpp. (WTF::printInternal): * b3/air/AirStackSlotKind.h: Copied from Source/JavaScriptCore/b3/B3StackSlotKind.h. * b3/air/opcode_generator.rb: * b3/air/testair.cpp: (JSC::B3::Air::testShuffleBroadcastAllRegs): (JSC::B3::Air::testShuffleShiftAllRegs): (JSC::B3::Air::testShuffleRotateAllRegs): * b3/testb3.cpp: (JSC::B3::testStackSlot): (JSC::B3::testStoreLoadStackSlot): * ftl/FTLB3Output.cpp: (JSC::FTL::Output::lockedStackSlot): (JSC::FTL::Output::neg): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint): Websites/webkit.org: This changes the documentation to account for the addition of Variables and the Get and Set opcodes, and the removal of anonymous stack slots from B3 IR. * docs/b3/intermediate-representation.html: Canonical link: https://commits.webkit.org/171891@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-02 23:21:12 +00:00
{
Air should be powerful enough to support Tmp-splitting https://bugs.webkit.org/show_bug.cgi?id=169515 Reviewed by Saam Barati. Source/JavaScriptCore: In the process of implementing the Tmp-splitting optimization, I made some small clean-ups. They don't affect anything - it's basically moving code around and adding utility functions. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::allocate): testb3 was sometimes failing its checkDoesNotUseInstruction check because of uninitialized memory. This initializes the internal fragmentation slop of every JIT allocation. * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByGraphColoring.h: (JSC::B3::Air::useIRC): It's useful to be able to query which register allocator we're using. * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::temperature): The temperature of a role is a useful concept to have factored out. * b3/air/AirBreakCriticalEdges.cpp: Added. (JSC::B3::Air::breakCriticalEdges): I was surprised that we didn't have this already. It's a pretty fundamental CFG utility. * b3/air/AirBreakCriticalEdges.h: Added. * b3/air/AirGenerate.cpp: * b3/air/AirInsertionSet.h: You can't use & if you want copy-constructibility, which seems to be a prerequisite to IndexMap<BasicBlock, InsertionSet>. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): * b3/air/AirLiveness.h: Teach Liveness to track only warm liveness. (JSC::B3::Air::TmpLivenessAdapter::acceptsRole): (JSC::B3::Air::StackSlotLivenessAdapter::acceptsRole): (JSC::B3::Air::RegLivenessAdapter::acceptsRole): (JSC::B3::Air::AbstractLiveness::AbstractLiveness): (JSC::B3::Air::AbstractLiveness::LocalCalc::execute): Source/WTF: Teach IndexMap how to handle types that don't have a default constructor. This makes it easy to create a IndexMap<BasicBlock, InsertionSet>, which is a super powerful construct. * wtf/IndexMap.h: (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): Canonical link: https://commits.webkit.org/186769@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214109 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-17 17:58:18 +00:00
m_vector.fill(Value(std::forward<Args>(args)...), m_vector.size());
Get rid of anonymous stack slots https://bugs.webkit.org/show_bug.cgi?id=151128 Reviewed by Mark Lam. Source/JavaScriptCore: When I first designed stack slots, the idea was that an "anonymous" stack slot was one that behaved exactly like a C variable: if it never escaped, it would not need to get stack space for the entire lifetime of the function - it could get any slab of stack so long as it didn't interfere with other stack slots that would be live at the same time. The reason I called them "anonymous" is that external code could not get its address. This felt like it gave the stack slot anonymity. But it was never a good name for this concept. Then I had the register allocator lower temporaries to anonymous stack slots when it spilled them. Spilling became the sole client of anonymous stack slots. Then I realized that there was an aspect of how spill slots work that make them want slightly different semantics than a normal C variable. A C variable is a proper memory location - you could do a store to only some bytes in the variable, and it's reasonable to expect that this will not destroy the other bytes in the variable. But that means that to compute their liveness, you have to do something like a per-byte liveness. That's overkill for spill slots. You want any store to the spill slot to kill the whole slot even if it writes to just part of the slot. This matches how temporaries work. So rather than implement per-byte liveness, I decided to change the semantics of anonymous stack slots to make them work like how I wanted spill slots to work. This was quite dirty, and put B3 in the awkward situation that B3's anonymous stack slots behaved like spill slots. But it was OK since nobody used anonymous stack slots in B3. Then I added tail duplication, which required having a mechanism for introducing non-SSA variables in B3. I decided to use anonymous stack slots for this purpose. All of a sudden this all felt like it made sense: anonymous stack slots were just like variables! Hooray for the amazing foresight of anonymous stack slots! But then I realized that this was all very bad. We want B3 to be able to optimize Store and Load operations by reasoning about how they affect bytes in memory. For example, if you do a Load of a 64-bit value, and then you modify just the low 32 bits of that value, and then you do a 64-bit store back to the same location, then it would be better to transform this into 32-bit operations. We don't do this optimization yet, but it's the kind of thing that we want B3 to be able to do. To do it, we need Store to mean that it only affects N bytes starting at the pointer, where N is the size of the thing being stored. But that's not what Store means for anonymous stack slots. For anonymous slots, storing to any byte in the slot clobbers all bytes in the slot. We were never clear if you need to store directly to an anonymous slot to get this behavior, or if any pointer that points to an anoymous slot must exhibit this behavior when stored to. Neither kinds of semantics make sense to me. This change fixes the problem by eradicating anonymous stack slots. In B3, they are replaced with Variables. In Air, they are replaced with a different stack slot kind, called Spill. There is no such thing as stack slot kinds in B3 anymore, all B3 stack slots are locked. In Air, there is still the concept of stack slot kind - Locked or Spill. B3 Variables are awesome. They are exactly what they seem to be. They have a type. They are declared at the top level in the Procedure. You can access them with new opcodes, Get and Set. This greatly simplifies demoting SSA values to variables and promoting them back to SSA. I even made the instruction selector do the right things for variables, which means that introducing variables won't hurt instruction selection (there will be extra moves, but IRC will kill them). It's great to have non-SSA variables as an explicit concept in IR because it means that you don't have to do any magic to use them - they Just Work. Air spill slots behave almost like anonymous stack slots, with one exception: you cannot escape them. We validate this by making it illegal to UseAddr on a spill slot. This removes the need to answer awkward questions like: does a 32-bit Def on a pointer that may point to a 64-bit spill slot do anything to the 32 bits above the pointer? Does it write zero to it? Does it write zero to it just when the pointer actually points to a spill slot or always? These are silly questions, and we don't have to answer them because the only way to refer to a spill slot is directly. No escaping means no aliasing. This doesn't affect performance. It just makes the compiler more fun to work with by removing some cognitive dissonance. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3ArgumentRegValue.h: * b3/B3CCallValue.h: * b3/B3CheckValue.cpp: (JSC::B3::CheckValue::cloneImpl): (JSC::B3::CheckValue::CheckValue): * b3/B3CheckValue.h: * b3/B3Const32Value.h: * b3/B3Const64Value.h: * b3/B3ConstDoubleValue.h: * b3/B3ConstFloatValue.h: * b3/B3ConstPtrValue.h: (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: (JSC::B3::ControlValue::convertToJump): (JSC::B3::ControlValue::convertToOops): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: * b3/B3Effects.cpp: (JSC::B3::Effects::interferes): (JSC::B3::Effects::dump): * b3/B3Effects.h: (JSC::B3::Effects::mustExecute): * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::clear): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::size): (JSC::B3::IndexSet::isEmpty): * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::lower): * b3/B3MemoryValue.h: * b3/B3Opcode.cpp: (WTF::printInternal): * b3/B3Opcode.h: * b3/B3PatchpointValue.cpp: (JSC::B3::PatchpointValue::cloneImpl): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PatchpointValue.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::addStackSlot): (JSC::B3::Procedure::addVariable): (JSC::B3::Procedure::clone): (JSC::B3::Procedure::addIntConstant): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteStackSlot): (JSC::B3::Procedure::deleteVariable): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::calleeSaveRegisters): (JSC::B3::Procedure::addValueImpl): (JSC::B3::Procedure::setBlockOrderImpl): (JSC::B3::Procedure::addAnonymousStackSlot): Deleted. (JSC::B3::Procedure::addStackSlotIndex): Deleted. (JSC::B3::Procedure::addValueIndex): Deleted. * b3/B3Procedure.h: (JSC::B3::Procedure::setBlockOrder): (JSC::B3::Procedure::stackSlots): (JSC::B3::Procedure::variables): (JSC::B3::Procedure::values): (JSC::B3::Procedure::StackSlotsCollection::StackSlotsCollection): Deleted. (JSC::B3::Procedure::StackSlotsCollection::size): Deleted. (JSC::B3::Procedure::StackSlotsCollection::at): Deleted. (JSC::B3::Procedure::StackSlotsCollection::operator[]): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::iterator): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator*): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator++): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator==): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::operator!=): Deleted. (JSC::B3::Procedure::StackSlotsCollection::iterator::findNext): Deleted. (JSC::B3::Procedure::StackSlotsCollection::begin): Deleted. (JSC::B3::Procedure::StackSlotsCollection::end): Deleted. (JSC::B3::Procedure::ValuesCollection::ValuesCollection): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::iterator): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator*): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator++): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator==): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): Deleted. (JSC::B3::Procedure::ValuesCollection::iterator::findNext): Deleted. (JSC::B3::Procedure::ValuesCollection::begin): Deleted. (JSC::B3::Procedure::ValuesCollection::end): Deleted. (JSC::B3::Procedure::ValuesCollection::size): Deleted. (JSC::B3::Procedure::ValuesCollection::at): Deleted. (JSC::B3::Procedure::ValuesCollection::operator[]): Deleted. * b3/B3ProcedureInlines.h: (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: * b3/B3SlotBaseValue.h: * b3/B3SparseCollection.h: Added. (JSC::B3::SparseCollection::SparseCollection): (JSC::B3::SparseCollection::add): (JSC::B3::SparseCollection::addNew): (JSC::B3::SparseCollection::remove): (JSC::B3::SparseCollection::size): (JSC::B3::SparseCollection::isEmpty): (JSC::B3::SparseCollection::at): (JSC::B3::SparseCollection::operator[]): (JSC::B3::SparseCollection::iterator::iterator): (JSC::B3::SparseCollection::iterator::operator*): (JSC::B3::SparseCollection::iterator::operator++): (JSC::B3::SparseCollection::iterator::operator==): (JSC::B3::SparseCollection::iterator::operator!=): (JSC::B3::SparseCollection::iterator::findNext): (JSC::B3::SparseCollection::begin): (JSC::B3::SparseCollection::end): * b3/B3StackSlot.cpp: (JSC::B3::StackSlot::deepDump): (JSC::B3::StackSlot::StackSlot): * b3/B3StackSlot.h: (JSC::B3::StackSlot::byteSize): (JSC::B3::StackSlot::index): (JSC::B3::StackSlot::setOffsetFromFP): (JSC::B3::StackSlot::kind): Deleted. (JSC::B3::StackSlot::isLocked): Deleted. * b3/B3StackSlotKind.cpp: Removed. * b3/B3StackSlotKind.h: Removed. * b3/B3StackmapValue.cpp: (JSC::B3::StackmapValue::dumpMeta): (JSC::B3::StackmapValue::StackmapValue): * b3/B3StackmapValue.h: * b3/B3SwitchValue.cpp: (JSC::B3::SwitchValue::cloneImpl): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: * b3/B3UpsilonValue.h: * b3/B3Validate.cpp: * b3/B3Value.cpp: (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::replaceWithPhi): (JSC::B3::Value::dump): (JSC::B3::Value::effects): (JSC::B3::Value::checkOpcode): * b3/B3Value.h: * b3/B3Variable.cpp: Added. (JSC::B3::Variable::~Variable): (JSC::B3::Variable::dump): (JSC::B3::Variable::deepDump): (JSC::B3::Variable::Variable): * b3/B3Variable.h: Added. (JSC::B3::Variable::type): (JSC::B3::Variable::index): (JSC::B3::DeepVariableDump::DeepVariableDump): (JSC::B3::DeepVariableDump::dump): (JSC::B3::deepDump): * b3/B3VariableValue.cpp: Added. (JSC::B3::VariableValue::~VariableValue): (JSC::B3::VariableValue::dumpMeta): (JSC::B3::VariableValue::cloneImpl): (JSC::B3::VariableValue::VariableValue): * b3/B3VariableValue.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): * b3/air/AirCode.h: (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::forAllTmps): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::size): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::at): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::operator[]): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::begin): Deleted. (JSC::B3::Air::Code::StackSlotsCollection::end): Deleted. (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): Deleted. (JSC::B3::Air::Code::SpecialsCollection::size): Deleted. (JSC::B3::Air::Code::SpecialsCollection::at): Deleted. (JSC::B3::Air::Code::SpecialsCollection::operator[]): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): Deleted. (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): Deleted. (JSC::B3::Air::Code::SpecialsCollection::begin): Deleted. (JSC::B3::Air::Code::SpecialsCollection::end): Deleted. * b3/air/AirFixObviousSpills.cpp: * b3/air/AirInstInlines.h: * b3/air/AirIteratedRegisterCoalescing.cpp: * b3/air/AirLiveness.h: * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirSpecial.cpp: (JSC::B3::Air::Special::Special): * b3/air/AirSpecial.h: * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirStackSlot.cpp: (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::isLocked): (JSC::B3::Air::StackSlot::isSpill): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::ensureSize): * b3/air/AirStackSlotKind.cpp: Copied from Source/JavaScriptCore/b3/B3StackSlotKind.cpp. (WTF::printInternal): * b3/air/AirStackSlotKind.h: Copied from Source/JavaScriptCore/b3/B3StackSlotKind.h. * b3/air/opcode_generator.rb: * b3/air/testair.cpp: (JSC::B3::Air::testShuffleBroadcastAllRegs): (JSC::B3::Air::testShuffleShiftAllRegs): (JSC::B3::Air::testShuffleRotateAllRegs): * b3/testb3.cpp: (JSC::B3::testStackSlot): (JSC::B3::testStoreLoadStackSlot): * ftl/FTLB3Output.cpp: (JSC::FTL::Output::lockedStackSlot): (JSC::FTL::Output::neg): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint): Websites/webkit.org: This changes the documentation to account for the addition of Variables and the Get and Set opcodes, and the removal of anonymous stack slots from B3 IR. * docs/b3/intermediate-representation.html: Canonical link: https://commits.webkit.org/171891@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@196032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-02-02 23:21:12 +00:00
}
FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers https://bugs.webkit.org/show_bug.cgi?id=151955 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Taught B3 about the concept of "fast constants". A client of B3 can now tell B3 which constants are super important. B3 will not spill the constant in that case and will ensure that the constant is materialized only once: statically once, and dynamically once per procedure execution. The hoistFastConstants() algorithm in B3MoveConstants.cpp achieves this by first picking the lowest common dominator of all uses of each fast constant, and then picking the materialization point by finding the lowest dominator of that dominator that is tied for lowest block frequency. In practice, the second step ensures that this is the lowest point in the program that is not in a loop (i.e. executes no more than once dynamically per procedure invocation). Taught Air about the concept of "fast tmps". B3 tells Air that a tmp is fast if it is used to hold the materialization of a fast constant. IRC will use the lowest possible spill score for fast tmps. In practice, this ensures that fast constants are never spilled. Added a small snippet of code to FTL::LowerDFGToLLVM that makes both of the tag constants into fast constants. My hope is that this very brute-force heuristic is good enough that we don't have to think about constants for a while. Based on my experience with how LLVM's constant hoisting works out, the heuristic in this patch is going to be tough to beat. LLVM's constant hoisting does good things when it hoists the tags, and usually causes nothing but problems when it hoists anything else. This is because there is no way a low-level compiler to really understand how a constant materialization impacts some operation's contribution to the overall execution time of a procedure. But, in the FTL we know that constant materializations for type checks are a bummer because we are super comfortable placing type checks on the hottest of paths. So those are the last paths where extra instructions should be added by the compiler. On the other hand, all other large constant uses are on relatively cold paths, or paths that are already expensive for other reasons. For example, global variable accesses have to materialize a pointer to the global. But that's not really a big deal, since a load from a global involves first the load itself and then type checks on the result - so probably the constant materialization is just not interesting. A store to a global often involves a store barrier, so the constant materialization is really not interesting. This patch codifies this heuristic in a pact between Air, B3, and the FTL: FTL demands that B3 pin the two tags in registers, and B3 relays the demand to Air. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CFG.h: Added. (JSC::B3::CFG::CFG): (JSC::B3::CFG::root): (JSC::B3::CFG::newMap): (JSC::B3::CFG::successors): (JSC::B3::CFG::predecessors): (JSC::B3::CFG::index): (JSC::B3::CFG::node): (JSC::B3::CFG::numNodes): (JSC::B3::CFG::dump): * b3/B3Dominators.h: Added. (JSC::B3::Dominators::Dominators): * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3LowerMacros.cpp: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::tmp): * b3/B3MoveConstants.cpp: * b3/B3Opcode.h: (JSC::B3::constPtrOpcode): (JSC::B3::isConstant): * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::invalidateCFG): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::dominators): (JSC::B3::Procedure::addFastConstant): (JSC::B3::Procedure::isFastConstant): (JSC::B3::Procedure::addDataSection): * b3/B3Procedure.h: (JSC::B3::Procedure::size): (JSC::B3::Procedure::cfg): (JSC::B3::Procedure::setLastPhaseName): * b3/B3ReduceStrength.cpp: * b3/B3ValueInlines.h: (JSC::B3::Value::isConstant): (JSC::B3::Value::isInteger): * b3/B3ValueKey.h: (JSC::B3::ValueKey::canMaterialize): (JSC::B3::ValueKey::isConstant): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::findNextBlock): (JSC::B3::Air::Code::addFastTmp): * b3/air/AirCode.h: (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::isFastTmp): (JSC::B3::Air::Code::setLastPhaseName): * b3/air/AirIteratedRegisterCoalescing.cpp: * dfg/DFGDominators.h: * dfg/DFGSSACalculator.cpp: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::lower): Source/WTF: Remove some remaining DFG-specific snippets from Dominators. This used to be a non-template DFG class, and some time ago I hoisted it into WTF and made it generic. But since the only user of the class was the DFG, this class still had a handful of DFG-specific snippets that didn't compile when I started using it from B3. Also renamed immediateDominatorOf() to idom(). This is the sort of abbreviation that we wouldn't ordinarily want to have in WebKit. But WebKit does allow for abbreviations that are "more canonical". The term "idom" is definitely more canonical than "immediateDominatorOf". * wtf/Dominators.h: (WTF::Dominators::dominates): (WTF::Dominators::idom): (WTF::Dominators::forAllStrictDominatorsOf): (WTF::Dominators::NaiveDominators::dominates): (WTF::Dominators::NaiveDominators::dump): (WTF::Dominators::ValidationContext::handleErrors): Canonical link: https://commits.webkit.org/170119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-08 02:46:22 +00:00
size_t size() const { return m_vector.size(); }
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
Value& at(const Key& key)
FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers https://bugs.webkit.org/show_bug.cgi?id=151955 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Taught B3 about the concept of "fast constants". A client of B3 can now tell B3 which constants are super important. B3 will not spill the constant in that case and will ensure that the constant is materialized only once: statically once, and dynamically once per procedure execution. The hoistFastConstants() algorithm in B3MoveConstants.cpp achieves this by first picking the lowest common dominator of all uses of each fast constant, and then picking the materialization point by finding the lowest dominator of that dominator that is tied for lowest block frequency. In practice, the second step ensures that this is the lowest point in the program that is not in a loop (i.e. executes no more than once dynamically per procedure invocation). Taught Air about the concept of "fast tmps". B3 tells Air that a tmp is fast if it is used to hold the materialization of a fast constant. IRC will use the lowest possible spill score for fast tmps. In practice, this ensures that fast constants are never spilled. Added a small snippet of code to FTL::LowerDFGToLLVM that makes both of the tag constants into fast constants. My hope is that this very brute-force heuristic is good enough that we don't have to think about constants for a while. Based on my experience with how LLVM's constant hoisting works out, the heuristic in this patch is going to be tough to beat. LLVM's constant hoisting does good things when it hoists the tags, and usually causes nothing but problems when it hoists anything else. This is because there is no way a low-level compiler to really understand how a constant materialization impacts some operation's contribution to the overall execution time of a procedure. But, in the FTL we know that constant materializations for type checks are a bummer because we are super comfortable placing type checks on the hottest of paths. So those are the last paths where extra instructions should be added by the compiler. On the other hand, all other large constant uses are on relatively cold paths, or paths that are already expensive for other reasons. For example, global variable accesses have to materialize a pointer to the global. But that's not really a big deal, since a load from a global involves first the load itself and then type checks on the result - so probably the constant materialization is just not interesting. A store to a global often involves a store barrier, so the constant materialization is really not interesting. This patch codifies this heuristic in a pact between Air, B3, and the FTL: FTL demands that B3 pin the two tags in registers, and B3 relays the demand to Air. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CFG.h: Added. (JSC::B3::CFG::CFG): (JSC::B3::CFG::root): (JSC::B3::CFG::newMap): (JSC::B3::CFG::successors): (JSC::B3::CFG::predecessors): (JSC::B3::CFG::index): (JSC::B3::CFG::node): (JSC::B3::CFG::numNodes): (JSC::B3::CFG::dump): * b3/B3Dominators.h: Added. (JSC::B3::Dominators::Dominators): * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3LowerMacros.cpp: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::tmp): * b3/B3MoveConstants.cpp: * b3/B3Opcode.h: (JSC::B3::constPtrOpcode): (JSC::B3::isConstant): * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::invalidateCFG): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::dominators): (JSC::B3::Procedure::addFastConstant): (JSC::B3::Procedure::isFastConstant): (JSC::B3::Procedure::addDataSection): * b3/B3Procedure.h: (JSC::B3::Procedure::size): (JSC::B3::Procedure::cfg): (JSC::B3::Procedure::setLastPhaseName): * b3/B3ReduceStrength.cpp: * b3/B3ValueInlines.h: (JSC::B3::Value::isConstant): (JSC::B3::Value::isInteger): * b3/B3ValueKey.h: (JSC::B3::ValueKey::canMaterialize): (JSC::B3::ValueKey::isConstant): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::findNextBlock): (JSC::B3::Air::Code::addFastTmp): * b3/air/AirCode.h: (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::isFastTmp): (JSC::B3::Air::Code::setLastPhaseName): * b3/air/AirIteratedRegisterCoalescing.cpp: * dfg/DFGDominators.h: * dfg/DFGSSACalculator.cpp: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::lower): Source/WTF: Remove some remaining DFG-specific snippets from Dominators. This used to be a non-template DFG class, and some time ago I hoisted it into WTF and made it generic. But since the only user of the class was the DFG, this class still had a handful of DFG-specific snippets that didn't compile when I started using it from B3. Also renamed immediateDominatorOf() to idom(). This is the sort of abbreviation that we wouldn't ordinarily want to have in WebKit. But WebKit does allow for abbreviations that are "more canonical". The term "idom" is definitely more canonical than "immediateDominatorOf". * wtf/Dominators.h: (WTF::Dominators::dominates): (WTF::Dominators::idom): (WTF::Dominators::forAllStrictDominatorsOf): (WTF::Dominators::NaiveDominators::dominates): (WTF::Dominators::NaiveDominators::dump): (WTF::Dominators::ValidationContext::handleErrors): Canonical link: https://commits.webkit.org/170119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-08 02:46:22 +00:00
{
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
return m_vector[IndexKeyType<Key>::index(key)];
}
const Value& at(const Key& key) const
{
return m_vector[IndexKeyType<Key>::index(key)];
FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers https://bugs.webkit.org/show_bug.cgi?id=151955 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Taught B3 about the concept of "fast constants". A client of B3 can now tell B3 which constants are super important. B3 will not spill the constant in that case and will ensure that the constant is materialized only once: statically once, and dynamically once per procedure execution. The hoistFastConstants() algorithm in B3MoveConstants.cpp achieves this by first picking the lowest common dominator of all uses of each fast constant, and then picking the materialization point by finding the lowest dominator of that dominator that is tied for lowest block frequency. In practice, the second step ensures that this is the lowest point in the program that is not in a loop (i.e. executes no more than once dynamically per procedure invocation). Taught Air about the concept of "fast tmps". B3 tells Air that a tmp is fast if it is used to hold the materialization of a fast constant. IRC will use the lowest possible spill score for fast tmps. In practice, this ensures that fast constants are never spilled. Added a small snippet of code to FTL::LowerDFGToLLVM that makes both of the tag constants into fast constants. My hope is that this very brute-force heuristic is good enough that we don't have to think about constants for a while. Based on my experience with how LLVM's constant hoisting works out, the heuristic in this patch is going to be tough to beat. LLVM's constant hoisting does good things when it hoists the tags, and usually causes nothing but problems when it hoists anything else. This is because there is no way a low-level compiler to really understand how a constant materialization impacts some operation's contribution to the overall execution time of a procedure. But, in the FTL we know that constant materializations for type checks are a bummer because we are super comfortable placing type checks on the hottest of paths. So those are the last paths where extra instructions should be added by the compiler. On the other hand, all other large constant uses are on relatively cold paths, or paths that are already expensive for other reasons. For example, global variable accesses have to materialize a pointer to the global. But that's not really a big deal, since a load from a global involves first the load itself and then type checks on the result - so probably the constant materialization is just not interesting. A store to a global often involves a store barrier, so the constant materialization is really not interesting. This patch codifies this heuristic in a pact between Air, B3, and the FTL: FTL demands that B3 pin the two tags in registers, and B3 relays the demand to Air. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CFG.h: Added. (JSC::B3::CFG::CFG): (JSC::B3::CFG::root): (JSC::B3::CFG::newMap): (JSC::B3::CFG::successors): (JSC::B3::CFG::predecessors): (JSC::B3::CFG::index): (JSC::B3::CFG::node): (JSC::B3::CFG::numNodes): (JSC::B3::CFG::dump): * b3/B3Dominators.h: Added. (JSC::B3::Dominators::Dominators): * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3LowerMacros.cpp: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::tmp): * b3/B3MoveConstants.cpp: * b3/B3Opcode.h: (JSC::B3::constPtrOpcode): (JSC::B3::isConstant): * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::invalidateCFG): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::dominators): (JSC::B3::Procedure::addFastConstant): (JSC::B3::Procedure::isFastConstant): (JSC::B3::Procedure::addDataSection): * b3/B3Procedure.h: (JSC::B3::Procedure::size): (JSC::B3::Procedure::cfg): (JSC::B3::Procedure::setLastPhaseName): * b3/B3ReduceStrength.cpp: * b3/B3ValueInlines.h: (JSC::B3::Value::isConstant): (JSC::B3::Value::isInteger): * b3/B3ValueKey.h: (JSC::B3::ValueKey::canMaterialize): (JSC::B3::ValueKey::isConstant): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::findNextBlock): (JSC::B3::Air::Code::addFastTmp): * b3/air/AirCode.h: (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::isFastTmp): (JSC::B3::Air::Code::setLastPhaseName): * b3/air/AirIteratedRegisterCoalescing.cpp: * dfg/DFGDominators.h: * dfg/DFGSSACalculator.cpp: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::lower): Source/WTF: Remove some remaining DFG-specific snippets from Dominators. This used to be a non-template DFG class, and some time ago I hoisted it into WTF and made it generic. But since the only user of the class was the DFG, this class still had a handful of DFG-specific snippets that didn't compile when I started using it from B3. Also renamed immediateDominatorOf() to idom(). This is the sort of abbreviation that we wouldn't ordinarily want to have in WebKit. But WebKit does allow for abbreviations that are "more canonical". The term "idom" is definitely more canonical than "immediateDominatorOf". * wtf/Dominators.h: (WTF::Dominators::dominates): (WTF::Dominators::idom): (WTF::Dominators::forAllStrictDominatorsOf): (WTF::Dominators::NaiveDominators::dominates): (WTF::Dominators::NaiveDominators::dump): (WTF::Dominators::ValidationContext::handleErrors): Canonical link: https://commits.webkit.org/170119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-08 02:46:22 +00:00
}
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
Value& at(size_t index)
FTL B3 should be able to flag the tag constants as being super important so that B3 can hoist them and Air can force them into registers https://bugs.webkit.org/show_bug.cgi?id=151955 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Taught B3 about the concept of "fast constants". A client of B3 can now tell B3 which constants are super important. B3 will not spill the constant in that case and will ensure that the constant is materialized only once: statically once, and dynamically once per procedure execution. The hoistFastConstants() algorithm in B3MoveConstants.cpp achieves this by first picking the lowest common dominator of all uses of each fast constant, and then picking the materialization point by finding the lowest dominator of that dominator that is tied for lowest block frequency. In practice, the second step ensures that this is the lowest point in the program that is not in a loop (i.e. executes no more than once dynamically per procedure invocation). Taught Air about the concept of "fast tmps". B3 tells Air that a tmp is fast if it is used to hold the materialization of a fast constant. IRC will use the lowest possible spill score for fast tmps. In practice, this ensures that fast constants are never spilled. Added a small snippet of code to FTL::LowerDFGToLLVM that makes both of the tag constants into fast constants. My hope is that this very brute-force heuristic is good enough that we don't have to think about constants for a while. Based on my experience with how LLVM's constant hoisting works out, the heuristic in this patch is going to be tough to beat. LLVM's constant hoisting does good things when it hoists the tags, and usually causes nothing but problems when it hoists anything else. This is because there is no way a low-level compiler to really understand how a constant materialization impacts some operation's contribution to the overall execution time of a procedure. But, in the FTL we know that constant materializations for type checks are a bummer because we are super comfortable placing type checks on the hottest of paths. So those are the last paths where extra instructions should be added by the compiler. On the other hand, all other large constant uses are on relatively cold paths, or paths that are already expensive for other reasons. For example, global variable accesses have to materialize a pointer to the global. But that's not really a big deal, since a load from a global involves first the load itself and then type checks on the result - so probably the constant materialization is just not interesting. A store to a global often involves a store barrier, so the constant materialization is really not interesting. This patch codifies this heuristic in a pact between Air, B3, and the FTL: FTL demands that B3 pin the two tags in registers, and B3 relays the demand to Air. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3CFG.h: Added. (JSC::B3::CFG::CFG): (JSC::B3::CFG::root): (JSC::B3::CFG::newMap): (JSC::B3::CFG::successors): (JSC::B3::CFG::predecessors): (JSC::B3::CFG::index): (JSC::B3::CFG::node): (JSC::B3::CFG::numNodes): (JSC::B3::CFG::dump): * b3/B3Dominators.h: Added. (JSC::B3::Dominators::Dominators): * b3/B3IndexMap.h: (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::size): (JSC::B3::IndexMap::operator[]): * b3/B3LowerMacros.cpp: * b3/B3LowerToAir.cpp: (JSC::B3::Air::LowerToAir::tmp): * b3/B3MoveConstants.cpp: * b3/B3Opcode.h: (JSC::B3::constPtrOpcode): (JSC::B3::isConstant): * b3/B3Procedure.cpp: (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::invalidateCFG): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteValue): (JSC::B3::Procedure::dominators): (JSC::B3::Procedure::addFastConstant): (JSC::B3::Procedure::isFastConstant): (JSC::B3::Procedure::addDataSection): * b3/B3Procedure.h: (JSC::B3::Procedure::size): (JSC::B3::Procedure::cfg): (JSC::B3::Procedure::setLastPhaseName): * b3/B3ReduceStrength.cpp: * b3/B3ValueInlines.h: (JSC::B3::Value::isConstant): (JSC::B3::Value::isInteger): * b3/B3ValueKey.h: (JSC::B3::ValueKey::canMaterialize): (JSC::B3::ValueKey::isConstant): * b3/air/AirCode.cpp: (JSC::B3::Air::Code::findNextBlock): (JSC::B3::Air::Code::addFastTmp): * b3/air/AirCode.h: (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::isFastTmp): (JSC::B3::Air::Code::setLastPhaseName): * b3/air/AirIteratedRegisterCoalescing.cpp: * dfg/DFGDominators.h: * dfg/DFGSSACalculator.cpp: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::lower): Source/WTF: Remove some remaining DFG-specific snippets from Dominators. This used to be a non-template DFG class, and some time ago I hoisted it into WTF and made it generic. But since the only user of the class was the DFG, this class still had a handful of DFG-specific snippets that didn't compile when I started using it from B3. Also renamed immediateDominatorOf() to idom(). This is the sort of abbreviation that we wouldn't ordinarily want to have in WebKit. But WebKit does allow for abbreviations that are "more canonical". The term "idom" is definitely more canonical than "immediateDominatorOf". * wtf/Dominators.h: (WTF::Dominators::dominates): (WTF::Dominators::idom): (WTF::Dominators::forAllStrictDominatorsOf): (WTF::Dominators::NaiveDominators::dominates): (WTF::Dominators::NaiveDominators::dump): (WTF::Dominators::ValidationContext::handleErrors): Canonical link: https://commits.webkit.org/170119@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@193682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-08 02:46:22 +00:00
{
return m_vector[index];
}
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
const Value& at(size_t index) const
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
{
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
return m_vector[index];
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
}
[WebAssembly] Write a new register allocator for Air O0 and make BBQ use it https://bugs.webkit.org/show_bug.cgi?id=194036 Reviewed by Yusuke Suzuki. JSTests: * stress/tail-call-many-arguments.js: Added. (foo): (bar): Source/JavaScriptCore: This patch adds a new Air-O0 backend. Air-O0 runs fewer passes and doesn't use linear scan for register allocation. Instead of linear scan, Air-O0 does mostly block-local register allocation, and it does this as it's emitting code directly. The register allocator uses liveness analysis to reduce the number of spills. Doing register allocation as we're emitting code allows us to skip editing the IR to insert spills, which saves a non trivial amount of compile time. For stack allocation, we give each Tmp its own slot. This is less than ideal. We probably want to do some trivial live range analysis in the future. The reason this isn't a deal breaker for Wasm is that this patch makes it so that we reuse Tmps as we're generating Air IR in the AirIRGenerator. Because Wasm is a stack machine, we trivially know when we kill a stack value (its last use). This patch is another 25% Wasm startup time speedup. It seems to be worth another 1% on JetStream2. * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: Added. (JSC::B3::Air::GenerateAndAllocateRegisters::GenerateAndAllocateRegisters): (JSC::B3::Air::GenerateAndAllocateRegisters::buildLiveRanges): (JSC::B3::Air::GenerateAndAllocateRegisters::insertBlocksForFlushAfterTerminalPatchpoints): (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::spill): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::freeDeadTmpsIfNeeded): (JSC::B3::Air::GenerateAndAllocateRegisters::assignTmp): (JSC::B3::Air::GenerateAndAllocateRegisters::isDisallowedRegister): (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: Added. * b3/air/AirCode.cpp: * b3/air/AirCode.h: * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generateWithAlreadyAllocatedRegisters): (JSC::B3::Air::generate): * b3/air/AirHandleCalleeSaves.cpp: (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: * b3/air/AirTmpMap.h: * runtime/Options.h: * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::didKill): (JSC::Wasm::AirIRGenerator::newTmp): (JSC::Wasm::AirIRGenerator::AirIRGenerator): (JSC::Wasm::parseAndCompileAir): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF64>): (JSC::Wasm::AirIRGenerator::addOp<OpType::I64TruncUF32>): * wasm/WasmAirIRGenerator.h: * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::B3IRGenerator::didKill): * wasm/WasmBBQPlan.cpp: (JSC::Wasm::BBQPlan::compileFunctions): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser<Context>::parseBody): (JSC::Wasm::FunctionParser<Context>::parseExpression): * wasm/WasmValidate.cpp: (JSC::Wasm::Validate::didKill): Source/WTF: * wtf/IndexMap.h: (WTF::IndexMap::at): (WTF::IndexMap::at const): (WTF::IndexMap::operator[]): (WTF::IndexMap::operator[] const): Tools: * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/209077@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-02-15 08:26:17 +00:00
Value& operator[](size_t index) { return at(index); }
const Value& operator[](size_t index) const { return at(index); }
Value& operator[](const Key& key) { return at(key); }
const Value& operator[](const Key& key) const { return at(key); }
Air should support linear scan for optLevel<2 https://bugs.webkit.org/show_bug.cgi?id=170161 Reviewed by Saam Barati. Source/JavaScriptCore: This changes the default opt level of B3 to 2. It makes the other opt levels useful by adding a new register allocator. This new linear scan allocator will produce significantly worse code. But it will produce that code a lot faster than IRC or Briggs. The opt levels are: 0: no optimizations, linear scan 1: some optimizations, linear scan 2: full optimizations, graph coloring (IRC or Briggs based on CPU) What we used to call optLevel=1 is not called optLevel=2, or better yet, optLevel=B3::defaultOptLevel(). We no longer have anything like the old optLevel=0 (which did no optimizations but ran graph coloring). allocateRegistersByLinearScan() faithfully implements Massimiliano Poletto and Vivek Sarkar's famous algorithm. It uses the variant that handles clobbered registers by avoiding assigning ranges to those registers if the range overlaps a clobber. It's engineered to allocate registers very quickly and generate inefficient code without falling off a cliff. The new optLevel=1 speeds up B3 by a factor of 2, and results in a 80% throughput regression. Linear scan runs 4.7x faster than graph coloring on average. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: * b3/B3CFG.h: (JSC::B3::CFG::newMap): * b3/B3Common.h: (JSC::B3::defaultOptLevel): * b3/B3Compile.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3Generate.cpp: (JSC::B3::prepareForGeneration): (JSC::B3::generateToAir): * b3/B3Generate.h: * b3/B3HeapRange.cpp: Removed. * b3/B3HeapRange.h: (JSC::B3::HeapRange::HeapRange): Deleted. (JSC::B3::HeapRange::top): Deleted. (JSC::B3::HeapRange::operator==): Deleted. (JSC::B3::HeapRange::operator!=): Deleted. (JSC::B3::HeapRange::operator|): Deleted. (JSC::B3::HeapRange::operator bool): Deleted. (JSC::B3::HeapRange::begin): Deleted. (JSC::B3::HeapRange::end): Deleted. (JSC::B3::HeapRange::overlaps): Deleted. * b3/B3LowerToAir.cpp: * b3/B3MoveConstants.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::setBlockOrderImpl): * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByLinearScan.cpp: Added. (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirAllocateRegistersByLinearScan.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::activeAt): (JSC::B3::Air::Arg::timing): (JSC::B3::Air::Arg::forEachPhase): * b3/air/AirBasicBlock.h: * b3/air/AirBlockWorklist.h: * b3/air/AirCFG.h: (JSC::B3::Air::CFG::newMap): * b3/air/AirEliminateDeadCode.cpp: (JSC::B3::Air::eliminateDeadCode): * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: (JSC::B3::Air::fixPartialRegisterStalls): * b3/air/AirFixSpillsAfterTerminals.cpp: Added. (JSC::B3::Air::fixSpillsAfterTerminals): * b3/air/AirFixSpillsAfterTerminals.h: Added. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirGenerate.h: * b3/air/AirGenerationContext.h: * b3/air/AirInsertionSet.h: * b3/air/AirInst.cpp: (JSC::B3::Air::Inst::needsPadding): * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirLowerEntrySwitch.cpp: (JSC::B3::Air::lowerEntrySwitch): * b3/air/AirOpcode.opcodes: * b3/air/AirPhaseInsertionSet.cpp: Added. (JSC::B3::Air::PhaseInsertionSet::execute): * b3/air/AirPhaseInsertionSet.h: Added. (JSC::B3::Air::PhaseInsertion::PhaseInsertion): (JSC::B3::Air::PhaseInsertion::phase): (JSC::B3::Air::PhaseInsertion::operator<): (JSC::B3::Air::PhaseInsertionSet::PhaseInsertionSet): (JSC::B3::Air::PhaseInsertionSet::appendInsertion): (JSC::B3::Air::PhaseInsertionSet::insertInst): (JSC::B3::Air::PhaseInsertionSet::insert): * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: (JSC::B3::Air::Tmp::tmpForIndex): * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::Indexed::Indexed): (JSC::B3::Air::Tmp::Indexed::index): (JSC::B3::Air::Tmp::AbsolutelyIndexed::AbsolutelyIndexed): (JSC::B3::Air::Tmp::AbsolutelyIndexed::index): (JSC::B3::Air::Tmp::indexed): (JSC::B3::Air::Tmp::absolutelyIndexed): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): * b3/testb3.cpp: (JSC::B3::compile): (JSC::B3::testMulLoadTwice): * jit/RegisterSet.h: (JSC::RegisterSet::add): (JSC::RegisterSet::remove): * runtime/Options.h: * wasm/WasmB3IRGenerator.h: Source/WTF: This change introduces a new low-latency register allocator. It can allocate registers very quickly by doing a relatively poor job. Implementing this algorithm required beefing up some of our core algorithms. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Deque.h: Make it possible to do some basic priority queueing with this data structure. (WTF::inlineCapacity>::removeAllMatching): (WTF::inlineCapacity>::appendAndBubble): (WTF::inlineCapacity>::takeLast): * wtf/IndexKeyType.h: Added. This makes it possible to use IndexMap and IndexSet with value or pointer types. Previously they just worked with pointer types. (WTF::IndexKeyType::index): * wtf/IndexMap.h: Adopt IndexKeyType. (WTF::IndexMap::operator[]): (WTF::IndexMap::append): * wtf/IndexSet.h: Adopt IndexKeyType. (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::Iterable::iterator::operator*): * wtf/Range.h: Added. This used to be B3::HeapRange. This generalizes that data structure to any kind of range stuff. (WTF::Range::Range): (WTF::Range::top): (WTF::Range::operator==): (WTF::Range::operator!=): (WTF::Range::operator bool): (WTF::Range::operator|): (WTF::Range::operator|=): (WTF::Range::begin): (WTF::Range::end): (WTF::Range::overlaps): (WTF::Range::dump): * wtf/RangeSet.h: (WTF::RangeSet::add): Tools: This makes us run a bunch of JS tests at optLevel=1 to force testing of this new compiler pipeline. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/187230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-30 22:55:44 +00:00
Linear scan should run liveness only once https://bugs.webkit.org/show_bug.cgi?id=170569 Reviewed by Keith Miller. Source/JavaScriptCore: Air has a longstanding design bug that Tmps from different banks are indexed independently. This means that all of our analyses over Tmps do separate GP and FP passes. This does have some marginal benefits (the rest of the algorithm is specialized for Bank) but it's probably net bad. However, I don't want to think about solving that general problem. Instead, this just makes linear scan use a UnifiedTmpLiveness that uses a single "linear" indexing for GP and FP. This lets me avoid the much larger refactoring (which would involve substantial changes in graph coloring) while getting the bulk of the benefit (liveness runs once, instead of twice, for linear scan). This patch implements a lot of plumbing to make it possible for Liveness<> to view Tmps as having a unified indexing scheme. Tmp calls this LinearlyIndexed (to match the naming convention of AbsolutelyIndexed and Indexed), while AirLiveness calls this UnifiedTmpLiveness. With this change, -O1 never does any liveness analysis that uses separate GP and FP passes. I think this eliminates any urgency from the larger Tmp indexing bug. We can probably live with graph coloring doing separate passes. This is a ~6% speed-up for wasm -O1 compile times. I think this means that linear scan is no longer the longest pole in the tent. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3VariableLiveness.h: (JSC::B3::VariableLivenessAdapter::prepareToCompute): * b3/air/AirAllocateRegistersByLinearScan.cpp: (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirCode.h: (JSC::B3::Air::Code::forEachTmp): * b3/air/AirLiveness.h: * b3/air/AirLivenessAdapter.h: (JSC::B3::Air::LivenessAdapter::Actions::Actions): (JSC::B3::Air::LivenessAdapter::LivenessAdapter): (JSC::B3::Air::LivenessAdapter::adapter): (JSC::B3::Air::LivenessAdapter::prepareToCompute): (JSC::B3::Air::LivenessAdapter::actionsAt): (JSC::B3::Air::LivenessAdapter::forEachUse): (JSC::B3::Air::LivenessAdapter::forEachDef): (JSC::B3::Air::TmpLivenessAdapter::numIndices): (JSC::B3::Air::UnifiedTmpLivenessAdapter::UnifiedTmpLivenessAdapter): (JSC::B3::Air::UnifiedTmpLivenessAdapter::numIndices): (JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsBank): (JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsRole): (JSC::B3::Air::UnifiedTmpLivenessAdapter::valueToIndex): (JSC::B3::Air::UnifiedTmpLivenessAdapter::indexToValue): * b3/air/AirLivenessConstraints.h: Removed. * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::LinearlyIndexed::LinearlyIndexed): (JSC::B3::Air::Tmp::LinearlyIndexed::index): (JSC::B3::Air::Tmp::linearlyIndexed): (JSC::B3::Air::Tmp::indexEnd): (JSC::B3::Air::Tmp::absoluteIndexEnd): (JSC::B3::Air::Tmp::linearIndexEnd): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): (JSC::B3::Air::Tmp::tmpForLinearIndex): * b3/air/AirTmpMap.h: Added. (JSC::B3::Air::TmpMap::TmpMap): (JSC::B3::Air::TmpMap::resize): (JSC::B3::Air::TmpMap::clear): (JSC::B3::Air::TmpMap::operator[]): (JSC::B3::Air::TmpMap::append): Source/WTF: Have Liveness<> call Adapter::prepareToCompute(), since this makes it a lot easier to implement constraint generation, since the constraint generator now gets to run after the Adapter is fully constructed. * wtf/IndexMap.h: (WTF::IndexMap::append): Also make this a bit more versatile. * wtf/Liveness.h: (WTF::Liveness::LocalCalc::Iterable::contains): (WTF::Liveness::Iterable::contains): (WTF::Liveness::compute): Canonical link: https://commits.webkit.org/187500@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-07 00:11:16 +00:00
template<typename PassedValue>
void append(const Key& key, PassedValue&& value)
Air should support linear scan for optLevel<2 https://bugs.webkit.org/show_bug.cgi?id=170161 Reviewed by Saam Barati. Source/JavaScriptCore: This changes the default opt level of B3 to 2. It makes the other opt levels useful by adding a new register allocator. This new linear scan allocator will produce significantly worse code. But it will produce that code a lot faster than IRC or Briggs. The opt levels are: 0: no optimizations, linear scan 1: some optimizations, linear scan 2: full optimizations, graph coloring (IRC or Briggs based on CPU) What we used to call optLevel=1 is not called optLevel=2, or better yet, optLevel=B3::defaultOptLevel(). We no longer have anything like the old optLevel=0 (which did no optimizations but ran graph coloring). allocateRegistersByLinearScan() faithfully implements Massimiliano Poletto and Vivek Sarkar's famous algorithm. It uses the variant that handles clobbered registers by avoiding assigning ranges to those registers if the range overlaps a clobber. It's engineered to allocate registers very quickly and generate inefficient code without falling off a cliff. The new optLevel=1 speeds up B3 by a factor of 2, and results in a 80% throughput regression. Linear scan runs 4.7x faster than graph coloring on average. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: * b3/B3CFG.h: (JSC::B3::CFG::newMap): * b3/B3Common.h: (JSC::B3::defaultOptLevel): * b3/B3Compile.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3Generate.cpp: (JSC::B3::prepareForGeneration): (JSC::B3::generateToAir): * b3/B3Generate.h: * b3/B3HeapRange.cpp: Removed. * b3/B3HeapRange.h: (JSC::B3::HeapRange::HeapRange): Deleted. (JSC::B3::HeapRange::top): Deleted. (JSC::B3::HeapRange::operator==): Deleted. (JSC::B3::HeapRange::operator!=): Deleted. (JSC::B3::HeapRange::operator|): Deleted. (JSC::B3::HeapRange::operator bool): Deleted. (JSC::B3::HeapRange::begin): Deleted. (JSC::B3::HeapRange::end): Deleted. (JSC::B3::HeapRange::overlaps): Deleted. * b3/B3LowerToAir.cpp: * b3/B3MoveConstants.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::setBlockOrderImpl): * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByLinearScan.cpp: Added. (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirAllocateRegistersByLinearScan.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::activeAt): (JSC::B3::Air::Arg::timing): (JSC::B3::Air::Arg::forEachPhase): * b3/air/AirBasicBlock.h: * b3/air/AirBlockWorklist.h: * b3/air/AirCFG.h: (JSC::B3::Air::CFG::newMap): * b3/air/AirEliminateDeadCode.cpp: (JSC::B3::Air::eliminateDeadCode): * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: (JSC::B3::Air::fixPartialRegisterStalls): * b3/air/AirFixSpillsAfterTerminals.cpp: Added. (JSC::B3::Air::fixSpillsAfterTerminals): * b3/air/AirFixSpillsAfterTerminals.h: Added. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirGenerate.h: * b3/air/AirGenerationContext.h: * b3/air/AirInsertionSet.h: * b3/air/AirInst.cpp: (JSC::B3::Air::Inst::needsPadding): * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirLowerEntrySwitch.cpp: (JSC::B3::Air::lowerEntrySwitch): * b3/air/AirOpcode.opcodes: * b3/air/AirPhaseInsertionSet.cpp: Added. (JSC::B3::Air::PhaseInsertionSet::execute): * b3/air/AirPhaseInsertionSet.h: Added. (JSC::B3::Air::PhaseInsertion::PhaseInsertion): (JSC::B3::Air::PhaseInsertion::phase): (JSC::B3::Air::PhaseInsertion::operator<): (JSC::B3::Air::PhaseInsertionSet::PhaseInsertionSet): (JSC::B3::Air::PhaseInsertionSet::appendInsertion): (JSC::B3::Air::PhaseInsertionSet::insertInst): (JSC::B3::Air::PhaseInsertionSet::insert): * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: (JSC::B3::Air::Tmp::tmpForIndex): * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::Indexed::Indexed): (JSC::B3::Air::Tmp::Indexed::index): (JSC::B3::Air::Tmp::AbsolutelyIndexed::AbsolutelyIndexed): (JSC::B3::Air::Tmp::AbsolutelyIndexed::index): (JSC::B3::Air::Tmp::indexed): (JSC::B3::Air::Tmp::absolutelyIndexed): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): * b3/testb3.cpp: (JSC::B3::compile): (JSC::B3::testMulLoadTwice): * jit/RegisterSet.h: (JSC::RegisterSet::add): (JSC::RegisterSet::remove): * runtime/Options.h: * wasm/WasmB3IRGenerator.h: Source/WTF: This change introduces a new low-latency register allocator. It can allocate registers very quickly by doing a relatively poor job. Implementing this algorithm required beefing up some of our core algorithms. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Deque.h: Make it possible to do some basic priority queueing with this data structure. (WTF::inlineCapacity>::removeAllMatching): (WTF::inlineCapacity>::appendAndBubble): (WTF::inlineCapacity>::takeLast): * wtf/IndexKeyType.h: Added. This makes it possible to use IndexMap and IndexSet with value or pointer types. Previously they just worked with pointer types. (WTF::IndexKeyType::index): * wtf/IndexMap.h: Adopt IndexKeyType. (WTF::IndexMap::operator[]): (WTF::IndexMap::append): * wtf/IndexSet.h: Adopt IndexKeyType. (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::Iterable::iterator::operator*): * wtf/Range.h: Added. This used to be B3::HeapRange. This generalizes that data structure to any kind of range stuff. (WTF::Range::Range): (WTF::Range::top): (WTF::Range::operator==): (WTF::Range::operator!=): (WTF::Range::operator bool): (WTF::Range::operator|): (WTF::Range::operator|=): (WTF::Range::begin): (WTF::Range::end): (WTF::Range::overlaps): (WTF::Range::dump): * wtf/RangeSet.h: (WTF::RangeSet::add): Tools: This makes us run a bunch of JS tests at optLevel=1 to force testing of this new compiler pipeline. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/187230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-30 22:55:44 +00:00
{
RELEASE_ASSERT(IndexKeyType<Key>::index(key) == m_vector.size());
Linear scan should run liveness only once https://bugs.webkit.org/show_bug.cgi?id=170569 Reviewed by Keith Miller. Source/JavaScriptCore: Air has a longstanding design bug that Tmps from different banks are indexed independently. This means that all of our analyses over Tmps do separate GP and FP passes. This does have some marginal benefits (the rest of the algorithm is specialized for Bank) but it's probably net bad. However, I don't want to think about solving that general problem. Instead, this just makes linear scan use a UnifiedTmpLiveness that uses a single "linear" indexing for GP and FP. This lets me avoid the much larger refactoring (which would involve substantial changes in graph coloring) while getting the bulk of the benefit (liveness runs once, instead of twice, for linear scan). This patch implements a lot of plumbing to make it possible for Liveness<> to view Tmps as having a unified indexing scheme. Tmp calls this LinearlyIndexed (to match the naming convention of AbsolutelyIndexed and Indexed), while AirLiveness calls this UnifiedTmpLiveness. With this change, -O1 never does any liveness analysis that uses separate GP and FP passes. I think this eliminates any urgency from the larger Tmp indexing bug. We can probably live with graph coloring doing separate passes. This is a ~6% speed-up for wasm -O1 compile times. I think this means that linear scan is no longer the longest pole in the tent. * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3VariableLiveness.h: (JSC::B3::VariableLivenessAdapter::prepareToCompute): * b3/air/AirAllocateRegistersByLinearScan.cpp: (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirCode.h: (JSC::B3::Air::Code::forEachTmp): * b3/air/AirLiveness.h: * b3/air/AirLivenessAdapter.h: (JSC::B3::Air::LivenessAdapter::Actions::Actions): (JSC::B3::Air::LivenessAdapter::LivenessAdapter): (JSC::B3::Air::LivenessAdapter::adapter): (JSC::B3::Air::LivenessAdapter::prepareToCompute): (JSC::B3::Air::LivenessAdapter::actionsAt): (JSC::B3::Air::LivenessAdapter::forEachUse): (JSC::B3::Air::LivenessAdapter::forEachDef): (JSC::B3::Air::TmpLivenessAdapter::numIndices): (JSC::B3::Air::UnifiedTmpLivenessAdapter::UnifiedTmpLivenessAdapter): (JSC::B3::Air::UnifiedTmpLivenessAdapter::numIndices): (JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsBank): (JSC::B3::Air::UnifiedTmpLivenessAdapter::acceptsRole): (JSC::B3::Air::UnifiedTmpLivenessAdapter::valueToIndex): (JSC::B3::Air::UnifiedTmpLivenessAdapter::indexToValue): * b3/air/AirLivenessConstraints.h: Removed. * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::LinearlyIndexed::LinearlyIndexed): (JSC::B3::Air::Tmp::LinearlyIndexed::index): (JSC::B3::Air::Tmp::linearlyIndexed): (JSC::B3::Air::Tmp::indexEnd): (JSC::B3::Air::Tmp::absoluteIndexEnd): (JSC::B3::Air::Tmp::linearIndexEnd): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): (JSC::B3::Air::Tmp::tmpForLinearIndex): * b3/air/AirTmpMap.h: Added. (JSC::B3::Air::TmpMap::TmpMap): (JSC::B3::Air::TmpMap::resize): (JSC::B3::Air::TmpMap::clear): (JSC::B3::Air::TmpMap::operator[]): (JSC::B3::Air::TmpMap::append): Source/WTF: Have Liveness<> call Adapter::prepareToCompute(), since this makes it a lot easier to implement constraint generation, since the constraint generator now gets to run after the Adapter is fully constructed. * wtf/IndexMap.h: (WTF::IndexMap::append): Also make this a bit more versatile. * wtf/Liveness.h: (WTF::Liveness::LocalCalc::Iterable::contains): (WTF::Liveness::Iterable::contains): (WTF::Liveness::compute): Canonical link: https://commits.webkit.org/187500@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-04-07 00:11:16 +00:00
m_vector.append(std::forward<PassedValue>(value));
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
}
[JSC] Speed up Air Liveness Analysis on Tmps https://bugs.webkit.org/show_bug.cgi?id=151556 Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-11-30 Reviewed by Filip Pizlo. Source/JavaScriptCore: Liveness Analysis scales poorly on large graphs like the ones generated by testComplex(). This patch introduces a faster of Liveness using the continuous indices of values instead of the values themselves. There are two main areas of improvements: 1) Reduce the cost of doing a LocalCalc over a BasicBlock. 2) Reduce how many LocalCalc are needed to converge to a solution. Most of the costs of LocalCalc are from HashSet manipulations. The HashSet operations are O(1) but the constant is large enough to be a problem. I used a similar trick as the Register Allocator to remove hashing and collision handling: the absolute value of the Tmp is used as an index into a flat array. I used Briggs's Sparse Set implementation for the local live information at each instruction. It has great properties for doing the local calculation: -No memory reallocation. -O(1) add() and remove() with a small constant. -Strict O(n) iteration. -O(1) clear(). The values Live-At-Head are now stored into a Vector. The Sparse Set is used to maintain the Tmp uniqueness. When forwarding new liveness at head to the predecessor, I start by removing everything that was already in live-at-head. We can assume that any value in that list has already been added to the predecessors. This leaves us with a small-ish number of Tmps to add to live-at-head and to the predecessors. The speed up convergence, I used the same trick as DFG's liveness: keep a set of dirty blocks to process. In practice, all the blocks without back-edges converge quickly, and we only propagate liveness as needed. This patch reduces the time taken by "testComplex(64, 384)" by another 5%. The remaining things to do for Liveness are: -Skip the first block for the fix point (it is often large and doing a local calc on it is useless). -Find a better Data Structure for live-at-tail (updating the HashSet takes > 50% of the total convergence time). * JavaScriptCore.xcodeproj/project.pbxproj: * b3/air/AirIteratedRegisterCoalescing.cpp: (JSC::B3::Air::IteratedRegisterCoalescingAllocator::build): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::getAlias): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::getAliasWhenSpilling): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::allocatedReg): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::tmpArraySize): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::initializeDegrees): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::addEdges): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::addEdge): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::makeWorkList): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::simplify): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::forEachAdjacent): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::hasBeenSimplified): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::decrementDegree): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::forEachNodeMoves): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::isMoveRelated): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::enableMovesOnValue): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::precoloredCoalescingHeuristic): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::conservativeHeuristic): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::addWorkList): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::combine): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::freezeMoves): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::selectSpill): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::assignColors): (JSC::B3::Air::IteratedRegisterCoalescingAllocator::dumpInterferenceGraphInDot): (JSC::B3::Air::iteratedRegisterCoalescingOnType): (JSC::B3::Air::iteratedRegisterCoalescing): (JSC::B3::Air::AbsoluteTmpHelper<Arg::GP>::absoluteIndex): Deleted. (JSC::B3::Air::AbsoluteTmpHelper<Arg::GP>::tmpFromAbsoluteIndex): Deleted. (JSC::B3::Air::AbsoluteTmpHelper<Arg::FP>::absoluteIndex): Deleted. (JSC::B3::Air::AbsoluteTmpHelper<Arg::FP>::tmpFromAbsoluteIndex): Deleted. * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * b3/air/AirTmpInlines.h: (JSC::B3::Air::AbsoluteTmpMapper<Arg::GP>::absoluteIndex): (JSC::B3::Air::AbsoluteTmpMapper<Arg::GP>::tmpFromAbsoluteIndex): (JSC::B3::Air::AbsoluteTmpMapper<Arg::FP>::absoluteIndex): (JSC::B3::Air::AbsoluteTmpMapper<Arg::FP>::tmpFromAbsoluteIndex): * b3/air/AirLiveness.h: Added. Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/IndexSparseSet.h: Added. (WTF::IndexSparseSet<OverflowHandler>::IndexSparseSet): (WTF::IndexSparseSet<OverflowHandler>::add): (WTF::IndexSparseSet<OverflowHandler>::remove): (WTF::IndexSparseSet<OverflowHandler>::clear): (WTF::IndexSparseSet<OverflowHandler>::size): (WTF::IndexSparseSet<OverflowHandler>::isEmpty): (WTF::IndexSparseSet<OverflowHandler>::contains): Canonical link: https://commits.webkit.org/169808@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@192851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-12-01 02:26:57 +00:00
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
private:
Air should support linear scan for optLevel<2 https://bugs.webkit.org/show_bug.cgi?id=170161 Reviewed by Saam Barati. Source/JavaScriptCore: This changes the default opt level of B3 to 2. It makes the other opt levels useful by adding a new register allocator. This new linear scan allocator will produce significantly worse code. But it will produce that code a lot faster than IRC or Briggs. The opt levels are: 0: no optimizations, linear scan 1: some optimizations, linear scan 2: full optimizations, graph coloring (IRC or Briggs based on CPU) What we used to call optLevel=1 is not called optLevel=2, or better yet, optLevel=B3::defaultOptLevel(). We no longer have anything like the old optLevel=0 (which did no optimizations but ran graph coloring). allocateRegistersByLinearScan() faithfully implements Massimiliano Poletto and Vivek Sarkar's famous algorithm. It uses the variant that handles clobbered registers by avoiding assigning ranges to those registers if the range overlaps a clobber. It's engineered to allocate registers very quickly and generate inefficient code without falling off a cliff. The new optLevel=1 speeds up B3 by a factor of 2, and results in a 80% throughput regression. Linear scan runs 4.7x faster than graph coloring on average. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: * b3/B3CFG.h: (JSC::B3::CFG::newMap): * b3/B3Common.h: (JSC::B3::defaultOptLevel): * b3/B3Compile.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: (JSC::B3::demoteValues): (JSC::B3::fixSSA): * b3/B3FixSSA.h: * b3/B3Generate.cpp: (JSC::B3::prepareForGeneration): (JSC::B3::generateToAir): * b3/B3Generate.h: * b3/B3HeapRange.cpp: Removed. * b3/B3HeapRange.h: (JSC::B3::HeapRange::HeapRange): Deleted. (JSC::B3::HeapRange::top): Deleted. (JSC::B3::HeapRange::operator==): Deleted. (JSC::B3::HeapRange::operator!=): Deleted. (JSC::B3::HeapRange::operator|): Deleted. (JSC::B3::HeapRange::operator bool): Deleted. (JSC::B3::HeapRange::begin): Deleted. (JSC::B3::HeapRange::end): Deleted. (JSC::B3::HeapRange::overlaps): Deleted. * b3/B3LowerToAir.cpp: * b3/B3MoveConstants.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.cpp: (JSC::B3::Procedure::dump): (JSC::B3::Procedure::deleteOrphans): (JSC::B3::Procedure::setBlockOrderImpl): * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateRegistersByLinearScan.cpp: Added. (JSC::B3::Air::allocateRegistersByLinearScan): * b3/air/AirAllocateRegistersByLinearScan.h: Added. * b3/air/AirAllocateStack.cpp: (JSC::B3::Air::allocateStack): * b3/air/AirArg.cpp: (WTF::printInternal): * b3/air/AirArg.h: (JSC::B3::Air::Arg::activeAt): (JSC::B3::Air::Arg::timing): (JSC::B3::Air::Arg::forEachPhase): * b3/air/AirBasicBlock.h: * b3/air/AirBlockWorklist.h: * b3/air/AirCFG.h: (JSC::B3::Air::CFG::newMap): * b3/air/AirEliminateDeadCode.cpp: (JSC::B3::Air::eliminateDeadCode): * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: (JSC::B3::Air::fixPartialRegisterStalls): * b3/air/AirFixSpillsAfterTerminals.cpp: Added. (JSC::B3::Air::fixSpillsAfterTerminals): * b3/air/AirFixSpillsAfterTerminals.h: Added. * b3/air/AirGenerate.cpp: (JSC::B3::Air::prepareForGeneration): (JSC::B3::Air::generate): * b3/air/AirGenerate.h: * b3/air/AirGenerationContext.h: * b3/air/AirInsertionSet.h: * b3/air/AirInst.cpp: (JSC::B3::Air::Inst::needsPadding): * b3/air/AirLowerAfterRegAlloc.cpp: (JSC::B3::Air::lowerAfterRegAlloc): * b3/air/AirLowerEntrySwitch.cpp: (JSC::B3::Air::lowerEntrySwitch): * b3/air/AirOpcode.opcodes: * b3/air/AirPhaseInsertionSet.cpp: Added. (JSC::B3::Air::PhaseInsertionSet::execute): * b3/air/AirPhaseInsertionSet.h: Added. (JSC::B3::Air::PhaseInsertion::PhaseInsertion): (JSC::B3::Air::PhaseInsertion::phase): (JSC::B3::Air::PhaseInsertion::operator<): (JSC::B3::Air::PhaseInsertionSet::PhaseInsertionSet): (JSC::B3::Air::PhaseInsertionSet::appendInsertion): (JSC::B3::Air::PhaseInsertionSet::insertInst): (JSC::B3::Air::PhaseInsertionSet::insert): * b3/air/AirRegLiveness.h: (JSC::B3::Air::RegLiveness::LocalCalc::LocalCalc): * b3/air/AirSpillEverything.cpp: (JSC::B3::Air::spillEverything): * b3/air/AirTmp.cpp: * b3/air/AirTmp.h: (JSC::B3::Air::Tmp::tmpForIndex): * b3/air/AirTmpInlines.h: (JSC::B3::Air::Tmp::Indexed::Indexed): (JSC::B3::Air::Tmp::Indexed::index): (JSC::B3::Air::Tmp::AbsolutelyIndexed::AbsolutelyIndexed): (JSC::B3::Air::Tmp::AbsolutelyIndexed::index): (JSC::B3::Air::Tmp::indexed): (JSC::B3::Air::Tmp::absolutelyIndexed): (JSC::B3::Air::Tmp::tmpForAbsoluteIndex): * b3/testb3.cpp: (JSC::B3::compile): (JSC::B3::testMulLoadTwice): * jit/RegisterSet.h: (JSC::RegisterSet::add): (JSC::RegisterSet::remove): * runtime/Options.h: * wasm/WasmB3IRGenerator.h: Source/WTF: This change introduces a new low-latency register allocator. It can allocate registers very quickly by doing a relatively poor job. Implementing this algorithm required beefing up some of our core algorithms. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/Deque.h: Make it possible to do some basic priority queueing with this data structure. (WTF::inlineCapacity>::removeAllMatching): (WTF::inlineCapacity>::appendAndBubble): (WTF::inlineCapacity>::takeLast): * wtf/IndexKeyType.h: Added. This makes it possible to use IndexMap and IndexSet with value or pointer types. Previously they just worked with pointer types. (WTF::IndexKeyType::index): * wtf/IndexMap.h: Adopt IndexKeyType. (WTF::IndexMap::operator[]): (WTF::IndexMap::append): * wtf/IndexSet.h: Adopt IndexKeyType. (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::Iterable::iterator::operator*): * wtf/Range.h: Added. This used to be B3::HeapRange. This generalizes that data structure to any kind of range stuff. (WTF::Range::Range): (WTF::Range::top): (WTF::Range::operator==): (WTF::Range::operator!=): (WTF::Range::operator bool): (WTF::Range::operator|): (WTF::Range::operator|=): (WTF::Range::begin): (WTF::Range::end): (WTF::Range::overlaps): (WTF::Range::dump): * wtf/RangeSet.h: (WTF::RangeSet::add): Tools: This makes us run a bunch of JS tests at optLevel=1 to force testing of this new compiler pipeline. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/187230@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214636 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-03-30 22:55:44 +00:00
Vector<Value, 0, UnsafeVectorOverflow> m_vector;
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
};
[JSC] Move generic data structures out of B3 https://bugs.webkit.org/show_bug.cgi?id=161155 Reviewed by Saam Barati. Source/JavaScriptCore: Move B3's good generic data structures to WTF. They can be used for the other kind of basic blocks and nodes. For example, the generator patch[1] will make BytecodeBasicBlock usable with these structures. [1]: https://bugs.webkit.org/show_bug.cgi?id=152723 * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: * b3/B3BlockWorklist.h: * b3/B3CFG.h: * b3/B3DuplicateTails.cpp: * b3/B3FixSSA.cpp: * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::IndexMap): Deleted. (JSC::B3::IndexMap::resize): Deleted. (JSC::B3::IndexMap::clear): Deleted. (JSC::B3::IndexMap::size): Deleted. (JSC::B3::IndexMap::operator[]): Deleted. * b3/B3IndexSet.h: (JSC::B3::IndexSet::IndexSet): Deleted. (JSC::B3::IndexSet::add): Deleted. (JSC::B3::IndexSet::addAll): Deleted. (JSC::B3::IndexSet::remove): Deleted. (JSC::B3::IndexSet::contains): Deleted. (JSC::B3::IndexSet::size): Deleted. (JSC::B3::IndexSet::isEmpty): Deleted. (JSC::B3::IndexSet::Iterable::Iterable): Deleted. (JSC::B3::IndexSet::Iterable::iterator::iterator): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator*): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator++): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator==): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator!=): Deleted. (JSC::B3::IndexSet::Iterable::begin): Deleted. (JSC::B3::IndexSet::Iterable::end): Deleted. (JSC::B3::IndexSet::values): Deleted. (JSC::B3::IndexSet::indices): Deleted. (JSC::B3::IndexSet::dump): Deleted. * b3/B3LowerToAir.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.h: (JSC::B3::Procedure::iterator::iterator): Deleted. (JSC::B3::Procedure::iterator::operator*): Deleted. (JSC::B3::Procedure::iterator::operator++): Deleted. (JSC::B3::Procedure::iterator::operator==): Deleted. (JSC::B3::Procedure::iterator::operator!=): Deleted. (JSC::B3::Procedure::iterator::findNext): Deleted. * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirCode.h: * b3/air/AirEliminateDeadCode.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: * b3/air/AirGenerate.cpp: * b3/air/AirGenerationContext.h: * b3/air/AirLiveness.h: * b3/air/AirSpillEverything.cpp: Source/WTF: Add IndexSet, IndexMap, and IndexedContainerIterator. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/IndexMap.h: Copied from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): (WTF::IndexMap::size): (WTF::IndexMap::operator[]): * wtf/IndexSet.h: Renamed from Source/JavaScriptCore/b3/B3IndexSet.h. (WTF::IndexSet::IndexSet): (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::size): (WTF::IndexSet::isEmpty): (WTF::IndexSet::Iterable::Iterable): (WTF::IndexSet::Iterable::iterator::iterator): (WTF::IndexSet::Iterable::iterator::operator*): (WTF::IndexSet::Iterable::iterator::operator++): (WTF::IndexSet::Iterable::iterator::operator==): (WTF::IndexSet::Iterable::iterator::operator!=): (WTF::IndexSet::Iterable::begin): (WTF::IndexSet::Iterable::end): (WTF::IndexSet::values): (WTF::IndexSet::indices): (WTF::IndexSet::dump): * wtf/IndexedContainerIterator.h: Renamed from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexedContainerIterator::IndexedContainerIterator): (WTF::IndexedContainerIterator::operator++): (WTF::IndexedContainerIterator::operator==): (WTF::IndexedContainerIterator::operator!=): (WTF::IndexedContainerIterator::findNext): Canonical link: https://commits.webkit.org/179305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-24 19:35:41 +00:00
} // namespace WTF
Create a super rough prototype of B3 https://bugs.webkit.org/show_bug.cgi?id=150280 Reviewed by Benjamin Poulain. Source/JavaScriptCore: This changeset adds the basic scaffolding of the B3 compiler. B3 stands for Bare Bones Backend. It's a low-level SSA-based language-agnostic compiler. The basic structure allows for aggressive C-level optimizations and an awesome portable backend. The backend, called Air (Assembly IR), is a reflective abstraction over our MacroAssembler. The abstraction is defined using a spec file (AirOpcode.opcodes) which describes the various kinds of instructions that we wish to support. Then, the B3::LowerToAir phase, which does our instruction selection, reflectively selects Air opcodes by querying which instruction forms are possible. Air allows for optimal register allocation and stack layout. Currently the register allocator isn't written, but the stack layout is. Of course this isn't done yet. It can only compile simple programs, seen in the "test suite" called "testb3.cpp". There's a lot of optimizations that have to be written and a lot of stuff added to the instruction selector. But it's a neat start. * CMakeLists.txt: * DerivedSources.make: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.cpp: (WTF::printInternal): * assembler/MacroAssembler.h: * b3: Added. * b3/B3AddressMatcher.patterns: Added. * b3/B3ArgumentRegValue.cpp: Added. (JSC::B3::ArgumentRegValue::~ArgumentRegValue): (JSC::B3::ArgumentRegValue::dumpMeta): * b3/B3ArgumentRegValue.h: Added. * b3/B3BasicBlock.cpp: Added. (JSC::B3::BasicBlock::BasicBlock): (JSC::B3::BasicBlock::~BasicBlock): (JSC::B3::BasicBlock::append): (JSC::B3::BasicBlock::addPredecessor): (JSC::B3::BasicBlock::removePredecessor): (JSC::B3::BasicBlock::replacePredecessor): (JSC::B3::BasicBlock::removeNops): (JSC::B3::BasicBlock::dump): (JSC::B3::BasicBlock::deepDump): * b3/B3BasicBlock.h: Added. (JSC::B3::BasicBlock::index): (JSC::B3::BasicBlock::begin): (JSC::B3::BasicBlock::end): (JSC::B3::BasicBlock::size): (JSC::B3::BasicBlock::at): (JSC::B3::BasicBlock::last): (JSC::B3::BasicBlock::values): (JSC::B3::BasicBlock::numPredecessors): (JSC::B3::BasicBlock::predecessor): (JSC::B3::BasicBlock::predecessors): (JSC::B3::BasicBlock::frequency): (JSC::B3::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::DeepBasicBlockDump::dump): (JSC::B3::deepDump): * b3/B3BasicBlockInlines.h: Added. (JSC::B3::BasicBlock::appendNew): (JSC::B3::BasicBlock::numSuccessors): (JSC::B3::BasicBlock::successor): (JSC::B3::BasicBlock::successors): (JSC::B3::BasicBlock::successorBlock): (JSC::B3::BasicBlock::successorBlocks): * b3/B3BasicBlockUtils.h: Added. (JSC::B3::addPredecessor): (JSC::B3::removePredecessor): (JSC::B3::replacePredecessor): (JSC::B3::resetReachability): (JSC::B3::blocksInPreOrder): (JSC::B3::blocksInPostOrder): * b3/B3BlockWorklist.h: Added. * b3/B3CheckSpecial.cpp: Added. (JSC::B3::Air::numB3Args): (JSC::B3::CheckSpecial::CheckSpecial): (JSC::B3::CheckSpecial::~CheckSpecial): (JSC::B3::CheckSpecial::hiddenBranch): (JSC::B3::CheckSpecial::forEachArg): (JSC::B3::CheckSpecial::isValid): (JSC::B3::CheckSpecial::admitsStack): (JSC::B3::CheckSpecial::generate): (JSC::B3::CheckSpecial::dumpImpl): (JSC::B3::CheckSpecial::deepDumpImpl): * b3/B3CheckSpecial.h: Added. * b3/B3CheckValue.cpp: Added. (JSC::B3::CheckValue::~CheckValue): (JSC::B3::CheckValue::dumpMeta): * b3/B3CheckValue.h: Added. * b3/B3Common.cpp: Added. (JSC::B3::shouldDumpIR): (JSC::B3::shouldDumpIRAtEachPhase): (JSC::B3::shouldValidateIR): (JSC::B3::shouldValidateIRAtEachPhase): (JSC::B3::shouldSaveIRBeforePhase): * b3/B3Common.h: Added. (JSC::B3::is64Bit): (JSC::B3::is32Bit): * b3/B3Commutativity.cpp: Added. (WTF::printInternal): * b3/B3Commutativity.h: Added. * b3/B3Const32Value.cpp: Added. (JSC::B3::Const32Value::~Const32Value): (JSC::B3::Const32Value::negConstant): (JSC::B3::Const32Value::addConstant): (JSC::B3::Const32Value::subConstant): (JSC::B3::Const32Value::dumpMeta): * b3/B3Const32Value.h: Added. * b3/B3Const64Value.cpp: Added. (JSC::B3::Const64Value::~Const64Value): (JSC::B3::Const64Value::negConstant): (JSC::B3::Const64Value::addConstant): (JSC::B3::Const64Value::subConstant): (JSC::B3::Const64Value::dumpMeta): * b3/B3Const64Value.h: Added. * b3/B3ConstDoubleValue.cpp: Added. (JSC::B3::ConstDoubleValue::~ConstDoubleValue): (JSC::B3::ConstDoubleValue::negConstant): (JSC::B3::ConstDoubleValue::addConstant): (JSC::B3::ConstDoubleValue::subConstant): (JSC::B3::ConstDoubleValue::dumpMeta): * b3/B3ConstDoubleValue.h: Added. (JSC::B3::ConstDoubleValue::accepts): (JSC::B3::ConstDoubleValue::value): (JSC::B3::ConstDoubleValue::ConstDoubleValue): * b3/B3ConstPtrValue.h: Added. (JSC::B3::ConstPtrValue::value): (JSC::B3::ConstPtrValue::ConstPtrValue): * b3/B3ControlValue.cpp: Added. (JSC::B3::ControlValue::~ControlValue): (JSC::B3::ControlValue::dumpMeta): * b3/B3ControlValue.h: Added. * b3/B3Effects.cpp: Added. (JSC::B3::Effects::dump): * b3/B3Effects.h: Added. (JSC::B3::Effects::mustExecute): * b3/B3FrequencyClass.cpp: Added. (WTF::printInternal): * b3/B3FrequencyClass.h: Added. * b3/B3FrequentedBlock.h: Added. * b3/B3Generate.cpp: Added. (JSC::B3::generate): (JSC::B3::generateToAir): * b3/B3Generate.h: Added. * b3/B3GenericFrequentedBlock.h: Added. (JSC::B3::GenericFrequentedBlock::GenericFrequentedBlock): (JSC::B3::GenericFrequentedBlock::operator==): (JSC::B3::GenericFrequentedBlock::operator!=): (JSC::B3::GenericFrequentedBlock::operator bool): (JSC::B3::GenericFrequentedBlock::block): (JSC::B3::GenericFrequentedBlock::frequency): (JSC::B3::GenericFrequentedBlock::dump): * b3/B3HeapRange.cpp: Added. (JSC::B3::HeapRange::dump): * b3/B3HeapRange.h: Added. (JSC::B3::HeapRange::HeapRange): (JSC::B3::HeapRange::top): (JSC::B3::HeapRange::operator==): (JSC::B3::HeapRange::operator!=): (JSC::B3::HeapRange::operator bool): (JSC::B3::HeapRange::begin): (JSC::B3::HeapRange::end): (JSC::B3::HeapRange::overlaps): * b3/B3IndexMap.h: Added. (JSC::B3::IndexMap::IndexMap): (JSC::B3::IndexMap::resize): (JSC::B3::IndexMap::operator[]): * b3/B3IndexSet.h: Added. (JSC::B3::IndexSet::IndexSet): (JSC::B3::IndexSet::add): (JSC::B3::IndexSet::contains): (JSC::B3::IndexSet::Iterable::Iterable): (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::iterator::operator*): (JSC::B3::IndexSet::Iterable::iterator::operator++): (JSC::B3::IndexSet::Iterable::iterator::operator==): (JSC::B3::IndexSet::Iterable::iterator::operator!=): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::Iterable::end): (JSC::B3::IndexSet::values): (JSC::B3::IndexSet::indices): (JSC::B3::IndexSet::dump): * b3/B3InsertionSet.cpp: Added. (JSC::B3::InsertionSet::execute): * b3/B3InsertionSet.h: Added. (JSC::B3::InsertionSet::InsertionSet): (JSC::B3::InsertionSet::code): (JSC::B3::InsertionSet::appendInsertion): (JSC::B3::InsertionSet::insertValue): * b3/B3InsertionSetInlines.h: Added. (JSC::B3::InsertionSet::insert): * b3/B3LowerToAir.cpp: Added. (JSC::B3::Air::LowerToAir::LowerToAir): (JSC::B3::Air::LowerToAir::run): (JSC::B3::Air::LowerToAir::tmp): (JSC::B3::Air::LowerToAir::effectiveAddr): (JSC::B3::Air::LowerToAir::addr): (JSC::B3::Air::LowerToAir::loadAddr): (JSC::B3::Air::LowerToAir::imm): (JSC::B3::Air::LowerToAir::immOrTmp): (JSC::B3::Air::LowerToAir::appendBinOp): (JSC::B3::Air::LowerToAir::tryAppendStoreBinOp): (JSC::B3::Air::LowerToAir::moveForType): (JSC::B3::Air::LowerToAir::relaxedMoveForType): (JSC::B3::Air::LowerToAir::append): (JSC::B3::Air::LowerToAir::AddressSelector::AddressSelector): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRoot): (JSC::B3::Air::LowerToAir::AddressSelector::acceptRootLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternals): (JSC::B3::Air::LowerToAir::AddressSelector::acceptInternalsLate): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperands): (JSC::B3::Air::LowerToAir::AddressSelector::acceptOperandsLate): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift1): (JSC::B3::Air::LowerToAir::AddressSelector::tryAddShift2): (JSC::B3::Air::LowerToAir::AddressSelector::tryAdd): (JSC::B3::Air::LowerToAir::AddressSelector::tryDirect): (JSC::B3::Air::LowerToAir::acceptRoot): (JSC::B3::Air::LowerToAir::acceptRootLate): (JSC::B3::Air::LowerToAir::acceptInternals): (JSC::B3::Air::LowerToAir::acceptInternalsLate): (JSC::B3::Air::LowerToAir::acceptOperands): (JSC::B3::Air::LowerToAir::acceptOperandsLate): (JSC::B3::Air::LowerToAir::tryLoad): (JSC::B3::Air::LowerToAir::tryAdd): (JSC::B3::Air::LowerToAir::tryAnd): (JSC::B3::Air::LowerToAir::tryStoreAddLoad): (JSC::B3::Air::LowerToAir::tryStoreAndLoad): (JSC::B3::Air::LowerToAir::tryStore): (JSC::B3::Air::LowerToAir::tryTruncArgumentReg): (JSC::B3::Air::LowerToAir::tryTrunc): (JSC::B3::Air::LowerToAir::tryArgumentReg): (JSC::B3::Air::LowerToAir::tryConst32): (JSC::B3::Air::LowerToAir::tryConst64): (JSC::B3::Air::LowerToAir::tryIdentity): (JSC::B3::Air::LowerToAir::tryReturn): (JSC::B3::lowerToAir): * b3/B3LowerToAir.h: Added. * b3/B3LoweringMatcher.patterns: Added. * b3/B3MemoryValue.cpp: Added. (JSC::B3::MemoryValue::~MemoryValue): (JSC::B3::MemoryValue::dumpMeta): * b3/B3MemoryValue.h: Added. * b3/B3Opcode.cpp: Added. (WTF::printInternal): * b3/B3Opcode.h: Added. (JSC::B3::isCheckMath): * b3/B3Origin.cpp: Added. (JSC::B3::Origin::dump): * b3/B3Origin.h: Added. (JSC::B3::Origin::Origin): (JSC::B3::Origin::operator bool): (JSC::B3::Origin::data): * b3/B3PatchpointSpecial.cpp: Added. (JSC::B3::PatchpointSpecial::PatchpointSpecial): (JSC::B3::PatchpointSpecial::~PatchpointSpecial): (JSC::B3::PatchpointSpecial::forEachArg): (JSC::B3::PatchpointSpecial::isValid): (JSC::B3::PatchpointSpecial::admitsStack): (JSC::B3::PatchpointSpecial::generate): (JSC::B3::PatchpointSpecial::dumpImpl): (JSC::B3::PatchpointSpecial::deepDumpImpl): * b3/B3PatchpointSpecial.h: Added. * b3/B3PatchpointValue.cpp: Added. (JSC::B3::PatchpointValue::~PatchpointValue): (JSC::B3::PatchpointValue::dumpMeta): * b3/B3PatchpointValue.h: Added. (JSC::B3::PatchpointValue::accepts): (JSC::B3::PatchpointValue::PatchpointValue): * b3/B3PhaseScope.cpp: Added. (JSC::B3::PhaseScope::PhaseScope): (JSC::B3::PhaseScope::~PhaseScope): * b3/B3PhaseScope.h: Added. * b3/B3Procedure.cpp: Added. (JSC::B3::Procedure::Procedure): (JSC::B3::Procedure::~Procedure): (JSC::B3::Procedure::addBlock): (JSC::B3::Procedure::resetReachability): (JSC::B3::Procedure::dump): (JSC::B3::Procedure::blocksInPreOrder): (JSC::B3::Procedure::blocksInPostOrder): * b3/B3Procedure.h: Added. (JSC::B3::Procedure::size): (JSC::B3::Procedure::at): (JSC::B3::Procedure::operator[]): (JSC::B3::Procedure::iterator::iterator): (JSC::B3::Procedure::iterator::operator*): (JSC::B3::Procedure::iterator::operator++): (JSC::B3::Procedure::iterator::operator==): (JSC::B3::Procedure::iterator::operator!=): (JSC::B3::Procedure::iterator::findNext): (JSC::B3::Procedure::begin): (JSC::B3::Procedure::end): (JSC::B3::Procedure::ValuesCollection::ValuesCollection): (JSC::B3::Procedure::ValuesCollection::iterator::iterator): (JSC::B3::Procedure::ValuesCollection::iterator::operator*): (JSC::B3::Procedure::ValuesCollection::iterator::operator++): (JSC::B3::Procedure::ValuesCollection::iterator::operator==): (JSC::B3::Procedure::ValuesCollection::iterator::operator!=): (JSC::B3::Procedure::ValuesCollection::begin): (JSC::B3::Procedure::ValuesCollection::end): (JSC::B3::Procedure::ValuesCollection::size): (JSC::B3::Procedure::ValuesCollection::at): (JSC::B3::Procedure::ValuesCollection::operator[]): (JSC::B3::Procedure::values): (JSC::B3::Procedure::setLastPhaseName): (JSC::B3::Procedure::lastPhaseName): * b3/B3ProcedureInlines.h: Added. (JSC::B3::Procedure::add): * b3/B3ReduceStrength.cpp: Added. (JSC::B3::reduceStrength): * b3/B3ReduceStrength.h: Added. * b3/B3StackSlotKind.cpp: Added. (WTF::printInternal): * b3/B3StackSlotKind.h: Added. * b3/B3StackSlotValue.cpp: Added. (JSC::B3::StackSlotValue::~StackSlotValue): (JSC::B3::StackSlotValue::dumpMeta): * b3/B3StackSlotValue.h: Added. (JSC::B3::StackSlotValue::accepts): (JSC::B3::StackSlotValue::byteSize): (JSC::B3::StackSlotValue::kind): (JSC::B3::StackSlotValue::offsetFromFP): (JSC::B3::StackSlotValue::setOffsetFromFP): (JSC::B3::StackSlotValue::StackSlotValue): * b3/B3Stackmap.cpp: Added. (JSC::B3::Stackmap::Stackmap): (JSC::B3::Stackmap::~Stackmap): (JSC::B3::Stackmap::dump): * b3/B3Stackmap.h: Added. (JSC::B3::Stackmap::constrain): (JSC::B3::Stackmap::reps): (JSC::B3::Stackmap::clobber): (JSC::B3::Stackmap::clobbered): (JSC::B3::Stackmap::setGenerator): * b3/B3StackmapSpecial.cpp: Added. (JSC::B3::StackmapSpecial::StackmapSpecial): (JSC::B3::StackmapSpecial::~StackmapSpecial): (JSC::B3::StackmapSpecial::reportUsedRegisters): (JSC::B3::StackmapSpecial::extraClobberedRegs): (JSC::B3::StackmapSpecial::forEachArgImpl): (JSC::B3::StackmapSpecial::isValidImpl): (JSC::B3::StackmapSpecial::admitsStackImpl): (JSC::B3::StackmapSpecial::appendRepsImpl): (JSC::B3::StackmapSpecial::repForArg): * b3/B3StackmapSpecial.h: Added. * b3/B3SuccessorCollection.h: Added. (JSC::B3::SuccessorCollection::SuccessorCollection): (JSC::B3::SuccessorCollection::size): (JSC::B3::SuccessorCollection::at): (JSC::B3::SuccessorCollection::operator[]): (JSC::B3::SuccessorCollection::iterator::iterator): (JSC::B3::SuccessorCollection::iterator::operator*): (JSC::B3::SuccessorCollection::iterator::operator++): (JSC::B3::SuccessorCollection::iterator::operator==): (JSC::B3::SuccessorCollection::iterator::operator!=): (JSC::B3::SuccessorCollection::begin): (JSC::B3::SuccessorCollection::end): * b3/B3SwitchCase.cpp: Added. (JSC::B3::SwitchCase::dump): * b3/B3SwitchCase.h: Added. (JSC::B3::SwitchCase::SwitchCase): (JSC::B3::SwitchCase::operator bool): (JSC::B3::SwitchCase::caseValue): (JSC::B3::SwitchCase::target): (JSC::B3::SwitchCase::targetBlock): * b3/B3SwitchValue.cpp: Added. (JSC::B3::SwitchValue::~SwitchValue): (JSC::B3::SwitchValue::removeCase): (JSC::B3::SwitchValue::appendCase): (JSC::B3::SwitchValue::dumpMeta): (JSC::B3::SwitchValue::SwitchValue): * b3/B3SwitchValue.h: Added. (JSC::B3::SwitchValue::accepts): (JSC::B3::SwitchValue::numCaseValues): (JSC::B3::SwitchValue::caseValue): (JSC::B3::SwitchValue::caseValues): (JSC::B3::SwitchValue::fallThrough): (JSC::B3::SwitchValue::size): (JSC::B3::SwitchValue::at): (JSC::B3::SwitchValue::operator[]): (JSC::B3::SwitchValue::iterator::iterator): (JSC::B3::SwitchValue::iterator::operator*): (JSC::B3::SwitchValue::iterator::operator++): (JSC::B3::SwitchValue::iterator::operator==): (JSC::B3::SwitchValue::iterator::operator!=): (JSC::B3::SwitchValue::begin): (JSC::B3::SwitchValue::end): * b3/B3Type.cpp: Added. (WTF::printInternal): * b3/B3Type.h: Added. (JSC::B3::isInt): (JSC::B3::isFloat): (JSC::B3::pointerType): * b3/B3UpsilonValue.cpp: Added. (JSC::B3::UpsilonValue::~UpsilonValue): (JSC::B3::UpsilonValue::dumpMeta): * b3/B3UpsilonValue.h: Added. (JSC::B3::UpsilonValue::accepts): (JSC::B3::UpsilonValue::phi): (JSC::B3::UpsilonValue::UpsilonValue): * b3/B3UseCounts.cpp: Added. (JSC::B3::UseCounts::UseCounts): (JSC::B3::UseCounts::~UseCounts): * b3/B3UseCounts.h: Added. (JSC::B3::UseCounts::operator[]): * b3/B3Validate.cpp: Added. (JSC::B3::validate): * b3/B3Validate.h: Added. * b3/B3Value.cpp: Added. (JSC::B3::Value::~Value): (JSC::B3::Value::replaceWithIdentity): (JSC::B3::Value::replaceWithNop): (JSC::B3::Value::dump): (JSC::B3::Value::deepDump): (JSC::B3::Value::negConstant): (JSC::B3::Value::addConstant): (JSC::B3::Value::subConstant): (JSC::B3::Value::effects): (JSC::B3::Value::performSubstitution): (JSC::B3::Value::dumpMeta): (JSC::B3::Value::typeFor): * b3/B3Value.h: Added. (JSC::B3::DeepValueDump::DeepValueDump): (JSC::B3::DeepValueDump::dump): (JSC::B3::deepDump): * b3/B3ValueInlines.h: Added. (JSC::B3::Value::as): (JSC::B3::Value::isConstant): (JSC::B3::Value::hasInt32): (JSC::B3::Value::asInt32): (JSC::B3::Value::hasInt64): (JSC::B3::Value::asInt64): (JSC::B3::Value::hasInt): (JSC::B3::Value::asInt): (JSC::B3::Value::isInt): (JSC::B3::Value::hasIntPtr): (JSC::B3::Value::asIntPtr): (JSC::B3::Value::hasDouble): (JSC::B3::Value::asDouble): (JSC::B3::Value::stackmap): * b3/B3ValueRep.cpp: Added. (JSC::B3::ValueRep::dump): (WTF::printInternal): * b3/B3ValueRep.h: Added. (JSC::B3::ValueRep::ValueRep): (JSC::B3::ValueRep::reg): (JSC::B3::ValueRep::stack): (JSC::B3::ValueRep::stackArgument): (JSC::B3::ValueRep::constant): (JSC::B3::ValueRep::constantDouble): (JSC::B3::ValueRep::kind): (JSC::B3::ValueRep::operator bool): (JSC::B3::ValueRep::offsetFromFP): (JSC::B3::ValueRep::offsetFromSP): (JSC::B3::ValueRep::value): (JSC::B3::ValueRep::doubleValue): * b3/air: Added. * b3/air/AirAllocateStack.cpp: Added. (JSC::B3::Air::allocateStack): * b3/air/AirAllocateStack.h: Added. * b3/air/AirArg.cpp: Added. (JSC::B3::Air::Arg::dump): * b3/air/AirArg.h: Added. (JSC::B3::Air::Arg::isUse): (JSC::B3::Air::Arg::isDef): (JSC::B3::Air::Arg::typeForB3Type): (JSC::B3::Air::Arg::Arg): (JSC::B3::Air::Arg::imm): (JSC::B3::Air::Arg::imm64): (JSC::B3::Air::Arg::addr): (JSC::B3::Air::Arg::stack): (JSC::B3::Air::Arg::callArg): (JSC::B3::Air::Arg::isValidScale): (JSC::B3::Air::Arg::logScale): (JSC::B3::Air::Arg::index): (JSC::B3::Air::Arg::relCond): (JSC::B3::Air::Arg::resCond): (JSC::B3::Air::Arg::special): (JSC::B3::Air::Arg::operator==): (JSC::B3::Air::Arg::operator!=): (JSC::B3::Air::Arg::operator bool): (JSC::B3::Air::Arg::kind): (JSC::B3::Air::Arg::isTmp): (JSC::B3::Air::Arg::isImm): (JSC::B3::Air::Arg::isImm64): (JSC::B3::Air::Arg::isAddr): (JSC::B3::Air::Arg::isStack): (JSC::B3::Air::Arg::isCallArg): (JSC::B3::Air::Arg::isIndex): (JSC::B3::Air::Arg::isRelCond): (JSC::B3::Air::Arg::isResCond): (JSC::B3::Air::Arg::isSpecial): (JSC::B3::Air::Arg::isAlive): (JSC::B3::Air::Arg::tmp): (JSC::B3::Air::Arg::value): (JSC::B3::Air::Arg::pointerValue): (JSC::B3::Air::Arg::base): (JSC::B3::Air::Arg::hasOffset): (JSC::B3::Air::Arg::offset): (JSC::B3::Air::Arg::stackSlot): (JSC::B3::Air::Arg::scale): (JSC::B3::Air::Arg::isGPTmp): (JSC::B3::Air::Arg::isFPTmp): (JSC::B3::Air::Arg::isGP): (JSC::B3::Air::Arg::isFP): (JSC::B3::Air::Arg::hasType): (JSC::B3::Air::Arg::type): (JSC::B3::Air::Arg::isType): (JSC::B3::Air::Arg::isGPR): (JSC::B3::Air::Arg::gpr): (JSC::B3::Air::Arg::isFPR): (JSC::B3::Air::Arg::fpr): (JSC::B3::Air::Arg::isReg): (JSC::B3::Air::Arg::reg): (JSC::B3::Air::Arg::gpTmpIndex): (JSC::B3::Air::Arg::fpTmpIndex): (JSC::B3::Air::Arg::tmpIndex): (JSC::B3::Air::Arg::withOffset): (JSC::B3::Air::Arg::forEachTmpFast): (JSC::B3::Air::Arg::forEachTmp): (JSC::B3::Air::Arg::asTrustedImm32): (JSC::B3::Air::Arg::asTrustedImm64): (JSC::B3::Air::Arg::asTrustedImmPtr): (JSC::B3::Air::Arg::asAddress): (JSC::B3::Air::Arg::asBaseIndex): (JSC::B3::Air::Arg::asRelationalCondition): (JSC::B3::Air::Arg::asResultCondition): (JSC::B3::Air::Arg::isHashTableDeletedValue): (JSC::B3::Air::Arg::hash): (JSC::B3::Air::ArgHash::hash): (JSC::B3::Air::ArgHash::equal): * b3/air/AirBasicBlock.cpp: Added. (JSC::B3::Air::BasicBlock::addPredecessor): (JSC::B3::Air::BasicBlock::removePredecessor): (JSC::B3::Air::BasicBlock::replacePredecessor): (JSC::B3::Air::BasicBlock::dump): (JSC::B3::Air::BasicBlock::deepDump): (JSC::B3::Air::BasicBlock::BasicBlock): * b3/air/AirBasicBlock.h: Added. (JSC::B3::Air::BasicBlock::index): (JSC::B3::Air::BasicBlock::size): (JSC::B3::Air::BasicBlock::begin): (JSC::B3::Air::BasicBlock::end): (JSC::B3::Air::BasicBlock::at): (JSC::B3::Air::BasicBlock::last): (JSC::B3::Air::BasicBlock::appendInst): (JSC::B3::Air::BasicBlock::append): (JSC::B3::Air::BasicBlock::numSuccessors): (JSC::B3::Air::BasicBlock::successor): (JSC::B3::Air::BasicBlock::successors): (JSC::B3::Air::BasicBlock::successorBlock): (JSC::B3::Air::BasicBlock::successorBlocks): (JSC::B3::Air::BasicBlock::numPredecessors): (JSC::B3::Air::BasicBlock::predecessor): (JSC::B3::Air::BasicBlock::predecessors): (JSC::B3::Air::DeepBasicBlockDump::DeepBasicBlockDump): (JSC::B3::Air::DeepBasicBlockDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirCCallSpecial.cpp: Added. (JSC::B3::Air::CCallSpecial::CCallSpecial): (JSC::B3::Air::CCallSpecial::~CCallSpecial): (JSC::B3::Air::CCallSpecial::forEachArg): (JSC::B3::Air::CCallSpecial::isValid): (JSC::B3::Air::CCallSpecial::admitsStack): (JSC::B3::Air::CCallSpecial::reportUsedRegisters): (JSC::B3::Air::CCallSpecial::generate): (JSC::B3::Air::CCallSpecial::extraClobberedRegs): (JSC::B3::Air::CCallSpecial::dumpImpl): (JSC::B3::Air::CCallSpecial::deepDumpImpl): * b3/air/AirCCallSpecial.h: Added. * b3/air/AirCode.cpp: Added. (JSC::B3::Air::Code::Code): (JSC::B3::Air::Code::~Code): (JSC::B3::Air::Code::addBlock): (JSC::B3::Air::Code::addStackSlot): (JSC::B3::Air::Code::addSpecial): (JSC::B3::Air::Code::cCallSpecial): (JSC::B3::Air::Code::resetReachability): (JSC::B3::Air::Code::dump): (JSC::B3::Air::Code::findFirstBlockIndex): (JSC::B3::Air::Code::findNextBlockIndex): (JSC::B3::Air::Code::findNextBlock): * b3/air/AirCode.h: Added. (JSC::B3::Air::Code::newTmp): (JSC::B3::Air::Code::numTmps): (JSC::B3::Air::Code::callArgAreaSize): (JSC::B3::Air::Code::requestCallArgAreaSize): (JSC::B3::Air::Code::frameSize): (JSC::B3::Air::Code::setFrameSize): (JSC::B3::Air::Code::calleeSaveRegisters): (JSC::B3::Air::Code::size): (JSC::B3::Air::Code::at): (JSC::B3::Air::Code::operator[]): (JSC::B3::Air::Code::iterator::iterator): (JSC::B3::Air::Code::iterator::operator*): (JSC::B3::Air::Code::iterator::operator++): (JSC::B3::Air::Code::iterator::operator==): (JSC::B3::Air::Code::iterator::operator!=): (JSC::B3::Air::Code::begin): (JSC::B3::Air::Code::end): (JSC::B3::Air::Code::StackSlotsCollection::StackSlotsCollection): (JSC::B3::Air::Code::StackSlotsCollection::size): (JSC::B3::Air::Code::StackSlotsCollection::at): (JSC::B3::Air::Code::StackSlotsCollection::operator[]): (JSC::B3::Air::Code::StackSlotsCollection::iterator::iterator): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator*): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator++): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator==): (JSC::B3::Air::Code::StackSlotsCollection::iterator::operator!=): (JSC::B3::Air::Code::StackSlotsCollection::begin): (JSC::B3::Air::Code::StackSlotsCollection::end): (JSC::B3::Air::Code::stackSlots): (JSC::B3::Air::Code::SpecialsCollection::SpecialsCollection): (JSC::B3::Air::Code::SpecialsCollection::size): (JSC::B3::Air::Code::SpecialsCollection::at): (JSC::B3::Air::Code::SpecialsCollection::operator[]): (JSC::B3::Air::Code::SpecialsCollection::iterator::iterator): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator*): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator++): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator==): (JSC::B3::Air::Code::SpecialsCollection::iterator::operator!=): (JSC::B3::Air::Code::SpecialsCollection::begin): (JSC::B3::Air::Code::SpecialsCollection::end): (JSC::B3::Air::Code::specials): (JSC::B3::Air::Code::setLastPhaseName): (JSC::B3::Air::Code::lastPhaseName): * b3/air/AirFrequentedBlock.h: Added. * b3/air/AirGenerate.cpp: Added. (JSC::B3::Air::generate): * b3/air/AirGenerate.h: Added. * b3/air/AirGenerated.cpp: Added. * b3/air/AirGenerationContext.h: Added. * b3/air/AirHandleCalleeSaves.cpp: Added. (JSC::B3::Air::handleCalleeSaves): * b3/air/AirHandleCalleeSaves.h: Added. * b3/air/AirInsertionSet.cpp: Added. (JSC::B3::Air::InsertionSet::execute): * b3/air/AirInsertionSet.h: Added. (JSC::B3::Air::InsertionSet::InsertionSet): (JSC::B3::Air::InsertionSet::code): (JSC::B3::Air::InsertionSet::appendInsertion): (JSC::B3::Air::InsertionSet::insertInst): (JSC::B3::Air::InsertionSet::insert): * b3/air/AirInst.cpp: Added. (JSC::B3::Air::Inst::dump): * b3/air/AirInst.h: Added. (JSC::B3::Air::Inst::Inst): (JSC::B3::Air::Inst::opcode): (JSC::B3::Air::Inst::forEachTmpFast): (JSC::B3::Air::Inst::forEachTmp): * b3/air/AirInstInlines.h: Added. (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::Inst::forEach): (JSC::B3::Air::Inst::hasSpecial): (JSC::B3::Air::Inst::extraClobberedRegs): (JSC::B3::Air::Inst::reportUsedRegisters): (JSC::B3::Air::isShiftValid): (JSC::B3::Air::isLshift32Valid): * b3/air/AirLiveness.h: Added. (JSC::B3::Air::Liveness::Liveness): (JSC::B3::Air::Liveness::liveAtHead): (JSC::B3::Air::Liveness::liveAtTail): (JSC::B3::Air::Liveness::LocalCalc::LocalCalc): (JSC::B3::Air::Liveness::LocalCalc::live): (JSC::B3::Air::Liveness::LocalCalc::takeLive): (JSC::B3::Air::Liveness::LocalCalc::execute): * b3/air/AirOpcode.opcodes: Added. * b3/air/AirPhaseScope.cpp: Added. (JSC::B3::Air::PhaseScope::PhaseScope): (JSC::B3::Air::PhaseScope::~PhaseScope): * b3/air/AirPhaseScope.h: Added. * b3/air/AirRegisterPriority.cpp: Added. (JSC::B3::Air::gprsInPriorityOrder): (JSC::B3::Air::fprsInPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirRegisterPriority.h: Added. (JSC::B3::Air::RegistersInPriorityOrder<GPRInfo>::inPriorityOrder): (JSC::B3::Air::RegistersInPriorityOrder<FPRInfo>::inPriorityOrder): (JSC::B3::Air::regsInPriorityOrder): * b3/air/AirSpecial.cpp: Added. (JSC::B3::Air::Special::Special): (JSC::B3::Air::Special::~Special): (JSC::B3::Air::Special::name): (JSC::B3::Air::Special::dump): (JSC::B3::Air::Special::deepDump): * b3/air/AirSpecial.h: Added. (JSC::B3::Air::DeepSpecialDump::DeepSpecialDump): (JSC::B3::Air::DeepSpecialDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirSpillEverything.cpp: Added. (JSC::B3::Air::spillEverything): * b3/air/AirSpillEverything.h: Added. * b3/air/AirStackSlot.cpp: Added. (JSC::B3::Air::StackSlot::setOffsetFromFP): (JSC::B3::Air::StackSlot::dump): (JSC::B3::Air::StackSlot::deepDump): (JSC::B3::Air::StackSlot::StackSlot): * b3/air/AirStackSlot.h: Added. (JSC::B3::Air::StackSlot::byteSize): (JSC::B3::Air::StackSlot::kind): (JSC::B3::Air::StackSlot::index): (JSC::B3::Air::StackSlot::alignment): (JSC::B3::Air::StackSlot::value): (JSC::B3::Air::StackSlot::offsetFromFP): (JSC::B3::Air::DeepStackSlotDump::DeepStackSlotDump): (JSC::B3::Air::DeepStackSlotDump::dump): (JSC::B3::Air::deepDump): * b3/air/AirTmp.cpp: Added. (JSC::B3::Air::Tmp::dump): * b3/air/AirTmp.h: Added. (JSC::B3::Air::Tmp::Tmp): (JSC::B3::Air::Tmp::gpTmpForIndex): (JSC::B3::Air::Tmp::fpTmpForIndex): (JSC::B3::Air::Tmp::operator bool): (JSC::B3::Air::Tmp::isGP): (JSC::B3::Air::Tmp::isFP): (JSC::B3::Air::Tmp::isGPR): (JSC::B3::Air::Tmp::isFPR): (JSC::B3::Air::Tmp::isReg): (JSC::B3::Air::Tmp::gpr): (JSC::B3::Air::Tmp::fpr): (JSC::B3::Air::Tmp::reg): (JSC::B3::Air::Tmp::hasTmpIndex): (JSC::B3::Air::Tmp::gpTmpIndex): (JSC::B3::Air::Tmp::fpTmpIndex): (JSC::B3::Air::Tmp::tmpIndex): (JSC::B3::Air::Tmp::isAlive): (JSC::B3::Air::Tmp::operator==): (JSC::B3::Air::Tmp::operator!=): (JSC::B3::Air::Tmp::isHashTableDeletedValue): (JSC::B3::Air::Tmp::hash): (JSC::B3::Air::Tmp::encodeGP): (JSC::B3::Air::Tmp::encodeFP): (JSC::B3::Air::Tmp::encodeGPR): (JSC::B3::Air::Tmp::encodeFPR): (JSC::B3::Air::Tmp::encodeGPTmp): (JSC::B3::Air::Tmp::encodeFPTmp): (JSC::B3::Air::Tmp::isEncodedGP): (JSC::B3::Air::Tmp::isEncodedFP): (JSC::B3::Air::Tmp::isEncodedGPR): (JSC::B3::Air::Tmp::isEncodedFPR): (JSC::B3::Air::Tmp::isEncodedGPTmp): (JSC::B3::Air::Tmp::isEncodedFPTmp): (JSC::B3::Air::Tmp::decodeGPR): (JSC::B3::Air::Tmp::decodeFPR): (JSC::B3::Air::Tmp::decodeGPTmp): (JSC::B3::Air::Tmp::decodeFPTmp): (JSC::B3::Air::TmpHash::hash): (JSC::B3::Air::TmpHash::equal): * b3/air/AirTmpInlines.h: Added. (JSC::B3::Air::Tmp::Tmp): * b3/air/AirValidate.cpp: Added. (JSC::B3::Air::validate): * b3/air/AirValidate.h: Added. * b3/air/opcode_generator.rb: Added. * b3/generate_pattern_matcher.rb: Added. * b3/testb3.cpp: Added. (JSC::B3::compileAndRun): (JSC::B3::test42): (JSC::B3::testLoad42): (JSC::B3::testArg): (JSC::B3::testAddArgs): (JSC::B3::testAddArgs32): (JSC::B3::testStore): (JSC::B3::testTrunc): (JSC::B3::testAdd1): (JSC::B3::testStoreAddLoad): (JSC::B3::testStoreAddAndLoad): (JSC::B3::testAdd1Uncommuted): (JSC::B3::testLoadOffset): (JSC::B3::testLoadOffsetNotConstant): (JSC::B3::testLoadOffsetUsingAdd): (JSC::B3::testLoadOffsetUsingAddNotConstant): (JSC::B3::run): (run): (main): * bytecode/CodeBlock.h: (JSC::CodeBlock::specializationKind): * jit/Reg.h: (JSC::Reg::index): (JSC::Reg::isSet): (JSC::Reg::operator bool): (JSC::Reg::isHashTableDeletedValue): (JSC::Reg::AllRegsIterable::iterator::iterator): (JSC::Reg::AllRegsIterable::iterator::operator*): (JSC::Reg::AllRegsIterable::iterator::operator++): (JSC::Reg::AllRegsIterable::iterator::operator==): (JSC::Reg::AllRegsIterable::iterator::operator!=): (JSC::Reg::AllRegsIterable::begin): (JSC::Reg::AllRegsIterable::end): (JSC::Reg::all): (JSC::Reg::invalid): (JSC::Reg::operator!): Deleted. * jit/RegisterAtOffsetList.cpp: (JSC::RegisterAtOffsetList::RegisterAtOffsetList): * jit/RegisterAtOffsetList.h: (JSC::RegisterAtOffsetList::clear): (JSC::RegisterAtOffsetList::size): (JSC::RegisterAtOffsetList::begin): (JSC::RegisterAtOffsetList::end): * jit/RegisterSet.h: (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSet::forEach): (JSC::RegisterSet::setAny): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/HashSet.h: (WTF::copyToVector): (WTF::=): * wtf/ListDump.h: (WTF::PointerListDump::PointerListDump): (WTF::PointerListDump::dump): (WTF::MapDump::MapDump): (WTF::listDump): (WTF::pointerListDump): (WTF::sortedListDump): * wtf/MathExtras.h: (WTF::leftShiftWithSaturation): (WTF::rangesOverlap): * wtf/Platform.h: * wtf/ScopedLambda.h: Added. (WTF::scopedLambda): * wtf/SharedTask.h: (WTF::createSharedTask): Canonical link: https://commits.webkit.org/168813@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-10-28 23:57:04 +00:00
[JSC] Move generic data structures out of B3 https://bugs.webkit.org/show_bug.cgi?id=161155 Reviewed by Saam Barati. Source/JavaScriptCore: Move B3's good generic data structures to WTF. They can be used for the other kind of basic blocks and nodes. For example, the generator patch[1] will make BytecodeBasicBlock usable with these structures. [1]: https://bugs.webkit.org/show_bug.cgi?id=152723 * JavaScriptCore.xcodeproj/project.pbxproj: * b3/B3BasicBlockUtils.h: * b3/B3BlockWorklist.h: * b3/B3CFG.h: * b3/B3DuplicateTails.cpp: * b3/B3FixSSA.cpp: * b3/B3FixSSA.h: * b3/B3IndexMap.h: (JSC::B3::IndexMap::IndexMap): Deleted. (JSC::B3::IndexMap::resize): Deleted. (JSC::B3::IndexMap::clear): Deleted. (JSC::B3::IndexMap::size): Deleted. (JSC::B3::IndexMap::operator[]): Deleted. * b3/B3IndexSet.h: (JSC::B3::IndexSet::IndexSet): Deleted. (JSC::B3::IndexSet::add): Deleted. (JSC::B3::IndexSet::addAll): Deleted. (JSC::B3::IndexSet::remove): Deleted. (JSC::B3::IndexSet::contains): Deleted. (JSC::B3::IndexSet::size): Deleted. (JSC::B3::IndexSet::isEmpty): Deleted. (JSC::B3::IndexSet::Iterable::Iterable): Deleted. (JSC::B3::IndexSet::Iterable::iterator::iterator): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator*): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator++): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator==): Deleted. (JSC::B3::IndexSet::Iterable::iterator::operator!=): Deleted. (JSC::B3::IndexSet::Iterable::begin): Deleted. (JSC::B3::IndexSet::Iterable::end): Deleted. (JSC::B3::IndexSet::values): Deleted. (JSC::B3::IndexSet::indices): Deleted. (JSC::B3::IndexSet::dump): Deleted. * b3/B3LowerToAir.cpp: * b3/B3PhiChildren.h: * b3/B3Procedure.h: (JSC::B3::Procedure::iterator::iterator): Deleted. (JSC::B3::Procedure::iterator::operator*): Deleted. (JSC::B3::Procedure::iterator::operator++): Deleted. (JSC::B3::Procedure::iterator::operator==): Deleted. (JSC::B3::Procedure::iterator::operator!=): Deleted. (JSC::B3::Procedure::iterator::findNext): Deleted. * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceStrength.cpp: * b3/B3SSACalculator.h: * b3/B3UseCounts.h: * b3/air/AirCode.h: * b3/air/AirEliminateDeadCode.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFixPartialRegisterStalls.cpp: * b3/air/AirGenerate.cpp: * b3/air/AirGenerationContext.h: * b3/air/AirLiveness.h: * b3/air/AirSpillEverything.cpp: Source/WTF: Add IndexSet, IndexMap, and IndexedContainerIterator. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/IndexMap.h: Copied from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexMap::IndexMap): (WTF::IndexMap::resize): (WTF::IndexMap::clear): (WTF::IndexMap::size): (WTF::IndexMap::operator[]): * wtf/IndexSet.h: Renamed from Source/JavaScriptCore/b3/B3IndexSet.h. (WTF::IndexSet::IndexSet): (WTF::IndexSet::add): (WTF::IndexSet::addAll): (WTF::IndexSet::remove): (WTF::IndexSet::contains): (WTF::IndexSet::size): (WTF::IndexSet::isEmpty): (WTF::IndexSet::Iterable::Iterable): (WTF::IndexSet::Iterable::iterator::iterator): (WTF::IndexSet::Iterable::iterator::operator*): (WTF::IndexSet::Iterable::iterator::operator++): (WTF::IndexSet::Iterable::iterator::operator==): (WTF::IndexSet::Iterable::iterator::operator!=): (WTF::IndexSet::Iterable::begin): (WTF::IndexSet::Iterable::end): (WTF::IndexSet::values): (WTF::IndexSet::indices): (WTF::IndexSet::dump): * wtf/IndexedContainerIterator.h: Renamed from Source/JavaScriptCore/b3/B3IndexMap.h. (WTF::IndexedContainerIterator::IndexedContainerIterator): (WTF::IndexedContainerIterator::operator++): (WTF::IndexedContainerIterator::operator==): (WTF::IndexedContainerIterator::operator!=): (WTF::IndexedContainerIterator::findNext): Canonical link: https://commits.webkit.org/179305@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-08-24 19:35:41 +00:00
using WTF::IndexMap;