haikuwebkit/Source/WTF/wtf/BitVector.h

510 lines
14 KiB
C
Raw Permalink Normal View History

DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
/*
Use constexpr instead of const in symbol definitions that are obviously constexpr. https://bugs.webkit.org/show_bug.cgi?id=201879 Rubber-stamped by Joseph Pecoraro. Source/bmalloc: * bmalloc/AvailableMemory.cpp: * bmalloc/IsoTLS.h: * bmalloc/Map.h: * bmalloc/Mutex.cpp: (bmalloc::Mutex::lockSlowCase): * bmalloc/PerThread.h: * bmalloc/Vector.h: * bmalloc/Zone.h: Source/JavaScriptCore: const may require external storage (at the compiler's whim) though these currently do not. constexpr makes it clear that the value is a literal constant that can be inlined. In most cases in the code, when we say static const, we actually mean static constexpr. I'm changing the code to reflect this. * API/JSAPIValueWrapper.h: * API/JSCallbackConstructor.h: * API/JSCallbackObject.h: * API/JSContextRef.cpp: * API/JSWrapperMap.mm: * API/tests/CompareAndSwapTest.cpp: * API/tests/TypedArrayCTest.cpp: * API/tests/testapi.mm: (testObjectiveCAPIMain): * KeywordLookupGenerator.py: (Trie.printAsC): * assembler/ARMv7Assembler.h: * assembler/AssemblerBuffer.h: * assembler/AssemblerCommon.h: * assembler/MacroAssembler.h: * assembler/MacroAssemblerARM64.h: * assembler/MacroAssemblerARM64E.h: * assembler/MacroAssemblerARMv7.h: * assembler/MacroAssemblerCodeRef.h: * assembler/MacroAssemblerMIPS.h: * assembler/MacroAssemblerX86.h: * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::absDouble): (JSC::MacroAssemblerX86Common::negateDouble): * assembler/MacroAssemblerX86_64.h: * assembler/X86Assembler.h: * b3/B3Bank.h: * b3/B3CheckSpecial.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: * b3/B3FoldPathConstants.cpp: * b3/B3InferSwitches.cpp: * b3/B3Kind.h: * b3/B3LowerToAir.cpp: * b3/B3NativeTraits.h: * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceLoopStrength.cpp: * b3/B3ReduceStrength.cpp: * b3/B3ValueKey.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateStackByGraphColoring.cpp: * b3/air/AirArg.h: * b3/air/AirCCallSpecial.h: * b3/air/AirEmitShuffle.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFormTable.h: * b3/air/AirLowerAfterRegAlloc.cpp: * b3/air/AirPrintSpecial.h: * b3/air/AirStackAllocation.cpp: * b3/air/AirTmp.h: * b3/testb3_6.cpp: (testInterpreter): * bytecode/AccessCase.cpp: * bytecode/CallLinkStatus.cpp: * bytecode/CallVariant.h: * bytecode/CodeBlock.h: * bytecode/CodeOrigin.h: * bytecode/DFGExitProfile.h: * bytecode/DirectEvalCodeCache.h: * bytecode/ExecutableToCodeBlockEdge.h: * bytecode/GetterSetterAccessCase.cpp: * bytecode/LazyOperandValueProfile.h: * bytecode/ObjectPropertyCondition.h: * bytecode/ObjectPropertyConditionSet.cpp: * bytecode/PolymorphicAccess.cpp: * bytecode/PropertyCondition.h: * bytecode/SpeculatedType.h: * bytecode/StructureStubInfo.cpp: * bytecode/UnlinkedCodeBlock.cpp: (JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset): * bytecode/UnlinkedCodeBlock.h: * bytecode/UnlinkedEvalCodeBlock.h: * bytecode/UnlinkedFunctionCodeBlock.h: * bytecode/UnlinkedFunctionExecutable.h: * bytecode/UnlinkedModuleProgramCodeBlock.h: * bytecode/UnlinkedProgramCodeBlock.h: * bytecode/ValueProfile.h: * bytecode/VirtualRegister.h: * bytecode/Watchpoint.h: * bytecompiler/BytecodeGenerator.h: * bytecompiler/Label.h: * bytecompiler/NodesCodegen.cpp: (JSC::ThisNode::emitBytecode): * bytecompiler/RegisterID.h: * debugger/Breakpoint.h: * debugger/DebuggerParseData.cpp: * debugger/DebuggerPrimitives.h: * debugger/DebuggerScope.h: * dfg/DFGAbstractHeap.h: * dfg/DFGAbstractValue.h: * dfg/DFGArgumentsEliminationPhase.cpp: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCommon.h: * dfg/DFGCompilationKey.h: * dfg/DFGDesiredGlobalProperty.h: * dfg/DFGEdgeDominates.h: * dfg/DFGEpoch.h: * dfg/DFGForAllKills.h: (JSC::DFG::forAllKilledNodesAtNodeIndex): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::isLiveInBytecode): * dfg/DFGHeapLocation.h: * dfg/DFGInPlaceAbstractState.cpp: * dfg/DFGIntegerCheckCombiningPhase.cpp: * dfg/DFGIntegerRangeOptimizationPhase.cpp: * dfg/DFGInvalidationPointInjectionPhase.cpp: * dfg/DFGLICMPhase.cpp: * dfg/DFGLazyNode.h: * dfg/DFGMinifiedID.h: * dfg/DFGMovHintRemovalPhase.cpp: * dfg/DFGNodeFlowProjection.h: * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGPhantomInsertionPhase.cpp: * dfg/DFGPromotedHeapLocation.h: * dfg/DFGPropertyTypeKey.h: * dfg/DFGPureValue.h: * dfg/DFGPutStackSinkingPhase.cpp: * dfg/DFGRegisterBank.h: * dfg/DFGSSAConversionPhase.cpp: * dfg/DFGSSALoweringPhase.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileDoubleRep): (JSC::DFG::compileClampDoubleToByte): (JSC::DFG::SpeculativeJIT::compileArithRounding): (JSC::DFG::compileArithPowIntegerFastPath): (JSC::DFG::SpeculativeJIT::compileArithPow): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): * dfg/DFGStackLayoutPhase.cpp: * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGStrengthReductionPhase.cpp: * dfg/DFGStructureAbstractValue.h: * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::reconstruct const): * dfg/DFGWatchpointCollectionPhase.cpp: * disassembler/ARM64/A64DOpcode.h: * ftl/FTLLocation.h: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileArithRandom): * ftl/FTLSlowPathCall.cpp: * ftl/FTLSlowPathCallKey.h: * heap/CellContainer.h: * heap/CellState.h: * heap/ConservativeRoots.h: * heap/GCSegmentedArray.h: * heap/HandleBlock.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/HeapSnapshot.h: * heap/HeapUtil.h: (JSC::HeapUtil::findGCObjectPointersForMarking): * heap/IncrementalSweeper.cpp: * heap/LargeAllocation.h: * heap/MarkedBlock.cpp: * heap/Strong.h: * heap/VisitRaceKey.h: * heap/Weak.h: * heap/WeakBlock.h: * inspector/JSInjectedScriptHost.h: * inspector/JSInjectedScriptHostPrototype.h: * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.h: * inspector/agents/InspectorConsoleAgent.cpp: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets): * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_versions): * inspector/scripts/tests/generic/expected/version.json-result: * interpreter/Interpreter.h: * interpreter/ShadowChicken.cpp: * jit/BinarySwitch.cpp: * jit/CallFrameShuffler.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: * jit/GPRInfo.h: * jit/ICStats.h: * jit/JITThunks.h: * jit/Reg.h: * jit/RegisterSet.h: * jit/TempRegisterSet.h: * jsc.cpp: * parser/ASTBuilder.h: * parser/Nodes.h: * parser/SourceCodeKey.h: * parser/SyntaxChecker.h: * parser/VariableEnvironment.h: * profiler/ProfilerOrigin.h: * profiler/ProfilerOriginStack.h: * profiler/ProfilerUID.h: * runtime/AbstractModuleRecord.cpp: * runtime/ArrayBufferNeuteringWatchpointSet.h: * runtime/ArrayConstructor.h: * runtime/ArrayConventions.h: * runtime/ArrayIteratorPrototype.h: * runtime/ArrayPrototype.cpp: (JSC::setLength): * runtime/AsyncFromSyncIteratorPrototype.h: * runtime/AsyncGeneratorFunctionPrototype.h: * runtime/AsyncGeneratorPrototype.h: * runtime/AsyncIteratorPrototype.h: * runtime/AtomicsObject.cpp: * runtime/BigIntConstructor.h: * runtime/BigIntPrototype.h: * runtime/BooleanPrototype.h: * runtime/ClonedArguments.h: * runtime/CodeCache.h: * runtime/ControlFlowProfiler.h: * runtime/CustomGetterSetter.h: * runtime/DateConstructor.h: * runtime/DatePrototype.h: * runtime/DefinePropertyAttributes.h: * runtime/ErrorPrototype.h: * runtime/EvalExecutable.h: * runtime/Exception.h: * runtime/ExceptionHelpers.cpp: (JSC::invalidParameterInSourceAppender): (JSC::invalidParameterInstanceofSourceAppender): * runtime/ExceptionHelpers.h: * runtime/ExecutableBase.h: * runtime/FunctionExecutable.h: * runtime/FunctionRareData.h: * runtime/GeneratorPrototype.h: * runtime/GenericArguments.h: * runtime/GenericOffset.h: * runtime/GetPutInfo.h: * runtime/GetterSetter.h: * runtime/GlobalExecutable.h: * runtime/Identifier.h: * runtime/InspectorInstrumentationObject.h: * runtime/InternalFunction.h: * runtime/IntlCollatorConstructor.h: * runtime/IntlCollatorPrototype.h: * runtime/IntlDateTimeFormatConstructor.h: * runtime/IntlDateTimeFormatPrototype.h: * runtime/IntlNumberFormatConstructor.h: * runtime/IntlNumberFormatPrototype.h: * runtime/IntlObject.h: * runtime/IntlPluralRulesConstructor.h: * runtime/IntlPluralRulesPrototype.h: * runtime/IteratorPrototype.h: * runtime/JSArray.cpp: (JSC::JSArray::tryCreateUninitializedRestricted): * runtime/JSArray.h: * runtime/JSArrayBuffer.h: * runtime/JSArrayBufferView.h: * runtime/JSBigInt.h: * runtime/JSCJSValue.h: * runtime/JSCell.h: * runtime/JSCustomGetterSetterFunction.h: * runtime/JSDataView.h: * runtime/JSDataViewPrototype.h: * runtime/JSDestructibleObject.h: * runtime/JSFixedArray.h: * runtime/JSGenericTypedArrayView.h: * runtime/JSGlobalLexicalEnvironment.h: * runtime/JSGlobalObject.h: * runtime/JSImmutableButterfly.h: * runtime/JSInternalPromiseConstructor.h: * runtime/JSInternalPromiseDeferred.h: * runtime/JSInternalPromisePrototype.h: * runtime/JSLexicalEnvironment.h: * runtime/JSModuleEnvironment.h: * runtime/JSModuleLoader.h: * runtime/JSModuleNamespaceObject.h: * runtime/JSNonDestructibleProxy.h: * runtime/JSONObject.cpp: * runtime/JSONObject.h: * runtime/JSObject.h: * runtime/JSPromiseConstructor.h: * runtime/JSPromiseDeferred.h: * runtime/JSPromisePrototype.h: * runtime/JSPropertyNameEnumerator.h: * runtime/JSProxy.h: * runtime/JSScope.h: * runtime/JSScriptFetchParameters.h: * runtime/JSScriptFetcher.h: * runtime/JSSegmentedVariableObject.h: * runtime/JSSourceCode.h: * runtime/JSString.cpp: * runtime/JSString.h: * runtime/JSSymbolTableObject.h: * runtime/JSTemplateObjectDescriptor.h: * runtime/JSTypeInfo.h: * runtime/MapPrototype.h: * runtime/MinimumReservedZoneSize.h: * runtime/ModuleProgramExecutable.h: * runtime/NativeExecutable.h: * runtime/NativeFunction.h: * runtime/NativeStdFunctionCell.h: * runtime/NumberConstructor.h: * runtime/NumberPrototype.h: * runtime/ObjectConstructor.h: * runtime/ObjectPrototype.h: * runtime/ProgramExecutable.h: * runtime/PromiseDeferredTimer.cpp: * runtime/PropertyMapHashTable.h: * runtime/PropertyNameArray.h: (JSC::PropertyNameArray::add): * runtime/PrototypeKey.h: * runtime/ProxyConstructor.h: * runtime/ProxyObject.cpp: (JSC::ProxyObject::performGetOwnPropertyNames): * runtime/ProxyRevoke.h: * runtime/ReflectObject.h: * runtime/RegExp.h: * runtime/RegExpCache.h: * runtime/RegExpConstructor.h: * runtime/RegExpKey.h: * runtime/RegExpObject.h: * runtime/RegExpPrototype.h: * runtime/RegExpStringIteratorPrototype.h: * runtime/SamplingProfiler.cpp: * runtime/ScopedArgumentsTable.h: * runtime/ScriptExecutable.h: * runtime/SetPrototype.h: * runtime/SmallStrings.h: * runtime/SparseArrayValueMap.h: * runtime/StringConstructor.h: * runtime/StringIteratorPrototype.h: * runtime/StringObject.h: * runtime/StringPrototype.h: * runtime/Structure.h: * runtime/StructureChain.h: * runtime/StructureRareData.h: * runtime/StructureTransitionTable.h: * runtime/Symbol.h: * runtime/SymbolConstructor.h: * runtime/SymbolPrototype.h: * runtime/SymbolTable.h: * runtime/TemplateObjectDescriptor.h: * runtime/TypeProfiler.cpp: * runtime/TypeProfiler.h: * runtime/TypeProfilerLog.cpp: * runtime/VarOffset.h: * testRegExp.cpp: * tools/HeapVerifier.cpp: (JSC::HeapVerifier::checkIfRecorded): * tools/JSDollarVM.cpp: * wasm/WasmB3IRGenerator.cpp: * wasm/WasmBBQPlan.cpp: * wasm/WasmFaultSignalHandler.cpp: * wasm/WasmFunctionParser.h: * wasm/WasmOMGForOSREntryPlan.cpp: * wasm/WasmOMGPlan.cpp: * wasm/WasmPlan.cpp: * wasm/WasmSignature.cpp: * wasm/WasmSignature.h: * wasm/WasmWorklist.cpp: * wasm/js/JSWebAssembly.h: * wasm/js/JSWebAssemblyCodeBlock.h: * wasm/js/WebAssemblyCompileErrorConstructor.h: * wasm/js/WebAssemblyCompileErrorPrototype.h: * wasm/js/WebAssemblyFunction.h: * wasm/js/WebAssemblyInstanceConstructor.h: * wasm/js/WebAssemblyInstancePrototype.h: * wasm/js/WebAssemblyLinkErrorConstructor.h: * wasm/js/WebAssemblyLinkErrorPrototype.h: * wasm/js/WebAssemblyMemoryConstructor.h: * wasm/js/WebAssemblyMemoryPrototype.h: * wasm/js/WebAssemblyModuleConstructor.h: * wasm/js/WebAssemblyModulePrototype.h: * wasm/js/WebAssemblyRuntimeErrorConstructor.h: * wasm/js/WebAssemblyRuntimeErrorPrototype.h: * wasm/js/WebAssemblyTableConstructor.h: * wasm/js/WebAssemblyTablePrototype.h: * wasm/js/WebAssemblyToJSCallee.h: * yarr/Yarr.h: * yarr/YarrParser.h: * yarr/generateYarrCanonicalizeUnicode: Source/WebCore: No new tests. Covered by existing tests. * bindings/js/JSDOMConstructorBase.h: * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEnabledForContext.h: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestTypedefs.h: * bridge/objc/objc_runtime.h: * bridge/runtime_array.h: * bridge/runtime_method.h: * bridge/runtime_object.h: Source/WebKit: * WebProcess/Plugins/Netscape/JSNPObject.h: Source/WTF: * wtf/Assertions.cpp: * wtf/AutomaticThread.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Brigand.h: * wtf/CheckedArithmetic.h: * wtf/CrossThreadCopier.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DateMath.cpp: (WTF::daysFrom1970ToYear): * wtf/DeferrableRefCounted.h: * wtf/GetPtr.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashTable.h: * wtf/HashTraits.h: * wtf/JSONValues.cpp: * wtf/JSONValues.h: * wtf/ListHashSet.h: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: (WTF::Hooks>::lockSlow): * wtf/Logger.h: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): * wtf/MainThread.cpp: * wtf/MetaAllocatorPtr.h: * wtf/MonotonicTime.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::NaturalLoops): * wtf/ObjectIdentifier.h: * wtf/RAMSize.cpp: * wtf/Ref.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/SchedulePair.h: * wtf/StackShot.h: * wtf/StdLibExtras.h: * wtf/TinyPtrSet.h: * wtf/URL.cpp: * wtf/URLHash.h: * wtf/URLParser.cpp: (WTF::URLParser::defaultPortForProtocol): * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.h: * wtf/WeakHashSet.h: * wtf/WordLock.h: * wtf/cocoa/CPUTimeCocoa.cpp: * wtf/cocoa/MemoryPressureHandlerCocoa.mm: * wtf/persistence/PersistentDecoder.h: * wtf/persistence/PersistentEncoder.h: * wtf/text/AtomStringHash.h: * wtf/text/CString.h: * wtf/text/StringBuilder.cpp: (WTF::expandedCapacity): * wtf/text/StringHash.h: * wtf/text/StringImpl.h: * wtf/text/StringToIntegerConversion.h: (WTF::toIntegralType): * wtf/text/SymbolRegistry.h: * wtf/text/TextStream.cpp: (WTF::hasFractions): * wtf/text/WTFString.h: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: Canonical link: https://commits.webkit.org/215538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-18 00:36:19 +00:00
* Copyright (C) 2011-2019 Apple Inc. All rights reserved.
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +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.
*/
Use pragma once in WTF https://bugs.webkit.org/show_bug.cgi?id=190527 Reviewed by Chris Dumez. Source/WTF: We also need to consistently include wtf headers from within wtf so we can build wtf without symbol redefinition errors from including the copy in Source and the copy in the build directory. * wtf/ASCIICType.h: * wtf/Assertions.cpp: * wtf/Assertions.h: * wtf/Atomics.h: * wtf/AutomaticThread.cpp: * wtf/AutomaticThread.h: * wtf/BackwardsGraph.h: * wtf/Bag.h: * wtf/BagToHashMap.h: * wtf/BitVector.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Box.h: * wtf/BubbleSort.h: * wtf/BumpPointerAllocator.h: * wtf/ByteOrder.h: * wtf/CPUTime.cpp: * wtf/CallbackAggregator.h: * wtf/CheckedArithmetic.h: * wtf/CheckedBoolean.h: * wtf/ClockType.cpp: * wtf/ClockType.h: * wtf/CommaPrinter.h: * wtf/CompilationThread.cpp: * wtf/CompilationThread.h: * wtf/Compiler.h: * wtf/ConcurrentPtrHashSet.cpp: * wtf/ConcurrentVector.h: * wtf/Condition.h: * wtf/CountingLock.cpp: * wtf/CrossThreadTaskHandler.cpp: * wtf/CryptographicUtilities.cpp: * wtf/CryptographicUtilities.h: * wtf/CryptographicallyRandomNumber.cpp: * wtf/CryptographicallyRandomNumber.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DataLog.h: * wtf/DateMath.cpp: * wtf/DateMath.h: * wtf/DecimalNumber.cpp: * wtf/DecimalNumber.h: * wtf/Deque.h: * wtf/DisallowCType.h: * wtf/Dominators.h: * wtf/DoublyLinkedList.h: * wtf/FastBitVector.cpp: * wtf/FastMalloc.cpp: * wtf/FastMalloc.h: * wtf/FeatureDefines.h: * wtf/FilePrintStream.cpp: * wtf/FilePrintStream.h: * wtf/FlipBytes.h: * wtf/FunctionDispatcher.cpp: * wtf/FunctionDispatcher.h: * wtf/GetPtr.h: * wtf/Gigacage.cpp: * wtf/GlobalVersion.cpp: * wtf/GraphNodeWorklist.h: * wtf/GregorianDateTime.cpp: * wtf/GregorianDateTime.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashMethod.h: * wtf/HashSet.h: * wtf/HashTable.cpp: * wtf/HashTraits.h: * wtf/Indenter.h: * wtf/IndexSparseSet.h: * wtf/InlineASM.h: * wtf/Insertion.h: * wtf/IteratorAdaptors.h: * wtf/IteratorRange.h: * wtf/JSONValues.cpp: * wtf/JSValueMalloc.cpp: * wtf/LEBDecoder.h: * wtf/Language.cpp: * wtf/ListDump.h: * wtf/Lock.cpp: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockedPrintStream.cpp: * wtf/Locker.h: * wtf/MD5.cpp: * wtf/MD5.h: * wtf/MainThread.cpp: * wtf/MainThread.h: * wtf/MallocPtr.h: * wtf/MathExtras.h: * wtf/MediaTime.cpp: * wtf/MediaTime.h: * wtf/MemoryPressureHandler.cpp: * wtf/MessageQueue.h: * wtf/MetaAllocator.cpp: * wtf/MetaAllocator.h: * wtf/MetaAllocatorHandle.h: * wtf/MonotonicTime.cpp: * wtf/MonotonicTime.h: * wtf/NakedPtr.h: * wtf/NoLock.h: * wtf/NoTailCalls.h: * wtf/Noncopyable.h: * wtf/NumberOfCores.cpp: * wtf/NumberOfCores.h: * wtf/OSAllocator.h: * wtf/OSAllocatorPosix.cpp: * wtf/OSRandomSource.cpp: * wtf/OSRandomSource.h: * wtf/ObjcRuntimeExtras.h: * wtf/OrderMaker.h: * wtf/PackedIntVector.h: * wtf/PageAllocation.h: * wtf/PageBlock.cpp: * wtf/PageBlock.h: * wtf/PageReservation.h: * wtf/ParallelHelperPool.cpp: * wtf/ParallelHelperPool.h: * wtf/ParallelJobs.h: * wtf/ParallelJobsLibdispatch.h: * wtf/ParallelVectorIterator.h: * wtf/ParkingLot.cpp: * wtf/ParkingLot.h: * wtf/Platform.h: * wtf/PointerComparison.h: * wtf/Poisoned.cpp: * wtf/PrintStream.cpp: * wtf/PrintStream.h: * wtf/ProcessID.h: * wtf/ProcessPrivilege.cpp: * wtf/RAMSize.cpp: * wtf/RAMSize.h: * wtf/RandomDevice.cpp: * wtf/RandomNumber.cpp: * wtf/RandomNumber.h: * wtf/RandomNumberSeed.h: * wtf/RangeSet.h: * wtf/RawPointer.h: * wtf/ReadWriteLock.cpp: * wtf/RedBlackTree.h: * wtf/Ref.h: * wtf/RefCountedArray.h: * wtf/RefCountedLeakCounter.cpp: * wtf/RefCountedLeakCounter.h: * wtf/RefCounter.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/RunLoop.cpp: * wtf/RunLoop.h: * wtf/RunLoopTimer.h: * wtf/RunLoopTimerCF.cpp: * wtf/SHA1.cpp: * wtf/SHA1.h: * wtf/SaturatedArithmetic.h: (saturatedSubtraction): * wtf/SchedulePair.h: * wtf/SchedulePairCF.cpp: * wtf/SchedulePairMac.mm: * wtf/ScopedLambda.h: * wtf/Seconds.cpp: * wtf/Seconds.h: * wtf/SegmentedVector.h: * wtf/SentinelLinkedList.h: * wtf/SharedTask.h: * wtf/SimpleStats.h: * wtf/SingleRootGraph.h: * wtf/SinglyLinkedList.h: * wtf/SixCharacterHash.cpp: * wtf/SixCharacterHash.h: * wtf/SmallPtrSet.h: * wtf/Spectrum.h: * wtf/StackBounds.cpp: * wtf/StackBounds.h: * wtf/StackStats.cpp: * wtf/StackStats.h: * wtf/StackTrace.cpp: * wtf/StdLibExtras.h: * wtf/StreamBuffer.h: * wtf/StringHashDumpContext.h: * wtf/StringPrintStream.cpp: * wtf/StringPrintStream.h: * wtf/ThreadGroup.cpp: * wtf/ThreadMessage.cpp: * wtf/ThreadSpecific.h: * wtf/Threading.cpp: * wtf/Threading.h: * wtf/ThreadingPrimitives.h: * wtf/ThreadingPthreads.cpp: * wtf/TimeWithDynamicClockType.cpp: * wtf/TimeWithDynamicClockType.h: * wtf/TimingScope.cpp: * wtf/TinyLRUCache.h: * wtf/TinyPtrSet.h: * wtf/TriState.h: * wtf/TypeCasts.h: * wtf/UUID.cpp: * wtf/UnionFind.h: * wtf/VMTags.h: * wtf/ValueCheck.h: * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.cpp: * wtf/WallTime.h: * wtf/WeakPtr.h: * wtf/WeakRandom.h: * wtf/WordLock.cpp: * wtf/WordLock.h: * wtf/WorkQueue.cpp: * wtf/WorkQueue.h: * wtf/WorkerPool.cpp: * wtf/cf/LanguageCF.cpp: * wtf/cf/RunLoopCF.cpp: * wtf/cocoa/Entitlements.mm: * wtf/cocoa/MachSendRight.cpp: * wtf/cocoa/MainThreadCocoa.mm: * wtf/cocoa/MemoryFootprintCocoa.cpp: * wtf/cocoa/WorkQueueCocoa.cpp: * wtf/dtoa.cpp: * wtf/dtoa.h: * wtf/ios/WebCoreThread.cpp: * wtf/ios/WebCoreThread.h: * wtf/mac/AppKitCompatibilityDeclarations.h: * wtf/mac/DeprecatedSymbolsUsedBySafari.mm: * wtf/mbmalloc.cpp: * wtf/persistence/PersistentCoders.cpp: * wtf/persistence/PersistentDecoder.cpp: * wtf/persistence/PersistentEncoder.cpp: * wtf/spi/cf/CFBundleSPI.h: * wtf/spi/darwin/CommonCryptoSPI.h: * wtf/text/ASCIIFastPath.h: * wtf/text/ASCIILiteral.cpp: * wtf/text/AtomicString.cpp: * wtf/text/AtomicString.h: * wtf/text/AtomicStringHash.h: * wtf/text/AtomicStringImpl.cpp: * wtf/text/AtomicStringImpl.h: * wtf/text/AtomicStringTable.cpp: * wtf/text/AtomicStringTable.h: * wtf/text/Base64.cpp: * wtf/text/CString.cpp: * wtf/text/CString.h: * wtf/text/ConversionMode.h: * wtf/text/ExternalStringImpl.cpp: * wtf/text/IntegerToStringConversion.h: * wtf/text/LChar.h: * wtf/text/LineEnding.cpp: * wtf/text/StringBuffer.h: * wtf/text/StringBuilder.cpp: * wtf/text/StringBuilder.h: * wtf/text/StringBuilderJSON.cpp: * wtf/text/StringCommon.h: * wtf/text/StringConcatenate.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.cpp: * wtf/text/StringImpl.h: * wtf/text/StringOperators.h: * wtf/text/StringView.cpp: * wtf/text/StringView.h: * wtf/text/SymbolImpl.cpp: * wtf/text/SymbolRegistry.cpp: * wtf/text/SymbolRegistry.h: * wtf/text/TextBreakIterator.cpp: * wtf/text/TextBreakIterator.h: * wtf/text/TextBreakIteratorInternalICU.h: * wtf/text/TextPosition.h: * wtf/text/TextStream.cpp: * wtf/text/UniquedStringImpl.h: * wtf/text/WTFString.cpp: * wtf/text/WTFString.h: * wtf/text/cocoa/StringCocoa.mm: * wtf/text/cocoa/StringViewCocoa.mm: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: * wtf/text/icu/UTextProvider.cpp: * wtf/text/icu/UTextProvider.h: * wtf/text/icu/UTextProviderLatin1.cpp: * wtf/text/icu/UTextProviderLatin1.h: * wtf/text/icu/UTextProviderUTF16.cpp: * wtf/text/icu/UTextProviderUTF16.h: * wtf/threads/BinarySemaphore.cpp: * wtf/threads/BinarySemaphore.h: * wtf/threads/Signals.cpp: * wtf/unicode/CharacterNames.h: * wtf/unicode/Collator.h: * wtf/unicode/CollatorDefault.cpp: * wtf/unicode/UTF8.cpp: * wtf/unicode/UTF8.h: Tools: Put WorkQueue in namespace DRT so it does not conflict with WTF::WorkQueue. * DumpRenderTree/TestRunner.cpp: (TestRunner::queueLoadHTMLString): (TestRunner::queueLoadAlternateHTMLString): (TestRunner::queueBackNavigation): (TestRunner::queueForwardNavigation): (TestRunner::queueLoadingScript): (TestRunner::queueNonLoadingScript): (TestRunner::queueReload): * DumpRenderTree/WorkQueue.cpp: (WorkQueue::singleton): Deleted. (WorkQueue::WorkQueue): Deleted. (WorkQueue::queue): Deleted. (WorkQueue::dequeue): Deleted. (WorkQueue::count): Deleted. (WorkQueue::clear): Deleted. (WorkQueue::processWork): Deleted. * DumpRenderTree/WorkQueue.h: (WorkQueue::setFrozen): Deleted. * DumpRenderTree/WorkQueueItem.h: * DumpRenderTree/mac/DumpRenderTree.mm: (runTest): * DumpRenderTree/mac/FrameLoadDelegate.mm: (-[FrameLoadDelegate processWork:]): (-[FrameLoadDelegate webView:locationChangeDone:forDataSource:]): * DumpRenderTree/mac/TestRunnerMac.mm: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): * DumpRenderTree/win/DumpRenderTree.cpp: (runTest): * DumpRenderTree/win/FrameLoadDelegate.cpp: (FrameLoadDelegate::processWork): (FrameLoadDelegate::locationChangeDone): * DumpRenderTree/win/TestRunnerWin.cpp: (TestRunner::notifyDone): (TestRunner::forceImmediateCompletion): (TestRunner::queueLoad): Canonical link: https://commits.webkit.org/205473@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-10-15 14:24:49 +00:00
#pragma once
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
Release build debugging should be easier https://bugs.webkit.org/show_bug.cgi?id=77669 Reviewed by Gavin Barraclough. * assembler/ARMAssembler.h: (ARMAssembler): (JSC::ARMAssembler::debugOffset): * assembler/ARMv7Assembler.h: (ARMv7Assembler): (JSC::ARMv7Assembler::debugOffset): (ARMInstructionFormatter): (JSC::ARMv7Assembler::ARMInstructionFormatter::debugOffset): * assembler/AbstractMacroAssembler.h: (AbstractMacroAssembler): (JSC::AbstractMacroAssembler::debugOffset): * assembler/AssemblerBuffer.h: (AssemblerBuffer): (JSC::AssemblerBuffer::debugOffset): * assembler/LinkBuffer.h: (LinkBuffer): (JSC::LinkBuffer::debugSize): * assembler/MIPSAssembler.h: (MIPSAssembler): (JSC::MIPSAssembler::debugOffset): * assembler/X86Assembler.h: (X86Assembler): (JSC::X86Assembler::debugOffset): (X86InstructionFormatter): (JSC::X86Assembler::X86InstructionFormatter::debugOffset): * bytecode/CodeBlock.cpp: (JSC): * bytecode/CodeBlock.h: (CodeBlock): * bytecode/CodeOrigin.h: (CodeOrigin): (JSC): (JSC::CodeOrigin::inlineStack): * bytecode/DFGExitProfile.h: (JSC::DFG::exitKindToString): * bytecode/DataFormat.h: (JSC::dataFormatToString): * bytecode/PredictedType.cpp: (JSC): (JSC::predictionToString): * bytecode/PredictedType.h: (JSC): * bytecode/ValueRecovery.h: (ValueRecovery): (JSC::ValueRecovery::dump): * bytecompiler/BytecodeGenerator.cpp: (JSC): (JSC::BytecodeGenerator::setDumpsGeneratedCode): (JSC::BytecodeGenerator::dumpsGeneratedCode): (JSC::BytecodeGenerator::generate): * dfg/DFGAbstractValue.h: (StructureAbstractValue): (JSC::DFG::StructureAbstractValue::dump): (AbstractValue): (JSC::DFG::AbstractValue::dump): * dfg/DFGAssemblyHelpers.h: (DFG): (AssemblyHelpers): (JSC::DFG::AssemblyHelpers::debugCall): * dfg/DFGFPRInfo.h: (FPRInfo): (JSC::DFG::FPRInfo::debugName): * dfg/DFGGPRInfo.h: (GPRInfo): (JSC::DFG::GPRInfo::debugName): * dfg/DFGGraph.cpp: (DFG): * dfg/DFGGraph.h: (Graph): * dfg/DFGNode.h: (DFG): (JSC::DFG::arithNodeFlagsAsString): (Node): (JSC::DFG::Node::hasIdentifier): (JSC::DFG::Node::dumpChildren): * dfg/DFGOSRExit.cpp: (DFG): (JSC::DFG::OSRExit::dump): * dfg/DFGOSRExit.h: (OSRExit): * runtime/JSValue.cpp: (JSC): (JSC::JSValue::description): * runtime/JSValue.h: (JSValue): * wtf/BitVector.cpp: (WTF): (WTF::BitVector::dump): * wtf/BitVector.h: (BitVector): Canonical link: https://commits.webkit.org/94533@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@106590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-02-02 21:49:50 +00:00
#include <stdio.h>
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
#include <wtf/Assertions.h>
Beef up the DFG's CFG analyses to include iterated dominance frontiers and more user-friendly BlockSets https://bugs.webkit.org/show_bug.cgi?id=136520 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add code to compute iterated dominance frontiers. This involves using BlockSet a lot, so this patch also makes BlockSet a lot more user-friendly. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGBasicBlock.h: * dfg/DFGBlockSet.cpp: Added. (JSC::DFG::BlockSet::dump): * dfg/DFGBlockSet.h: (JSC::DFG::BlockSet::iterator::iterator): (JSC::DFG::BlockSet::iterator::operator++): (JSC::DFG::BlockSet::iterator::operator==): (JSC::DFG::BlockSet::iterator::operator!=): (JSC::DFG::BlockSet::Iterable::Iterable): (JSC::DFG::BlockSet::Iterable::begin): (JSC::DFG::BlockSet::Iterable::end): (JSC::DFG::BlockSet::iterable): (JSC::DFG::BlockAdder::BlockAdder): (JSC::DFG::BlockAdder::operator()): * dfg/DFGBlockSetInlines.h: Added. (JSC::DFG::BlockSet::iterator::operator*): * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::strictDominatorsOf): (JSC::DFG::Dominators::dominatorsOf): (JSC::DFG::Dominators::blocksStrictlyDominatedBy): (JSC::DFG::Dominators::blocksDominatedBy): (JSC::DFG::Dominators::dominanceFrontierOf): (JSC::DFG::Dominators::iteratedDominanceFrontierOf): * dfg/DFGDominators.h: (JSC::DFG::Dominators::forAllStrictDominatorsOf): (JSC::DFG::Dominators::forAllDominatorsOf): (JSC::DFG::Dominators::forAllBlocksStrictlyDominatedBy): (JSC::DFG::Dominators::forAllBlocksDominatedBy): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOfImpl): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): Source/WTF: Give BitVector a way to quickly find the next set (or unset) bit. Make BitVector equality faster. Fix a minor closure goof in Spectrum. * wtf/BitVector.cpp: (WTF::BitVector::equalsSlowCase): (WTF::BitVector::equalsSlowCaseFast): (WTF::BitVector::equalsSlowCaseSimple): * wtf/BitVector.h: (WTF::BitVector::findBit): (WTF::BitVector::findBitFast): (WTF::BitVector::findBitSimple): (WTF::BitVector::findBitInWord): * wtf/Spectrum.h: (WTF::Spectrum::removeIf): Canonical link: https://commits.webkit.org/154343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-04 21:08:38 +00:00
#include <wtf/DataLog.h>
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
#include <wtf/HashFunctions.h>
#include <wtf/HashTraits.h>
#include <wtf/PrintStream.h>
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
#include <wtf/StdLibExtras.h>
Cache bytecode to disk https://bugs.webkit.org/show_bug.cgi?id=192782 <rdar://problem/46084932> Reviewed by Keith Miller. Source/JavaScriptCore: Add the logic to serialize and deserialize the new JSC bytecode. For now, the cache is only used for tests. Each class that can be serialized has a counterpart in CachedTypes, which handles the decoding and encoding. When decoding, the cached objects are mmap'd from disk, but only used for creating instances of the respective in-memory version of each object. Ideally, the mmap'd objects should be used at runtime in the future. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/BuiltinNames.cpp: (JSC::BuiltinNames::BuiltinNames): * builtins/BuiltinNames.h: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantIdentifierSetRegisters): * bytecode/CodeBlock.h: * bytecode/HandlerInfo.h: (JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo): * bytecode/InstructionStream.h: * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::addSetConstant): (JSC::UnlinkedCodeBlock::constantIdentifierSets): * bytecode/UnlinkedEvalCodeBlock.h: * bytecode/UnlinkedFunctionCodeBlock.h: * bytecode/UnlinkedFunctionExecutable.h: * bytecode/UnlinkedGlobalCodeBlock.h: (JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): * bytecode/UnlinkedMetadataTable.h: * bytecode/UnlinkedModuleProgramCodeBlock.h: * bytecode/UnlinkedProgramCodeBlock.h: * interpreter/Interpreter.cpp: * jsc.cpp: (functionQuit): (runJSC): * parser/SourceCode.h: * parser/SourceCodeKey.h: (JSC::SourceCodeKey::operator!= const): * parser/UnlinkedSourceCode.h: * parser/VariableEnvironment.h: * runtime/CachedTypes.cpp: Added. (JSC::Encoder::Allocation::buffer const): (JSC::Encoder::Allocation::offset const): (JSC::Encoder::Allocation::Allocation): (JSC::Encoder::Encoder): (JSC::Encoder::vm): (JSC::Encoder::malloc): (JSC::Encoder::offsetOf): (JSC::Encoder::cachePtr): (JSC::Encoder::offsetForPtr): (JSC::Encoder::release): (JSC::Encoder::Page::Page): (JSC::Encoder::Page::malloc): (JSC::Encoder::Page::buffer const): (JSC::Encoder::Page::size const): (JSC::Encoder::Page::getOffset const): (JSC::Encoder::allocateNewPage): (JSC::Decoder::Decoder): (JSC::Decoder::~Decoder): (JSC::Decoder::vm): (JSC::Decoder::offsetOf): (JSC::Decoder::cacheOffset): (JSC::Decoder::addFinalizer): (JSC::encode): (JSC::decode): (JSC::VariableLengthObject::buffer const): (JSC::VariableLengthObject::allocate): (JSC::CachedPtr::encode): (JSC::CachedPtr::decode const): (JSC::CachedPtr::operator-> const): (JSC::CachedPtr::get const): (JSC::CachedRefPtr::encode): (JSC::CachedRefPtr::decode const): (JSC::CachedWriteBarrier::encode): (JSC::CachedWriteBarrier::decode const): (JSC::CachedVector::encode): (JSC::CachedVector::decode const): (JSC::CachedPair::encode): (JSC::CachedPair::decode const): (JSC::CachedHashMap::encode): (JSC::CachedHashMap::decode const): (JSC::CachedUniquedStringImpl::encode): (JSC::CachedUniquedStringImpl::decode const): (JSC::CachedStringImpl::encode): (JSC::CachedStringImpl::decode const): (JSC::CachedString::encode): (JSC::CachedString::decode const): (JSC::CachedIdentifier::encode): (JSC::CachedIdentifier::decode const): (JSC::CachedOptional::encode): (JSC::CachedOptional::decode const): (JSC::CachedOptional::decodeAsPtr const): (JSC::CachedSimpleJumpTable::encode): (JSC::CachedSimpleJumpTable::decode const): (JSC::CachedStringJumpTable::encode): (JSC::CachedStringJumpTable::decode const): (JSC::CachedCodeBlockRareData::encode): (JSC::CachedCodeBlockRareData::decode const): (JSC::CachedBitVector::encode): (JSC::CachedBitVector::decode const): (JSC::CachedHashSet::encode): (JSC::CachedHashSet::decode const): (JSC::CachedConstantIdentifierSetEntry::encode): (JSC::CachedConstantIdentifierSetEntry::decode const): (JSC::CachedVariableEnvironment::encode): (JSC::CachedVariableEnvironment::decode const): (JSC::CachedArray::encode): (JSC::CachedArray::decode const): (JSC::CachedScopedArgumentsTable::encode): (JSC::CachedScopedArgumentsTable::decode const): (JSC::CachedSymbolTableEntry::encode): (JSC::CachedSymbolTableEntry::decode const): (JSC::CachedSymbolTable::encode): (JSC::CachedSymbolTable::decode const): (JSC::CachedImmutableButterfly::encode): (JSC::CachedImmutableButterfly::decode const): (JSC::CachedRegExp::encode): (JSC::CachedRegExp::decode const): (JSC::CachedTemplateObjectDescriptor::encode): (JSC::CachedTemplateObjectDescriptor::decode const): (JSC::CachedBigInt::encode): (JSC::CachedBigInt::decode const): (JSC::CachedJSValue::encode): (JSC::CachedJSValue::decode const): (JSC::CachedInstructionStream::encode): (JSC::CachedInstructionStream::decode const): (JSC::CachedMetadataTable::encode): (JSC::CachedMetadataTable::decode const): (JSC::CachedSourceOrigin::encode): (JSC::CachedSourceOrigin::decode const): (JSC::CachedTextPosition::encode): (JSC::CachedTextPosition::decode const): (JSC::CachedSourceProviderShape::encode): (JSC::CachedSourceProviderShape::decode const): (JSC::CachedStringSourceProvider::encode): (JSC::CachedStringSourceProvider::decode const): (JSC::CachedWebAssemblySourceProvider::encode): (JSC::CachedWebAssemblySourceProvider::decode const): (JSC::CachedSourceProvider::encode): (JSC::CachedSourceProvider::decode const): (JSC::CachedUnlinkedSourceCodeShape::encode): (JSC::CachedUnlinkedSourceCodeShape::decode const): (JSC::CachedSourceCode::encode): (JSC::CachedSourceCode::decode const): (JSC::CachedFunctionExecutable::firstLineOffset const): (JSC::CachedFunctionExecutable::lineCount const): (JSC::CachedFunctionExecutable::unlinkedFunctionNameStart const): (JSC::CachedFunctionExecutable::unlinkedBodyStartColumn const): (JSC::CachedFunctionExecutable::unlinkedBodyEndColumn const): (JSC::CachedFunctionExecutable::startOffset const): (JSC::CachedFunctionExecutable::sourceLength const): (JSC::CachedFunctionExecutable::parametersStartOffset const): (JSC::CachedFunctionExecutable::typeProfilingStartOffset const): (JSC::CachedFunctionExecutable::typeProfilingEndOffset const): (JSC::CachedFunctionExecutable::parameterCount const): (JSC::CachedFunctionExecutable::features const): (JSC::CachedFunctionExecutable::sourceParseMode const): (JSC::CachedFunctionExecutable::isInStrictContext const): (JSC::CachedFunctionExecutable::hasCapturedVariables const): (JSC::CachedFunctionExecutable::isBuiltinFunction const): (JSC::CachedFunctionExecutable::isBuiltinDefaultClassConstructor const): (JSC::CachedFunctionExecutable::constructAbility const): (JSC::CachedFunctionExecutable::constructorKind const): (JSC::CachedFunctionExecutable::functionMode const): (JSC::CachedFunctionExecutable::scriptMode const): (JSC::CachedFunctionExecutable::superBinding const): (JSC::CachedFunctionExecutable::derivedContextType const): (JSC::CachedFunctionExecutable::name const): (JSC::CachedFunctionExecutable::ecmaName const): (JSC::CachedFunctionExecutable::inferredName const): (JSC::CachedCodeBlock::instructions const): (JSC::CachedCodeBlock::thisRegister const): (JSC::CachedCodeBlock::scopeRegister const): (JSC::CachedCodeBlock::globalObjectRegister const): (JSC::CachedCodeBlock::sourceURLDirective const): (JSC::CachedCodeBlock::sourceMappingURLDirective const): (JSC::CachedCodeBlock::usesEval const): (JSC::CachedCodeBlock::isStrictMode const): (JSC::CachedCodeBlock::isConstructor const): (JSC::CachedCodeBlock::hasCapturedVariables const): (JSC::CachedCodeBlock::isBuiltinFunction const): (JSC::CachedCodeBlock::superBinding const): (JSC::CachedCodeBlock::scriptMode const): (JSC::CachedCodeBlock::isArrowFunctionContext const): (JSC::CachedCodeBlock::isClassContext const): (JSC::CachedCodeBlock::wasCompiledWithDebuggingOpcodes const): (JSC::CachedCodeBlock::constructorKind const): (JSC::CachedCodeBlock::derivedContextType const): (JSC::CachedCodeBlock::evalContextType const): (JSC::CachedCodeBlock::hasTailCalls const): (JSC::CachedCodeBlock::lineCount const): (JSC::CachedCodeBlock::endColumn const): (JSC::CachedCodeBlock::numVars const): (JSC::CachedCodeBlock::numCalleeLocals const): (JSC::CachedCodeBlock::numParameters const): (JSC::CachedCodeBlock::features const): (JSC::CachedCodeBlock::parseMode const): (JSC::CachedCodeBlock::codeType const): (JSC::CachedCodeBlock::rareData const): (JSC::CachedProgramCodeBlock::encode): (JSC::CachedProgramCodeBlock::decode const): (JSC::CachedModuleCodeBlock::encode): (JSC::CachedModuleCodeBlock::decode const): (JSC::CachedEvalCodeBlock::encode): (JSC::CachedEvalCodeBlock::decode const): (JSC::CachedFunctionCodeBlock::encode): (JSC::CachedFunctionCodeBlock::decode const): (JSC::UnlinkedFunctionCodeBlock::UnlinkedFunctionCodeBlock): (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): (JSC::CachedCodeBlock<CodeBlockType>::decode const): (JSC::UnlinkedProgramCodeBlock::UnlinkedProgramCodeBlock): (JSC::UnlinkedModuleProgramCodeBlock::UnlinkedModuleProgramCodeBlock): (JSC::UnlinkedEvalCodeBlock::UnlinkedEvalCodeBlock): (JSC::CachedFunctionExecutable::encode): (JSC::CachedFunctionExecutable::decode const): (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): (JSC::CachedCodeBlock<CodeBlockType>::encode): (JSC::CachedSourceCodeKey::encode): (JSC::CachedSourceCodeKey::decode const): (JSC::CacheEntry::encode): (JSC::CacheEntry:: const): (JSC:: const): (JSC::encodeCodeBlock): (JSC::decodeCodeBlockImpl): * runtime/CachedTypes.h: Copied from Source/JavaScriptCore/bytecode/UnlinkedGlobalCodeBlock.h. (JSC::decodeCodeBlock): * runtime/CodeCache.cpp: (JSC::CodeCacheMap::pruneSlowCase): (JSC::CodeCache::getUnlinkedGlobalCodeBlock): (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): (JSC::CodeCache::write): * runtime/CodeCache.h: (JSC::CodeCacheMap::begin): (JSC::CodeCacheMap::end): (JSC::CodeCacheMap::fetchFromDiskImpl): (JSC::CodeCacheMap::findCacheAndUpdateAge): (JSC::writeCodeBlock): * runtime/JSBigInt.cpp: * runtime/JSBigInt.h: * runtime/Options.cpp: (JSC::recomputeDependentOptions): * runtime/RegExp.h: * runtime/ScopedArgumentsTable.h: * runtime/StackFrame.h: * runtime/StructureInlines.h: * runtime/SymbolTable.h: Source/WTF: BitVectors have to be friends with JSC::CacheBitVector to allow serializing its buffer as part of the bytecode cache encoding. * wtf/BitVector.h: Tools: Add test helper to execute bytecode-cache tests: it executes each test twice, the first with JSC_diskCachePath set to a temporary directory and second with JSC_forceDiskCache=true (in addition to the cache path) to guarantee that only the disk cache is being used and no new UnlinkedCodeBlocks are being created. * Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper.sh: Added. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/208177@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-22 18:00:14 +00:00
namespace JSC {
class CachedBitVector;
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
namespace WTF {
// This is a space-efficient, resizeable bitvector class. In the common case it
// occupies one word, but if necessary, it will inflate this one word to point
// to a single chunk of out-of-line allocated storage to store an arbitrary number
// of bits.
//
// - The bitvector remembers the bound of how many bits can be stored, but this
// may be slightly greater (by as much as some platform-specific constant)
// than the last argument passed to ensureSize().
//
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
// - The bitvector can resize itself automatically (set, clear, get) or can be used
// in a manual mode, which is faster (quickSet, quickClear, quickGet, ensureSize).
//
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
// - Accesses ASSERT that you are within bounds.
//
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
// - Bits are automatically initialized to zero.
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
//
// On the other hand, this BitVector class may not be the fastest around, since
// it does conditionals on every get/set/clear. But it is great if you need to
// juggle a lot of variable-length BitVectors and you're worried about wasting
// space.
[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
class BitVector final {
WTF_MAKE_FAST_ALLOCATED;
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
public:
BitVector()
: m_bitsOrPointer(makeInlineBits(0))
{
}
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
explicit BitVector(size_t numBits)
: m_bitsOrPointer(makeInlineBits(0))
{
ensureSize(numBits);
}
BitVector(const BitVector& other)
: m_bitsOrPointer(makeInlineBits(0))
{
(*this) = other;
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
~BitVector()
{
if (isInline())
return;
OutOfLineBits::destroy(outOfLineBits());
}
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
BitVector& operator=(const BitVector& other)
{
if (isInline() && other.isInline())
m_bitsOrPointer = other.m_bitsOrPointer;
else
setSlow(other);
return *this;
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
size_t size() const
{
if (isInline())
return maxInlineBits();
return outOfLineBits()->numBits();
}
void ensureSize(size_t numBits)
{
if (numBits <= size())
return;
resizeOutOfLine(numBits);
}
// Like ensureSize(), but supports reducing the size of the bitvector.
WTF_EXPORT_PRIVATE void resize(size_t numBits);
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
WTF_EXPORT_PRIVATE void clearAll();
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
bool quickGet(size_t bit) const
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
{
Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access https://bugs.webkit.org/show_bug.cgi?id=108981 Reviewed by Eric Seidel. Source/WebCore: * Modules/mediastream/RTCStatsResponse.cpp: (WebCore::RTCStatsResponse::addElement): (WebCore::RTCStatsResponse::addStatistic): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression): (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression): * css/WebKitCSSTransformValue.cpp: (WebCore::transformValueToCssString): * editing/TextIterator.cpp: (WebCore::SearchBuffer::search): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::getSomeData): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): * platform/graphics/Region.cpp: (WebCore::Region::Shape::segments_end): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::getValues): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): * platform/text/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::checkFloatsInCleanLine): * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentForSpline): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::findInstanceTime): Source/WebKit/chromium: * src/AutofillPopupMenuClient.cpp: (WebKit::AutofillPopupMenuClient::getSuggestion): (WebKit::AutofillPopupMenuClient::getLabel): (WebKit::AutofillPopupMenuClient::getIcon): (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): (WebKit::AutofillPopupMenuClient::valueChanged): (WebKit::AutofillPopupMenuClient::selectionChanged): * src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal): Source/WTF: * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/SegmentedVector.h: (WTF::SegmentedVector::ensureSegment): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::vprintf): * wtf/Vector.h: (WTF::::insert): (WTF::::remove): * wtf/dtoa/utils.h: (WTF::double_conversion::StringBuilder::SetPosition): (WTF::double_conversion::StringBuilder::AddSubstring): Canonical link: https://commits.webkit.org/127675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 08:06:45 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(bit < size());
return !!(bits()[bit / bitsInPointer()] & (static_cast<uintptr_t>(1) << (bit & (bitsInPointer() - 1))));
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool quickSet(size_t bit)
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
{
Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access https://bugs.webkit.org/show_bug.cgi?id=108981 Reviewed by Eric Seidel. Source/WebCore: * Modules/mediastream/RTCStatsResponse.cpp: (WebCore::RTCStatsResponse::addElement): (WebCore::RTCStatsResponse::addStatistic): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression): (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression): * css/WebKitCSSTransformValue.cpp: (WebCore::transformValueToCssString): * editing/TextIterator.cpp: (WebCore::SearchBuffer::search): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::getSomeData): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): * platform/graphics/Region.cpp: (WebCore::Region::Shape::segments_end): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::getValues): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): * platform/text/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::checkFloatsInCleanLine): * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentForSpline): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::findInstanceTime): Source/WebKit/chromium: * src/AutofillPopupMenuClient.cpp: (WebKit::AutofillPopupMenuClient::getSuggestion): (WebKit::AutofillPopupMenuClient::getLabel): (WebKit::AutofillPopupMenuClient::getIcon): (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): (WebKit::AutofillPopupMenuClient::valueChanged): (WebKit::AutofillPopupMenuClient::selectionChanged): * src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal): Source/WTF: * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/SegmentedVector.h: (WTF::SegmentedVector::ensureSegment): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::vprintf): * wtf/Vector.h: (WTF::::insert): (WTF::::remove): * wtf/dtoa/utils.h: (WTF::double_conversion::StringBuilder::SetPosition): (WTF::double_conversion::StringBuilder::AddSubstring): Canonical link: https://commits.webkit.org/127675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 08:06:45 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(bit < size());
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
uintptr_t& word = bits()[bit / bitsInPointer()];
uintptr_t mask = static_cast<uintptr_t>(1) << (bit & (bitsInPointer() - 1));
bool result = !!(word & mask);
word |= mask;
return result;
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool quickClear(size_t bit)
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
{
Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access https://bugs.webkit.org/show_bug.cgi?id=108981 Reviewed by Eric Seidel. Source/WebCore: * Modules/mediastream/RTCStatsResponse.cpp: (WebCore::RTCStatsResponse::addElement): (WebCore::RTCStatsResponse::addStatistic): * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::skipBuffer): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression): (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression): * css/WebKitCSSTransformValue.cpp: (WebCore::transformValueToCssString): * editing/TextIterator.cpp: (WebCore::SearchBuffer::search): * html/HTMLElement.cpp: (WebCore::parseColorStringWithCrazyLegacyRules): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/shadow/DateTimeSymbolicFieldElement.cpp: (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement): * html/track/TextTrackCueList.cpp: (WebCore::TextTrackCueList::add): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::getSomeData): * platform/SharedBufferChunkReader.cpp: (WebCore::SharedBufferChunkReader::nextChunk): * platform/audio/HRTFDatabase.cpp: (WebCore::HRTFDatabase::getKernelsFromAzimuthElevation): * platform/graphics/GlyphPageTreeNode.cpp: (WebCore::GlyphPageTreeNode::initializePage): * platform/graphics/Region.cpp: (WebCore::Region::Shape::segments_end): * platform/graphics/filters/FEComponentTransfer.cpp: (WebCore::FEComponentTransfer::getValues): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::inputEffect): * platform/text/TextCodecUTF8.cpp: (WebCore::TextCodecUTF8::decode): * platform/text/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode): * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlock::checkFloatsInCleanLine): * svg/SVGAnimatedTypeAnimator.h: (WebCore::SVGAnimatedTypeAnimator::executeAction): * svg/SVGAnimationElement.cpp: (WebCore::SVGAnimationElement::calculatePercentForSpline): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::findInstanceTime): Source/WebKit/chromium: * src/AutofillPopupMenuClient.cpp: (WebKit::AutofillPopupMenuClient::getSuggestion): (WebKit::AutofillPopupMenuClient::getLabel): (WebKit::AutofillPopupMenuClient::getIcon): (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): (WebKit::AutofillPopupMenuClient::valueChanged): (WebKit::AutofillPopupMenuClient::selectionChanged): * src/ChromeClientImpl.cpp: (WebKit::ChromeClientImpl::shouldRunModalDialogDuringPageDismissal): Source/WTF: * wtf/BitVector.h: (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): * wtf/DecimalNumber.h: (WTF::DecimalNumber::DecimalNumber): * wtf/SegmentedVector.h: (WTF::SegmentedVector::ensureSegment): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::vprintf): * wtf/Vector.h: (WTF::::insert): (WTF::::remove): * wtf/dtoa/utils.h: (WTF::double_conversion::StringBuilder::SetPosition): (WTF::double_conversion::StringBuilder::AddSubstring): Canonical link: https://commits.webkit.org/127675@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-02-11 08:06:45 +00:00
ASSERT_WITH_SECURITY_IMPLICATION(bit < size());
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
uintptr_t& word = bits()[bit / bitsInPointer()];
uintptr_t mask = static_cast<uintptr_t>(1) << (bit & (bitsInPointer() - 1));
bool result = !!(word & mask);
word &= ~mask;
return result;
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool quickSet(size_t bit, bool value)
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
{
if (value)
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
return quickSet(bit);
return quickClear(bit);
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
}
bool get(size_t bit) const
{
if (bit >= size())
return false;
return quickGet(bit);
}
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
bool contains(size_t bit) const
{
return get(bit);
}
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool set(size_t bit)
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
{
ensureSize(bit + 1);
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
return quickSet(bit);
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
}
cssText should use shorthand notations https://bugs.webkit.org/show_bug.cgi?id=81737 Reviewed by Enrica Casucci. Source/JavaScriptCore: Export symbols of BitVector on Windows. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WebCore: Use shorthand properties to serialize style properties for cssText. The overall algorithm is to look for any property that has a shorthand, and then check if the shorthand value could be obtained (the condition is quite complicated for border properties). If it could, then append that value to the string builder, and set the corresponding entries in shorthandPropertyAppeared and shorthandPropertyUsed. If not, only turn on the bit in shorthandPropertyAppeared on to avoid calling getPropertyValue again for longhand properties that use the same shorthand property when we cannot use the shorthand. Test: fast/css/cssText-shorthand.html * css/StylePropertySet.cpp: (WebCore::StylePropertySet::asText): Source/WTF: * wtf/BitVector.h: (BitVector): (WTF::BitVector::ensureSizeAndSet): Added. LayoutTests: Rebaseline existing tests and add a regression test for unprefixed CSS properties with the exception of -webkit-border-horizontal/vertical-spacing (the shorthand version of these properties (border-spacing) is unprefixed. * editing/pasteboard/paste-and-sanitize-expected.txt: Uses border instead of longhand properties as desired. * editing/pasteboard/paste-and-sanitize.html: * editing/style/non-inheritable-styles-expected.txt: Ditto. * fast/css/background-position-serialize-expected.txt: No longer emits "background-*: initial" as desired. * fast/css/cssText-shorthand-expected.txt: Added. * fast/css/cssText-shorthand.html: Added. * fast/css/remove-shorthand-expected.txt: * fast/css/remove-shorthand.html: Modified to do elaborative comparison of the lists of properties before and after removing a shorthand since now removing a shorthand property may end up adding new longhand property. * fast/css/uri-token-parsing-expected.txt: * fast/css/uri-token-parsing.html: Uses shorthand properties instead of longhand equivalents. * inspector/styles/styles-update-from-js-expected.txt: Ditto. * printing/page-rule-css-text-expected.txt: Ditto. Canonical link: https://commits.webkit.org/99614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-26 23:59:27 +00:00
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
// This works like the add methods of sets. Instead of returning the previous value, like set(),
// it returns whether the bit transitioned from false to true.
bool add(size_t bit)
{
return !set(bit);
}
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool ensureSizeAndSet(size_t bit, size_t size)
cssText should use shorthand notations https://bugs.webkit.org/show_bug.cgi?id=81737 Reviewed by Enrica Casucci. Source/JavaScriptCore: Export symbols of BitVector on Windows. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WebCore: Use shorthand properties to serialize style properties for cssText. The overall algorithm is to look for any property that has a shorthand, and then check if the shorthand value could be obtained (the condition is quite complicated for border properties). If it could, then append that value to the string builder, and set the corresponding entries in shorthandPropertyAppeared and shorthandPropertyUsed. If not, only turn on the bit in shorthandPropertyAppeared on to avoid calling getPropertyValue again for longhand properties that use the same shorthand property when we cannot use the shorthand. Test: fast/css/cssText-shorthand.html * css/StylePropertySet.cpp: (WebCore::StylePropertySet::asText): Source/WTF: * wtf/BitVector.h: (BitVector): (WTF::BitVector::ensureSizeAndSet): Added. LayoutTests: Rebaseline existing tests and add a regression test for unprefixed CSS properties with the exception of -webkit-border-horizontal/vertical-spacing (the shorthand version of these properties (border-spacing) is unprefixed. * editing/pasteboard/paste-and-sanitize-expected.txt: Uses border instead of longhand properties as desired. * editing/pasteboard/paste-and-sanitize.html: * editing/style/non-inheritable-styles-expected.txt: Ditto. * fast/css/background-position-serialize-expected.txt: No longer emits "background-*: initial" as desired. * fast/css/cssText-shorthand-expected.txt: Added. * fast/css/cssText-shorthand.html: Added. * fast/css/remove-shorthand-expected.txt: * fast/css/remove-shorthand.html: Modified to do elaborative comparison of the lists of properties before and after removing a shorthand since now removing a shorthand property may end up adding new longhand property. * fast/css/uri-token-parsing-expected.txt: * fast/css/uri-token-parsing.html: Uses shorthand properties instead of longhand equivalents. * inspector/styles/styles-update-from-js-expected.txt: Ditto. * printing/page-rule-css-text-expected.txt: Ditto. Canonical link: https://commits.webkit.org/99614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-26 23:59:27 +00:00
{
ensureSize(size);
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
return quickSet(bit);
cssText should use shorthand notations https://bugs.webkit.org/show_bug.cgi?id=81737 Reviewed by Enrica Casucci. Source/JavaScriptCore: Export symbols of BitVector on Windows. * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: Source/WebCore: Use shorthand properties to serialize style properties for cssText. The overall algorithm is to look for any property that has a shorthand, and then check if the shorthand value could be obtained (the condition is quite complicated for border properties). If it could, then append that value to the string builder, and set the corresponding entries in shorthandPropertyAppeared and shorthandPropertyUsed. If not, only turn on the bit in shorthandPropertyAppeared on to avoid calling getPropertyValue again for longhand properties that use the same shorthand property when we cannot use the shorthand. Test: fast/css/cssText-shorthand.html * css/StylePropertySet.cpp: (WebCore::StylePropertySet::asText): Source/WTF: * wtf/BitVector.h: (BitVector): (WTF::BitVector::ensureSizeAndSet): Added. LayoutTests: Rebaseline existing tests and add a regression test for unprefixed CSS properties with the exception of -webkit-border-horizontal/vertical-spacing (the shorthand version of these properties (border-spacing) is unprefixed. * editing/pasteboard/paste-and-sanitize-expected.txt: Uses border instead of longhand properties as desired. * editing/pasteboard/paste-and-sanitize.html: * editing/style/non-inheritable-styles-expected.txt: Ditto. * fast/css/background-position-serialize-expected.txt: No longer emits "background-*: initial" as desired. * fast/css/cssText-shorthand-expected.txt: Added. * fast/css/cssText-shorthand.html: Added. * fast/css/remove-shorthand-expected.txt: * fast/css/remove-shorthand.html: Modified to do elaborative comparison of the lists of properties before and after removing a shorthand since now removing a shorthand property may end up adding new longhand property. * fast/css/uri-token-parsing-expected.txt: * fast/css/uri-token-parsing.html: Uses shorthand properties instead of longhand equivalents. * inspector/styles/styles-update-from-js-expected.txt: Ditto. * printing/page-rule-css-text-expected.txt: Ditto. Canonical link: https://commits.webkit.org/99614@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112177 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-26 23:59:27 +00:00
}
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool clear(size_t bit)
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
{
if (bit >= size())
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
return false;
return quickClear(bit);
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
}
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
bool remove(size_t bit)
{
return clear(bit);
}
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
bool set(size_t bit, bool value)
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
{
if (value)
DFG should compute immediate dominators using the O(n log n) form of Lengauer and Tarjan's "A Fast Algorithm for Finding Dominators in a Flowgraph" https://bugs.webkit.org/show_bug.cgi?id=93361 Reviewed by Mark Hahnenberg. Source/JavaScriptCore: This patch also adds some new utilities for reasoning about block-keyed maps, block sets, and block worklists. It changes preexisting code to use these abstractions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGAnalysis.h: (JSC::DFG::Analysis::computeIfNecessary): (JSC::DFG::Analysis::computeDependencies): * dfg/DFGBlockMap.h: Added. (JSC::DFG::BlockMap::BlockMap): (JSC::DFG::BlockMap::size): (JSC::DFG::BlockMap::atIndex): (JSC::DFG::BlockMap::operator[]): * dfg/DFGBlockMapInlines.h: Added. (JSC::DFG::BlockMap<T>::BlockMap): * dfg/DFGBlockSet.h: Added. (JSC::DFG::BlockSet::BlockSet): (JSC::DFG::BlockSet::add): (JSC::DFG::BlockSet::contains): * dfg/DFGBlockWorklist.cpp: Added. (JSC::DFG::BlockWorklist::BlockWorklist): (JSC::DFG::BlockWorklist::~BlockWorklist): (JSC::DFG::BlockWorklist::push): (JSC::DFG::BlockWorklist::pop): (JSC::DFG::PostOrderBlockWorklist::PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::~PostOrderBlockWorklist): (JSC::DFG::PostOrderBlockWorklist::pushPre): (JSC::DFG::PostOrderBlockWorklist::pushPost): (JSC::DFG::PostOrderBlockWorklist::pop): * dfg/DFGBlockWorklist.h: Added. (JSC::DFG::BlockWorklist::notEmpty): (JSC::DFG::BlockWith::BlockWith): (JSC::DFG::BlockWith::operator UnspecifiedBoolType*): (JSC::DFG::ExtendedBlockWorklist::ExtendedBlockWorklist): (JSC::DFG::ExtendedBlockWorklist::forcePush): (JSC::DFG::ExtendedBlockWorklist::push): (JSC::DFG::ExtendedBlockWorklist::notEmpty): (JSC::DFG::ExtendedBlockWorklist::pop): (JSC::DFG::BlockWithOrder::BlockWithOrder): (JSC::DFG::BlockWithOrder::operator UnspecifiedBoolType*): (JSC::DFG::PostOrderBlockWorklist::push): (JSC::DFG::PostOrderBlockWorklist::notEmpty): * dfg/DFGCSEPhase.cpp: * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::compute): (JSC::DFG::Dominators::naiveDominates): (JSC::DFG::Dominators::dump): (JSC::DFG::Dominators::pruneDominators): Deleted. * dfg/DFGDominators.h: (JSC::DFG::Dominators::strictlyDominates): (JSC::DFG::Dominators::dominates): (JSC::DFG::Dominators::BlockData::BlockData): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): (JSC::DFG::Graph::getBlocksInPreOrder): (JSC::DFG::Graph::getBlocksInPostOrder): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): * dfg/DFGNaiveDominators.cpp: Added. (JSC::DFG::NaiveDominators::NaiveDominators): (JSC::DFG::NaiveDominators::~NaiveDominators): (JSC::DFG::NaiveDominators::compute): (JSC::DFG::NaiveDominators::pruneDominators): (JSC::DFG::NaiveDominators::dump): * dfg/DFGNaiveDominators.h: Added. (JSC::DFG::NaiveDominators::dominates): * dfg/DFGNaturalLoops.cpp: (JSC::DFG::NaturalLoops::computeDependencies): (JSC::DFG::NaturalLoops::compute): * dfg/DFGNaturalLoops.h: Source/WTF: Make BitVector operations return the previous value of the bit you're changing. This is useful for the kinds of set operations that are commonplace in compiler graph searches. * wtf/BitVector.h: (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::set): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): Canonical link: https://commits.webkit.org/154174@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-08-28 19:23:02 +00:00
return set(bit);
return clear(bit);
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries https://bugs.webkit.org/show_bug.cgi?id=123076 Source/JavaScriptCore: Reviewed by Sam Weinig. Start preparing for a world in which we are patching code generated by LLVM, which may have very different register usage conventions than our JITs. This requires us being more explicit about the registers we are using. For example, the repatching code shouldn't take for granted that tagMaskRegister holds the TagMask or that the register is even in use. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.h: (JSC::MacroAssembler::numberOfRegisters): (JSC::MacroAssembler::registerIndex): (JSC::MacroAssembler::numberOfFPRegisters): (JSC::MacroAssembler::fpRegisterIndex): (JSC::MacroAssembler::totalNumberOfRegisters): * bytecode/StructureStubInfo.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::usedRegisters): * dfg/DFGSpeculativeJIT.h: * ftl/FTLSaveRestore.cpp: (JSC::FTL::bytesForGPRs): (JSC::FTL::bytesForFPRs): (JSC::FTL::offsetOfGPR): (JSC::FTL::offsetOfFPR): * jit/JITInlineCacheGenerator.cpp: (JSC::JITByIdGenerator::JITByIdGenerator): (JSC::JITPutByIdGenerator::JITPutByIdGenerator): * jit/JITInlineCacheGenerator.h: (JSC::JITGetByIdGenerator::JITGetByIdGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/RegisterSet.cpp: Added. (JSC::RegisterSet::specialRegisters): * jit/RegisterSet.h: Added. (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::set): (JSC::RegisterSet::clear): (JSC::RegisterSet::get): (JSC::RegisterSet::merge): * jit/Repatch.cpp: (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::tryRepatchIn): (JSC::linkClosureCall): * jit/TempRegisterSet.cpp: Added. (JSC::TempRegisterSet::TempRegisterSet): * jit/TempRegisterSet.h: Source/WTF: Reviewed by Sam Weinig. Teach BitVector how to efficiently merge (i.e. bitvector |=). * wtf/BitVector.cpp: (WTF::BitVector::mergeSlow): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::cleanseInlineBits): Canonical link: https://commits.webkit.org/141168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-21 04:48:29 +00:00
void merge(const BitVector& other)
{
if (!isInline() || !other.isInline()) {
mergeSlow(other);
return;
}
m_bitsOrPointer |= other.m_bitsOrPointer;
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
ASSERT(isInline());
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries https://bugs.webkit.org/show_bug.cgi?id=123076 Source/JavaScriptCore: Reviewed by Sam Weinig. Start preparing for a world in which we are patching code generated by LLVM, which may have very different register usage conventions than our JITs. This requires us being more explicit about the registers we are using. For example, the repatching code shouldn't take for granted that tagMaskRegister holds the TagMask or that the register is even in use. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.h: (JSC::MacroAssembler::numberOfRegisters): (JSC::MacroAssembler::registerIndex): (JSC::MacroAssembler::numberOfFPRegisters): (JSC::MacroAssembler::fpRegisterIndex): (JSC::MacroAssembler::totalNumberOfRegisters): * bytecode/StructureStubInfo.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::usedRegisters): * dfg/DFGSpeculativeJIT.h: * ftl/FTLSaveRestore.cpp: (JSC::FTL::bytesForGPRs): (JSC::FTL::bytesForFPRs): (JSC::FTL::offsetOfGPR): (JSC::FTL::offsetOfFPR): * jit/JITInlineCacheGenerator.cpp: (JSC::JITByIdGenerator::JITByIdGenerator): (JSC::JITPutByIdGenerator::JITPutByIdGenerator): * jit/JITInlineCacheGenerator.h: (JSC::JITGetByIdGenerator::JITGetByIdGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/RegisterSet.cpp: Added. (JSC::RegisterSet::specialRegisters): * jit/RegisterSet.h: Added. (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::set): (JSC::RegisterSet::clear): (JSC::RegisterSet::get): (JSC::RegisterSet::merge): * jit/Repatch.cpp: (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::tryRepatchIn): (JSC::linkClosureCall): * jit/TempRegisterSet.cpp: Added. (JSC::TempRegisterSet::TempRegisterSet): * jit/TempRegisterSet.h: Source/WTF: Reviewed by Sam Weinig. Teach BitVector how to efficiently merge (i.e. bitvector |=). * wtf/BitVector.cpp: (WTF::BitVector::mergeSlow): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::cleanseInlineBits): Canonical link: https://commits.webkit.org/141168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-21 04:48:29 +00:00
}
Switch FTL GetById/PutById IC's over to using AnyRegCC https://bugs.webkit.org/show_bug.cgi?id=124094 Source/JavaScriptCore: Reviewed by Sam Weinig. This closes the loop on inline caches (IC's) in the FTL. The goal is to have IC's in LLVM-generated code that are just as efficient (if not more so) than what a custom JIT could do. As in zero sources of overhead. Not a single extra instruction or even register allocation pathology. We accomplish this by having two thingies in LLVM. First is the llvm.experimental.patchpoint intrinsic, which is sort of an inline machine code snippet that we can fill in with whatever we want and then modify subsequently. But you have only two choices of how to pass values to a patchpoint: (1) via the calling convention or (2) via the stackmap. Neither are good for operands to an IC (like the base pointer for a GetById, for example). (1) is bad because it results in things being pinned to certain registers a priori; a custom JIT (like the DFG) will not pin IC operands to any registers a priori but will allow the register allocator to do whatever it wants. (2) is bad because the operands may be spilled or may be represented in other crazy ways. You generally want an IC to have its operands in registers. Also, patchpoints only return values using the calling convention, which is unfortunate since it pins the return value to a register a priori. This is where the second thingy comes in: the AnyRegCC. This is a special calling convention only for use with patchpoints. It means that arguments passed "by CC" in the patchpoint can be placed in any register, and the register that gets used is reported as part of the stackmap. It also means that the return value (if there is one) can be placed in any register, and the stackmap will tell you which one it was. Thus, patchpoints combined with AnyRegCC mean that you not only get the kind of self-modifying code that you want for IC's, but you also get all of the register allocation goodness that a custom JIT would have given you. Except that you're getting it from LLVM and not a custom JIT. Awesome. Even though all of the fun stuff is on the LLVM side, this patch was harder than you'd expect. First the obvious bits: - IC patchpoints now use AnyRegCC instead of the C CC. (CC = calling convention.) - FTL::fixFunctionBasedOnStackMaps() now correctly figures out which registers the IC is supposed to use instead of assuming C CC argument registers. And then all of the stuff that broke and that this patch fixes: - IC sizing based on generating a dummy IC (what FTLInlineCacheSize did) is totally bad on x86-64, where various register permutations lead to bizarre header bytes and eclectic SIB encodings. I changed that to have magic constants, for now. - Slow path calls didn't preserve the CC return register. - Repatch's scratch register allocation would get totally confused if the operand registers weren't one of the DFG-style "temp" registers. And by "totally confused" I mean that it would crash. - We assumed that r10 is callee-saved. It's not. That one dude's PPT about x86-64 cdecl that I found on the intertubes was not a trustworthy source of information, apparently. - Call repatching didn't know that the FTL does its IC slow calls via specially generated thunks. This was particularly fun to fix: basically, now when we relink an IC call in the FTL, we use the old call target to find the SlowPathCallKey, which tells us everything we need to know to generate (or look up) a new thunk for the new function we want to call. * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::isEmptyValue): (JSC::MacroAssemblerCodePtr::isDeletedValue): (JSC::MacroAssemblerCodePtr::hash): (JSC::MacroAssemblerCodePtr::emptyValue): (JSC::MacroAssemblerCodePtr::deletedValue): (JSC::MacroAssemblerCodePtrHash::hash): (JSC::MacroAssemblerCodePtrHash::equal): * assembler/MacroAssemblerX86Common.h: * assembler/RepatchBuffer.h: (JSC::RepatchBuffer::RepatchBuffer): (JSC::RepatchBuffer::codeBlock): * ftl/FTLAbbreviations.h: (JSC::FTL::setInstructionCallingConvention): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheSize.cpp: (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLLocation.cpp: (JSC::FTL::Location::forStackmaps): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): (JSC::FTL::LowerDFGToLLVM::compilePutById): * ftl/FTLOSRExitCompiler.cpp: (JSC::FTL::compileStub): * ftl/FTLSlowPathCall.cpp: * ftl/FTLSlowPathCallKey.h: (JSC::FTL::SlowPathCallKey::withCallTarget): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): (JSC::FTL::StackMaps::Location::restoreInto): * ftl/FTLStackMaps.h: * ftl/FTLThunks.h: (JSC::FTL::generateIfNecessary): (JSC::FTL::keyForThunk): (JSC::FTL::Thunks::keyForSlowPathCallThunk): * jit/FPRInfo.h: (JSC::FPRInfo::toIndex): * jit/GPRInfo.h: (JSC::GPRInfo::toIndex): (JSC::GPRInfo::debugName): * jit/RegisterSet.cpp: (JSC::RegisterSet::calleeSaveRegisters): * jit/RegisterSet.h: (JSC::RegisterSet::filter): * jit/Repatch.cpp: (JSC::readCallTarget): (JSC::repatchCall): (JSC::repatchByIdSelfAccess): (JSC::tryCacheGetByID): (JSC::tryCachePutByID): (JSC::tryBuildPutByIdList): (JSC::resetGetByID): (JSC::resetPutByID): * jit/ScratchRegisterAllocator.h: (JSC::ScratchRegisterAllocator::lock): Source/WTF: Reviewed by Sam Weinig. I needed to add another set operation, namely filter(), which is an in-place set intersection. * wtf/BitVector.cpp: (WTF::BitVector::filterSlow): * wtf/BitVector.h: (WTF::BitVector::filter): Canonical link: https://commits.webkit.org/142336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-11 07:30:50 +00:00
void filter(const BitVector& other)
{
if (!isInline() || !other.isInline()) {
filterSlow(other);
return;
}
m_bitsOrPointer &= other.m_bitsOrPointer;
ASSERT(isInline());
}
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
void exclude(const BitVector& other)
{
if (!isInline() || !other.isInline()) {
excludeSlow(other);
return;
}
m_bitsOrPointer &= ~other.m_bitsOrPointer;
m_bitsOrPointer |= (static_cast<uintptr_t>(1) << maxInlineBits());
ASSERT(isInline());
}
size_t bitCount() const
{
if (isInline())
return bitCount(cleanseInlineBits(m_bitsOrPointer));
return bitCountSlow();
}
bool isEmpty() const
{
if (isInline())
return !cleanseInlineBits(m_bitsOrPointer);
return isEmptySlow();
}
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
Beef up the DFG's CFG analyses to include iterated dominance frontiers and more user-friendly BlockSets https://bugs.webkit.org/show_bug.cgi?id=136520 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add code to compute iterated dominance frontiers. This involves using BlockSet a lot, so this patch also makes BlockSet a lot more user-friendly. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGBasicBlock.h: * dfg/DFGBlockSet.cpp: Added. (JSC::DFG::BlockSet::dump): * dfg/DFGBlockSet.h: (JSC::DFG::BlockSet::iterator::iterator): (JSC::DFG::BlockSet::iterator::operator++): (JSC::DFG::BlockSet::iterator::operator==): (JSC::DFG::BlockSet::iterator::operator!=): (JSC::DFG::BlockSet::Iterable::Iterable): (JSC::DFG::BlockSet::Iterable::begin): (JSC::DFG::BlockSet::Iterable::end): (JSC::DFG::BlockSet::iterable): (JSC::DFG::BlockAdder::BlockAdder): (JSC::DFG::BlockAdder::operator()): * dfg/DFGBlockSetInlines.h: Added. (JSC::DFG::BlockSet::iterator::operator*): * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::strictDominatorsOf): (JSC::DFG::Dominators::dominatorsOf): (JSC::DFG::Dominators::blocksStrictlyDominatedBy): (JSC::DFG::Dominators::blocksDominatedBy): (JSC::DFG::Dominators::dominanceFrontierOf): (JSC::DFG::Dominators::iteratedDominanceFrontierOf): * dfg/DFGDominators.h: (JSC::DFG::Dominators::forAllStrictDominatorsOf): (JSC::DFG::Dominators::forAllDominatorsOf): (JSC::DFG::Dominators::forAllBlocksStrictlyDominatedBy): (JSC::DFG::Dominators::forAllBlocksDominatedBy): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOfImpl): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): Source/WTF: Give BitVector a way to quickly find the next set (or unset) bit. Make BitVector equality faster. Fix a minor closure goof in Spectrum. * wtf/BitVector.cpp: (WTF::BitVector::equalsSlowCase): (WTF::BitVector::equalsSlowCaseFast): (WTF::BitVector::equalsSlowCaseSimple): * wtf/BitVector.h: (WTF::BitVector::findBit): (WTF::BitVector::findBitFast): (WTF::BitVector::findBitSimple): (WTF::BitVector::findBitInWord): * wtf/Spectrum.h: (WTF::Spectrum::removeIf): Canonical link: https://commits.webkit.org/154343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-04 21:08:38 +00:00
size_t findBit(size_t index, bool value) const
{
size_t result = findBitFast(index, value);
PerformanceTests: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * JetStream2/wasm/HashSet.cpp: * StitchMarker/wtf/Assertions.h: * StitchMarker/wtf/DateMath.cpp: (WTF::initializeDates): * StitchMarker/wtf/HashTable.h: * StitchMarker/wtf/Hasher.h: (WTF::StringHasher::addCharacters): * StitchMarker/wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * StitchMarker/wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * StitchMarker/wtf/ValueCheck.h: * StitchMarker/wtf/Vector.h: (WTF::minCapacity>::checkConsistency): * StitchMarker/wtf/text/AtomicStringImpl.cpp: * StitchMarker/wtf/text/AtomicStringImpl.h: * StitchMarker/wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * StitchMarker/wtf/text/StringImpl.h: * StitchMarker/wtf/text/SymbolImpl.h: * StitchMarker/wtf/text/UniquedStringImpl.h: Source/JavaScriptCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * API/tests/testapi.c: * assembler/ARM64Assembler.h: (JSC::ARM64Assembler::replaceWithLoad): (JSC::ARM64Assembler::replaceWithAddressComputation): * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::LocalWriter::LocalWriter): * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::copyCompactAndLinkCode): * assembler/ProbeStack.cpp: (JSC::Probe::Stack::Stack): * assembler/ProbeStack.h: * b3/B3FoldPathConstants.cpp: * b3/B3LowerToAir.cpp: * b3/B3MemoryValue.cpp: (JSC::B3::MemoryValue::MemoryValue): * b3/B3Opcode.cpp: * b3/B3Type.h: * b3/B3TypeMap.h: * b3/B3Width.h: * b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * b3/air/AirAllocateRegistersAndStackAndGenerateCode.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.cpp: * b3/air/AirArg.h: * b3/air/AirCode.h: * b3/air/AirEmitShuffle.cpp: (JSC::B3::Air::emitShuffle): * builtins/BuiltinExecutables.cpp: (JSC::BuiltinExecutables::createExecutable): * bytecode/AccessCase.cpp: * bytecode/AccessCase.h: * bytecode/CallVariant.cpp: (JSC::variantListWithVariant): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex): * bytecode/CodeBlockHash.cpp: (JSC::CodeBlockHash::dump const): * bytecode/StructureStubInfo.cpp: * bytecode/StructureStubInfo.h: * bytecompiler/NodesCodegen.cpp: (JSC::FunctionCallResolveNode::emitBytecode): * bytecompiler/RegisterID.h: (JSC::RegisterID::RegisterID): (JSC::RegisterID::setIndex): * debugger/Debugger.cpp: (JSC::Debugger::removeBreakpoint): * debugger/DebuggerEvalEnabler.h: (JSC::DebuggerEvalEnabler::DebuggerEvalEnabler): (JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler): * dfg/DFGAbstractInterpreterInlines.h: (JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions): * dfg/DFGAbstractValue.cpp: * dfg/DFGAbstractValue.h: (JSC::DFG::AbstractValue::merge): (JSC::DFG::AbstractValue::checkConsistency const): (JSC::DFG::AbstractValue::assertIsRegistered const): * dfg/DFGArithMode.h: (JSC::DFG::doesOverflow): * dfg/DFGBasicBlock.cpp: (JSC::DFG::BasicBlock::BasicBlock): * dfg/DFGBasicBlock.h: (JSC::DFG::BasicBlock::didLink): * dfg/DFGCFAPhase.cpp: (JSC::DFG::CFAPhase::performBlockCFA): * dfg/DFGCommon.h: (JSC::DFG::validationEnabled): * dfg/DFGCommonData.cpp: (JSC::DFG::CommonData::finalizeCatchEntrypoints): * dfg/DFGDesiredWatchpoints.h: * dfg/DFGDoesGC.cpp: (JSC::DFG::doesGC): * dfg/DFGEdge.h: (JSC::DFG::Edge::makeWord): * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGJITCode.cpp: (JSC::DFG::JITCode::finalizeOSREntrypoints): * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGSSAConversionPhase.cpp: (JSC::DFG::SSAConversionPhase::run): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::assertClear): * dfg/DFGSlowPathGenerator.h: (JSC::DFG::SlowPathGenerator::generate): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileCurrentBlock): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): (JSC::DFG::SpeculativeJIT::emitAllocateButterfly): (JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize): (JSC::DFG::SpeculativeJIT::compileMakeRope): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::fillSpeculateCell): * dfg/DFGStructureAbstractValue.cpp: * dfg/DFGStructureAbstractValue.h: (JSC::DFG::StructureAbstractValue::assertIsRegistered const): * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVirtualRegisterAllocationPhase.cpp: (JSC::DFG::VirtualRegisterAllocationPhase::run): * ftl/FTLLink.cpp: (JSC::FTL::link): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::callPreflight): (JSC::FTL::DFG::LowerDFGToB3::callCheck): (JSC::FTL::DFG::LowerDFGToB3::crash): * ftl/FTLOperations.cpp: (JSC::FTL::operationMaterializeObjectInOSR): * heap/BlockDirectory.cpp: (JSC::BlockDirectory::assertNoUnswept): * heap/GCSegmentedArray.h: (JSC::GCArraySegment::GCArraySegment): * heap/GCSegmentedArrayInlines.h: (JSC::GCSegmentedArray<T>::clear): (JSC::GCSegmentedArray<T>::expand): (JSC::GCSegmentedArray<T>::validatePrevious): * heap/HandleSet.cpp: * heap/HandleSet.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/MarkedBlock.cpp: * heap/MarkedBlock.h: (JSC::MarkedBlock::assertValidCell const): (JSC::MarkedBlock::assertMarksNotStale): * heap/MarkedSpace.cpp: (JSC::MarkedSpace::beginMarking): (JSC::MarkedSpace::endMarking): (JSC::MarkedSpace::assertNoUnswept): * heap/PreciseAllocation.cpp: * heap/PreciseAllocation.h: (JSC::PreciseAllocation::assertValidCell const): * heap/SlotVisitor.cpp: (JSC::SlotVisitor::SlotVisitor): (JSC::SlotVisitor::appendJSCellOrAuxiliary): * heap/SlotVisitor.h: * inspector/InspectorProtocolTypes.h: (Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType): * inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py: (CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration): (CppProtocolTypesImplementationGenerator): (CppProtocolTypesImplementationGenerator._generate_assertion_for_enum): * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: * interpreter/FrameTracers.h: (JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer): * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): * interpreter/Interpreter.h: * jit/AssemblyHelpers.cpp: (JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo): * jit/AssemblyHelpers.h: (JSC::AssemblyHelpers::prepareCallOperation): * jit/BinarySwitch.cpp: (JSC::BinarySwitch::BinarySwitch): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupStubArgs): * jit/CallFrameShuffler.cpp: (JSC::CallFrameShuffler::emitDeltaCheck): (JSC::CallFrameShuffler::prepareAny): * jit/JIT.cpp: (JSC::JIT::assertStackPointerOffset): (JSC::JIT::compileWithoutLinking): * jit/JITOpcodes.cpp: (JSC::JIT::emitSlow_op_loop_hint): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_from_scope): * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::emitPointerValidation): * llint/LLIntData.cpp: (JSC::LLInt::Data::performAssertions): * llint/LLIntOfflineAsmConfig.h: * parser/Lexer.cpp: * parser/Lexer.h: (JSC::isSafeBuiltinIdentifier): (JSC::Lexer<T>::lexExpectIdentifier): * runtime/ArgList.h: (JSC::MarkedArgumentBuffer::setNeedsOverflowCheck): (JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck): * runtime/Butterfly.h: (JSC::ContiguousData::ContiguousData): (JSC::ContiguousData::Data::Data): * runtime/HashMapImpl.h: (JSC::HashMapImpl::checkConsistency const): (JSC::HashMapImpl::assertBufferIsEmpty const): * runtime/JSCellInlines.h: (JSC::JSCell::methodTable const): * runtime/JSFunction.cpp: * runtime/JSFunction.h: (JSC::JSFunction::assertTypeInfoFlagInvariants): * runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): * runtime/JSGlobalObject.h: * runtime/JSObject.cpp: (JSC::JSObject::visitChildren): (JSC::JSFinalObject::visitChildren): * runtime/JSObjectInlines.h: (JSC::JSObject::validatePutOwnDataProperty): * runtime/JSSegmentedVariableObject.h: (JSC::JSSegmentedVariableObject::assertVariableIsInThisObject): * runtime/LiteralParser.cpp: (JSC::LiteralParser<CharType>::Lexer::lex): * runtime/LiteralParser.h: * runtime/Operations.h: (JSC::scribbleFreeCells): * runtime/OptionsList.h: * runtime/VM.cpp: (JSC::VM::computeCanUseJIT): * runtime/VM.h: (JSC::VM::canUseJIT): * runtime/VarOffset.h: (JSC::VarOffset::checkSanity const): * runtime/WeakMapImpl.h: (JSC::WeakMapImpl::checkConsistency const): (JSC::WeakMapImpl::assertBufferIsEmpty const): * wasm/WasmAirIRGenerator.cpp: (JSC::Wasm::AirIRGenerator::validateInst): * wasm/WasmB3IRGenerator.cpp: (JSC::Wasm::parseAndCompile): * wasm/WasmFunctionParser.h: (JSC::Wasm::FunctionParser::validationFail const): * wasm/WasmLLIntGenerator.cpp: (JSC::Wasm::LLIntGenerator::checkConsistency): * wasm/WasmPlan.cpp: (JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast): * wasm/WasmSectionParser.h: * wasm/WasmSections.h: * wasm/WasmSignatureInlines.h: (JSC::Wasm::SignatureInformation::get): * wasm/WasmWorklist.cpp: (JSC::Wasm::Worklist::enqueue): * wasm/js/JSToWasm.cpp: (JSC::Wasm::createJSToWasmWrapper): * wasm/js/WebAssemblyFunction.cpp: (JSC::WebAssemblyFunction::previousInstanceOffset const): Source/WebCore: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::close): * Modules/fetch/FetchBodySource.h: * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::operator=): * Modules/webdatabase/DatabaseTask.cpp: (WebCore::DatabaseTask::performTask): * Modules/webdatabase/DatabaseTask.h: * Modules/webdatabase/DatabaseThread.cpp: (WebCore::DatabaseThread::terminationRequested const): * Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: (WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation): * Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: (WebCore::WHLSL::findHighZombies): * Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: (WebCore::WHLSL::matches): * Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: (WebCore::WHLSL::checkLiteralTypes): * Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: (WebCore::WHLSL::FindAllTypes::appendNamedType): * bindings/js/JSCallbackData.h: * bindings/js/JSLazyEventListener.cpp: * bindings/js/JSLazyEventListener.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): * css/CSSCalculationValue.cpp: (WebCore::CSSCalcOperationNode::primitiveType const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyInStyle): * css/CSSPrimitiveValue.cpp: * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): * css/CSSStyleSheet.cpp: * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::suspendIfNeeded): (WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const): * dom/ActiveDOMObject.h: * dom/ContainerNode.cpp: * dom/ContainerNodeAlgorithms.cpp: * dom/ContainerNodeAlgorithms.h: * dom/CustomElementReactionQueue.cpp: * dom/CustomElementReactionQueue.h: (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): * dom/Document.cpp: (WebCore::Document::hitTest): * dom/Document.h: (WebCore::Document::decrementReferencingNodeCount): * dom/Element.cpp: (WebCore::Element::addShadowRoot): (WebCore::Element::getURLAttribute const): (WebCore::Element::getNonEmptyURLAttribute const): * dom/Element.h: * dom/ElementAndTextDescendantIterator.h: (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator): (WebCore::ElementAndTextDescendantIterator::dropAssertions): (WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack): (WebCore::ElementAndTextDescendantIterator::traverseNextSibling): (WebCore::ElementAndTextDescendantIterator::traversePreviousSibling): * dom/ElementDescendantIterator.h: (WebCore::ElementDescendantIterator::ElementDescendantIterator): (WebCore::ElementDescendantIterator::dropAssertions): (WebCore::ElementDescendantIterator::operator++): (WebCore::ElementDescendantIterator::operator--): (WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator): (WebCore::ElementDescendantConstIterator::dropAssertions): (WebCore::ElementDescendantConstIterator::operator++): * dom/ElementIterator.h: (WebCore::ElementIterator<ElementType>::ElementIterator): (WebCore::ElementIterator<ElementType>::traverseNext): (WebCore::ElementIterator<ElementType>::traversePrevious): (WebCore::ElementIterator<ElementType>::traverseNextSibling): (WebCore::ElementIterator<ElementType>::traversePreviousSibling): (WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementIterator<ElementType>::dropAssertions): (WebCore::ElementIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::ElementConstIterator): (WebCore::ElementConstIterator<ElementType>::traverseNext): (WebCore::ElementConstIterator<ElementType>::traversePrevious): (WebCore::ElementConstIterator<ElementType>::traverseNextSibling): (WebCore::ElementConstIterator<ElementType>::traversePreviousSibling): (WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren): (WebCore::ElementConstIterator<ElementType>::traverseAncestor): (WebCore::ElementConstIterator<ElementType>::dropAssertions): * dom/EventContext.cpp: * dom/EventContext.h: * dom/EventListener.h: * dom/EventPath.cpp: * dom/EventSender.h: * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): (WebCore::EventTarget::setAttributeEventListener): (WebCore::EventTarget::innerInvokeEventListeners): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::moveNodeToNewDocument): (WebCore::Node::removedLastRef): * dom/Node.h: (WebCore::Node::deref const): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::~ScriptExecutionContext): * dom/ScriptExecutionContext.h: * dom/SelectorQuery.cpp: (WebCore::SelectorDataList::execute const): * dom/SlotAssignment.cpp: (WebCore::SlotAssignment::addSlotElementByName): (WebCore::SlotAssignment::removeSlotElementByName): (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): (WebCore::SlotAssignment::findFirstSlotElement): * dom/SlotAssignment.h: * dom/TreeScopeOrderedMap.cpp: (WebCore::TreeScopeOrderedMap::add): (WebCore::TreeScopeOrderedMap::get const): * dom/TreeScopeOrderedMap.h: * fileapi/Blob.cpp: * fileapi/Blob.h: * history/BackForwardCache.cpp: (WebCore::BackForwardCache::removeAllItemsForPage): * history/BackForwardCache.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: * html/HTMLCollection.h: (WebCore::CollectionNamedElementCache::didPopulate): * html/HTMLSelectElement.cpp: (WebCore:: const): * html/HTMLTableRowsCollection.cpp: (WebCore::assertRowIsInTable): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::indexForPosition const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase): * html/parser/HTMLParserScheduler.cpp: (WebCore::HTMLParserScheduler::HTMLParserScheduler): (WebCore::HTMLParserScheduler::suspend): (WebCore::HTMLParserScheduler::resume): * html/parser/HTMLParserScheduler.h: * html/parser/HTMLToken.h: (WebCore::HTMLToken::beginStartTag): (WebCore::HTMLToken::beginEndTag): (WebCore::HTMLToken::endAttribute): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::HTMLTreeBuilder): (WebCore::HTMLTreeBuilder::constructTree): * html/parser/HTMLTreeBuilder.h: (WebCore::HTMLTreeBuilder::~HTMLTreeBuilder): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::geometryForBox const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition): * layout/blockformatting/BlockFormattingContext.h: * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setTopLeft): (WebCore::Display::Box::setTop): (WebCore::Display::Box::setLeft): (WebCore::Display::Box::setContentBoxHeight): (WebCore::Display::Box::setContentBoxWidth): (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::setBorder): (WebCore::Display::Box::setPadding): * layout/displaytree/DisplayInlineRect.h: (WebCore::Display::InlineRect::InlineRect): (WebCore::Display::InlineRect::setTopLeft): (WebCore::Display::InlineRect::setTop): (WebCore::Display::InlineRect::setBottom): (WebCore::Display::InlineRect::setLeft): (WebCore::Display::InlineRect::setWidth): (WebCore::Display::InlineRect::setHeight): * layout/displaytree/DisplayLineBox.h: (WebCore::Display::LineBox::LineBox): (WebCore::Display::LineBox::setBaselineOffsetIfGreater): (WebCore::Display::LineBox::resetBaseline): (WebCore::Display::LineBox::Baseline::Baseline): (WebCore::Display::LineBox::Baseline::setAscent): (WebCore::Display::LineBox::Baseline::setDescent): (WebCore::Display::LineBox::Baseline::reset): * layout/displaytree/DisplayRect.h: (WebCore::Display::Rect::Rect): (WebCore::Display::Rect::setTopLeft): (WebCore::Display::Rect::setTop): (WebCore::Display::Rect::setLeft): (WebCore::Display::Rect::setWidth): (WebCore::Display::Rect::setHeight): (WebCore::Display::Rect::setSize): (WebCore::Display::Rect::clone const): * layout/floats/FloatingContext.cpp: * layout/inlineformatting/InlineLineBuilder.cpp: (WebCore::Layout::LineBuilder::CollapsibleContent::collapse): * layout/tableformatting/TableGrid.cpp: (WebCore::Layout::TableGrid::Column::setWidthConstraints): (WebCore::Layout::TableGrid::Column::setLogicalWidth): (WebCore::Layout::TableGrid::Column::setLogicalLeft): * layout/tableformatting/TableGrid.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::attachToFrame): (WebCore::DocumentLoader::detachFromFrame): (WebCore::DocumentLoader::addSubresourceLoader): * loader/DocumentLoader.h: * loader/ImageLoader.cpp: * loader/cache/CachedResource.h: * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::lruListFor): (WebCore::MemoryCache::removeFromLRUList): * page/FrameView.cpp: (WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive): * page/FrameViewLayoutContext.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/Page.h: * page/ViewportConfiguration.cpp: * page/ViewportConfiguration.h: * page/mac/EventHandlerMac.mm: (WebCore::CurrentEventScope::CurrentEventScope): * platform/DateComponents.cpp: (WebCore::DateComponents::toStringForTime const): * platform/ScrollableArea.cpp: * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::combineIntoOneSegment const): * platform/SharedBuffer.h: * platform/Supplementable.h: * platform/Timer.cpp: (WebCore::TimerBase::checkHeapIndex const): (WebCore::TimerBase::updateHeapIfNeeded): * platform/graphics/BitmapImage.cpp: * platform/graphics/BitmapImage.h: * platform/graphics/Image.h: * platform/graphics/ShadowBlur.cpp: (WebCore::ScratchBuffer::ScratchBuffer): (WebCore::ScratchBuffer::getScratchBuffer): (WebCore::ScratchBuffer::scheduleScratchBufferPurge): * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::setWindow): * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/cocoa/FontCacheCoreText.cpp: * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: (gstAllocatorFastMallocFree): * platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp: (Nicosia::PaintingContextCairo::ForPainting::ForPainting): * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: (Nicosia::BackingStoreTextureMapperImpl::createTile): * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl): * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::fill): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::appendGeometry): (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::strokeContains const): (WebCore::Path::transform): * platform/graphics/win/PlatformContextDirect2D.cpp: (WebCore::PlatformContextDirect2D::setTags): * platform/mediastream/MediaStreamTrackPrivate.h: * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): * platform/network/HTTPParsers.cpp: (WebCore::isCrossOriginSafeHeader): * platform/sql/SQLiteDatabase.cpp: * platform/sql/SQLiteDatabase.h: * platform/sql/SQLiteStatement.cpp: (WebCore::SQLiteStatement::SQLiteStatement): (WebCore::SQLiteStatement::prepare): (WebCore::SQLiteStatement::finalize): * platform/sql/SQLiteStatement.h: * platform/win/COMPtr.h: * rendering/ComplexLineLayout.cpp: (WebCore::ComplexLineLayout::removeInlineBox const): * rendering/FloatingObjects.cpp: (WebCore::FloatingObject::FloatingObject): (WebCore::FloatingObjects::addPlacedObject): (WebCore::FloatingObjects::removePlacedObject): * rendering/FloatingObjects.h: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/GridTrackSizingAlgorithm.h: * rendering/LayoutDisallowedScope.cpp: * rendering/LayoutDisallowedScope.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::layoutBlockChild): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::ensureLineBoxes): * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutBlock): * rendering/RenderElement.cpp: * rendering/RenderGeometryMap.cpp: (WebCore::RenderGeometryMap::mapToContainer const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderInline.cpp: (WebCore::RenderInline::willBeDestroyed): * rendering/RenderLayer.cpp: (WebCore::ClipRectsCache::ClipRectsCache): (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::updateClipRects): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderLayoutState.cpp: (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::addLayoutDelta): * rendering/RenderLayoutState.h: (WebCore::RenderLayoutState::RenderLayoutState): * rendering/RenderObject.cpp: (WebCore::RenderObject::RenderObject): (WebCore::RenderObject::~RenderObject): (WebCore::RenderObject::clearNeedsLayout): * rendering/RenderObject.h: * rendering/RenderQuote.cpp: (WebCore::quotesForLanguage): * rendering/RenderTableCell.h: * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::computeOverflowFromCells): * rendering/RenderTextLineBoxes.cpp: (WebCore::RenderTextLineBoxes::checkConsistency const): * rendering/RenderTextLineBoxes.h: * rendering/line/BreakingContext.h: (WebCore::tryHyphenating): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::~RenderStyle): * rendering/style/RenderStyle.h: * rendering/updating/RenderTreeBuilderRuby.cpp: (WebCore::RenderTreeBuilder::Ruby::detach): * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::computeNextSibling): * rendering/updating/RenderTreePosition.h: * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::Placeholder::Placeholder): (WebCore::SVGToOTFFontConverter::Placeholder::populate): (WebCore::SVGToOTFFontConverter::appendCFFTable): (WebCore::SVGToOTFFontConverter::firstGlyph const): (WebCore::SVGToOTFFontConverter::appendKERNTable): * svg/SVGTransformDistance.cpp: (WebCore::SVGTransformDistance::SVGTransformDistance): (WebCore::SVGTransformDistance::scaledDistance const): (WebCore::SVGTransformDistance::addSVGTransforms): (WebCore::SVGTransformDistance::addToSVGTransform const): (WebCore::SVGTransformDistance::distance const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::nativeImage): * testing/InternalSettings.cpp: * workers/service/ServiceWorkerJob.h: * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * xml/XPathStep.cpp: Source/WebKit: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * NetworkProcess/NetworkSession.cpp: (WebKit::NetworkSession::invalidateAndCancel): * NetworkProcess/NetworkSession.h: * NetworkProcess/cache/NetworkCacheStorage.cpp: (WebKit::NetworkCache::Storage::setCapacity): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): (WebKit::NetworkSessionCocoa::NetworkSessionCocoa): * Platform/IPC/Connection.cpp: (IPC::Connection::waitForMessage): * Platform/IPC/MessageReceiver.h: (IPC::MessageReceiver::willBeAddedToMessageReceiverMap): (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap): * Platform/IPC/cocoa/ConnectionCocoa.mm: (IPC::readFromMachPort): * Platform/mac/MachUtilities.cpp: (setMachExceptionPort): * Shared/API/APIClient.h: (API::Client::Client): * Shared/API/Cocoa/WKRemoteObjectCoder.mm: * Shared/Cocoa/ArgumentCodersCocoa.h: * Shared/SharedStringHashTableReadOnly.cpp: * UIProcess/BackingStore.cpp: (WebKit::BackingStore::incorporateUpdate): * UIProcess/GenericCallback.h: * UIProcess/Launcher/mac/ProcessLauncherMac.mm: (WebKit::ProcessLauncher::launchProcess): * UIProcess/PageLoadState.h: (WebKit::PageLoadState::Transaction::Token::Token): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::~WebPageProxy): * WebProcess/Network/WebResourceLoader.cpp: (WebKit::WebResourceLoader::didReceiveResponse): * WebProcess/Network/WebResourceLoader.h: * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp: (WebKit::NetscapePluginStream::NetscapePluginStream): (WebKit::NetscapePluginStream::notifyAndDestroyStream): * WebProcess/Plugins/Netscape/NetscapePluginStream.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::runModal): * WebProcess/WebProcess.cpp: (WebKit::checkDocumentsCaptureStateConsistency): * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Source/WebKitLegacy: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * Storage/StorageAreaImpl.cpp: (WebKit::StorageAreaImpl::StorageAreaImpl): (WebKit::StorageAreaImpl::close): * Storage/StorageAreaImpl.h: Source/WebKitLegacy/mac: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * History/WebHistory.mm: (-[WebHistoryPrivate removeItemForURLString:]): * WebView/WebFrame.mm: Source/WebKitLegacy/win: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. * WebKitQuartzCoreAdditions/CAD3DRenderer.cpp: (WKQCA::CAD3DRenderer::swapChain): (WKQCA::CAD3DRenderer::initialize): * WebKitQuartzCoreAdditions/CAD3DRenderer.h: * WebView.cpp: (WebView::Release): * WebView.h: Source/WTF: Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED. https://bugs.webkit.org/show_bug.cgi?id=205776 Reviewed by Saam Barati. This patch did the following changes: 1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away with the need for the double negative !ASSERT_DISABLED test that is commonly used all over the code, thereby improving code readability. In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED, ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents as well. We'll do that in another patch. For now, they are left as is to minimize the size of this patch. See https://bugs.webkit.org/show_bug.cgi?id=205780. 2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be guarded by "#if ASSERT_ENABLED" instead. 3. In cases where the change is minimal, we move some code around so that we can test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED". * wtf/Assertions.h: * wtf/AutomaticThread.cpp: (WTF::AutomaticThread::start): * wtf/BitVector.h: * wtf/BlockObjCExceptions.mm: (ReportBlockedObjCException): * wtf/BloomFilter.h: * wtf/CallbackAggregator.h: (WTF::CallbackAggregator::CallbackAggregator): * wtf/CheckedArithmetic.h: (WTF::observesOverflow<AssertNoOverflow>): * wtf/CheckedBoolean.h: (CheckedBoolean::CheckedBoolean): (CheckedBoolean::operator bool): * wtf/CompletionHandler.h: (WTF::CompletionHandler<Out): * wtf/DateMath.cpp: (WTF::initializeDates): * wtf/Gigacage.cpp: (Gigacage::tryAllocateZeroedVirtualPages): * wtf/HashTable.h: (WTF::KeyTraits>::checkKey): (WTF::KeyTraits>::checkTableConsistencyExceptSize const): * wtf/LoggerHelper.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::headerOf const): * wtf/NeverDestroyed.h: (WTF::LazyNeverDestroyed::construct): * wtf/OptionSet.h: (WTF::OptionSet::OptionSet): * wtf/Platform.h: * wtf/PtrTag.h: * wtf/RefCounted.h: (WTF::RefCountedBase::disableThreadingChecks): (WTF::RefCountedBase::enableThreadingChecksGlobally): (WTF::RefCountedBase::RefCountedBase): (WTF::RefCountedBase::applyRefDerefThreadingCheck const): * wtf/SingleRootGraph.h: (WTF::SingleRootGraph::assertIsConsistent const): * wtf/SizeLimits.cpp: * wtf/StackBounds.h: (WTF::StackBounds::checkConsistency const): * wtf/URLParser.cpp: (WTF::URLParser::URLParser): (WTF::URLParser::domainToASCII): * wtf/ValueCheck.h: * wtf/Vector.h: (WTF::Malloc>::checkConsistency): * wtf/WeakHashSet.h: * wtf/WeakPtr.h: (WTF::WeakPtrImpl::WeakPtrImpl): (WTF::WeakPtrFactory::WeakPtrFactory): * wtf/text/AtomStringImpl.cpp: * wtf/text/AtomStringImpl.h: * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::reifyString const): * wtf/text/StringBuilder.h: * wtf/text/StringCommon.h: (WTF::hasPrefixWithLettersIgnoringASCIICaseCommon): * wtf/text/StringHasher.h: (WTF::StringHasher::addCharacters): * wtf/text/StringImpl.h: * wtf/text/SymbolImpl.h: * wtf/text/UniquedStringImpl.h: Tools: Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory https://bugs.webkit.org/show_bug.cgi?id=205754 Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06 Reviewed by Youenn Fablet. * TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm: * WebKitTestRunner/TestController.cpp: (WTR::TestController::websiteDataStore): (WTR::TestController::platformAdjustContext): * WebKitTestRunner/cocoa/TestControllerCocoa.mm: (WTR::initializeWebViewConfiguration): Canonical link: https://commits.webkit.org/218957@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-01-06 22:24:50 +00:00
if (ASSERT_ENABLED) {
Beef up the DFG's CFG analyses to include iterated dominance frontiers and more user-friendly BlockSets https://bugs.webkit.org/show_bug.cgi?id=136520 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add code to compute iterated dominance frontiers. This involves using BlockSet a lot, so this patch also makes BlockSet a lot more user-friendly. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGBasicBlock.h: * dfg/DFGBlockSet.cpp: Added. (JSC::DFG::BlockSet::dump): * dfg/DFGBlockSet.h: (JSC::DFG::BlockSet::iterator::iterator): (JSC::DFG::BlockSet::iterator::operator++): (JSC::DFG::BlockSet::iterator::operator==): (JSC::DFG::BlockSet::iterator::operator!=): (JSC::DFG::BlockSet::Iterable::Iterable): (JSC::DFG::BlockSet::Iterable::begin): (JSC::DFG::BlockSet::Iterable::end): (JSC::DFG::BlockSet::iterable): (JSC::DFG::BlockAdder::BlockAdder): (JSC::DFG::BlockAdder::operator()): * dfg/DFGBlockSetInlines.h: Added. (JSC::DFG::BlockSet::iterator::operator*): * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::strictDominatorsOf): (JSC::DFG::Dominators::dominatorsOf): (JSC::DFG::Dominators::blocksStrictlyDominatedBy): (JSC::DFG::Dominators::blocksDominatedBy): (JSC::DFG::Dominators::dominanceFrontierOf): (JSC::DFG::Dominators::iteratedDominanceFrontierOf): * dfg/DFGDominators.h: (JSC::DFG::Dominators::forAllStrictDominatorsOf): (JSC::DFG::Dominators::forAllDominatorsOf): (JSC::DFG::Dominators::forAllBlocksStrictlyDominatedBy): (JSC::DFG::Dominators::forAllBlocksDominatedBy): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOfImpl): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): Source/WTF: Give BitVector a way to quickly find the next set (or unset) bit. Make BitVector equality faster. Fix a minor closure goof in Spectrum. * wtf/BitVector.cpp: (WTF::BitVector::equalsSlowCase): (WTF::BitVector::equalsSlowCaseFast): (WTF::BitVector::equalsSlowCaseSimple): * wtf/BitVector.h: (WTF::BitVector::findBit): (WTF::BitVector::findBitFast): (WTF::BitVector::findBitSimple): (WTF::BitVector::findBitInWord): * wtf/Spectrum.h: (WTF::Spectrum::removeIf): Canonical link: https://commits.webkit.org/154343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-04 21:08:38 +00:00
size_t expectedResult = findBitSimple(index, value);
if (result != expectedResult) {
dataLog("findBit(", index, ", ", value, ") on ", *this, " should have gotten ", expectedResult, " but got ", result, "\n");
ASSERT_NOT_REACHED();
}
}
return result;
}
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
WTF_EXPORT_PRIVATE void dump(PrintStream& out) const;
enum EmptyValueTag { EmptyValue };
enum DeletedValueTag { DeletedValue };
BitVector(EmptyValueTag)
: m_bitsOrPointer(0)
{
}
BitVector(DeletedValueTag)
: m_bitsOrPointer(1)
{
}
bool isEmptyValue() const { return !m_bitsOrPointer; }
bool isDeletedValue() const { return m_bitsOrPointer == 1; }
bool isEmptyOrDeletedValue() const { return m_bitsOrPointer <= 1; }
bool operator==(const BitVector& other) const
{
if (isInline() && other.isInline())
return m_bitsOrPointer == other.m_bitsOrPointer;
return equalsSlowCase(other);
}
unsigned hash() const
{
// This is a very simple hash. Just xor together the words that hold the various
// bits and then compute the hash. This makes it very easy to deal with bitvectors
// that have a lot of trailing zero's.
uintptr_t value;
if (isInline())
value = cleanseInlineBits(m_bitsOrPointer);
else
value = hashSlowCase();
return IntHash<uintptr_t>::hash(value);
}
DFG virtual register allocator should be more aggressive in reusing temporary slots https://bugs.webkit.org/show_bug.cgi?id=69868 Reviewed by Oliver Hunt. 1.2% win on V8, neutral elsewhere. The win is probably because it increases precision of GC conservative scans. This required making the DFG::ScoreBoard operate over a bitvector of preserved variables, rather than just a preserved variable threshold. To do this, I improved the WTF::BitVector class to make it more user-friendly. It still retains all previous functionality. Also made changes to PackedIntVector to accomodate those changes. Finally, this adds more debugging to the virtual register allocator and to the OSR exit code, as this was necessary to track down bugs in an earlier version of this patch. * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::ByteCodeParser): (JSC::DFG::ByteCodeParser::getLocal): * dfg/DFGGraph.h: * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): * dfg/DFGPropagator.cpp: (JSC::DFG::Propagator::allocateVirtualRegisters): * dfg/DFGScoreBoard.h: (JSC::DFG::ScoreBoard::ScoreBoard): (JSC::DFG::ScoreBoard::~ScoreBoard): (JSC::DFG::ScoreBoard::allocate): (JSC::DFG::ScoreBoard::use): (JSC::DFG::ScoreBoard::highWatermark): (JSC::DFG::ScoreBoard::dump): (JSC::DFG::ScoreBoard::max): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::ValueRecovery::dump): * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::BitVector): (WTF::BitVector::operator=): (WTF::BitVector::quickGet): (WTF::BitVector::quickSet): (WTF::BitVector::quickClear): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): * wtf/PackedIntVector.h: (WTF::PackedIntVector::get): (WTF::PackedIntVector::set): Canonical link: https://commits.webkit.org/85930@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-11 23:50:26 +00:00
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
class iterator {
[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;
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
public:
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
iterator()
: m_bitVector(nullptr)
, m_index(0)
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
{
}
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
iterator(const BitVector& bitVector, size_t index)
: m_bitVector(&bitVector)
, m_index(index)
{
}
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
size_t operator*() const { return m_index; }
iterator& operator++()
{
m_index = m_bitVector->findBit(m_index + 1, true);
return *this;
}
GC constraint solving should be parallel https://bugs.webkit.org/show_bug.cgi?id=179934 Reviewed by JF Bastien. PerformanceTests: Added a version of splay that measures latency in a way that run-jsc-benchmarks groks. * Octane/splay.js: Added. (this.Setup.setup.setup): (this.TearDown.tearDown.tearDown): (Benchmark): (BenchmarkResult): (BenchmarkResult.prototype.valueOf): (BenchmarkSuite): (alert): (Math.random): (BenchmarkSuite.ResetRNG): (RunStep): (BenchmarkSuite.RunSuites): (BenchmarkSuite.CountBenchmarks): (BenchmarkSuite.GeometricMean): (BenchmarkSuite.GeometricMeanTime): (BenchmarkSuite.AverageAbovePercentile): (BenchmarkSuite.GeometricMeanLatency): (BenchmarkSuite.FormatScore): (BenchmarkSuite.prototype.NotifyStep): (BenchmarkSuite.prototype.NotifyResult): (BenchmarkSuite.prototype.NotifyError): (BenchmarkSuite.prototype.RunSingleBenchmark): (RunNextSetup): (RunNextBenchmark): (RunNextTearDown): (BenchmarkSuite.prototype.RunStep): (GeneratePayloadTree): (GenerateKey): (SplayUpdateStats): (InsertNewNode): (SplaySetup): (SplayTearDown): (SplayRun): (SplayTree): (SplayTree.prototype.isEmpty): (SplayTree.prototype.insert): (SplayTree.prototype.remove): (SplayTree.prototype.find): (SplayTree.prototype.findMax): (SplayTree.prototype.findGreatestLessThan): (SplayTree.prototype.exportKeys): (SplayTree.prototype.splay_): (SplayTree.Node): (SplayTree.Node.prototype.traverse_): (report): (start): Source/JavaScriptCore: This makes it possible to do constraint solving in parallel. This looks like a 1% Speedometer speed-up. It's more than 1% on trunk-Speedometer. The constraint solver supports running constraints in parallel in two different ways: - Run multiple constraints in parallel to each other. This only works for constraints that can tolerate other constraints running concurrently to them (constraint.concurrency() == ConstraintConcurrency::Concurrent). This is the most basic kind of parallelism that the constraint solver supports. All constraints except the JSC SPI constraints are concurrent. We could probably make them concurrent, but I'm playing it safe for now. - A constraint can create parallel work for itself, which the constraint solver will interleave with other stuff. A constraint can report that it has parallel work by returning ConstraintParallelism::Parallel from its executeImpl() function. Then the solver will allow that constraint's doParallelWorkImpl() function to run on as many GC marker threads as are available, for as long as that function wants to run. It's not possible to have a non-concurrent constraint that creates parallel work. The parallelism is implemented in terms of the existing GC marker threads. This turns out to be most natural for two reasons: - No need to start any other threads. - The constraints all want to be passed a SlotVisitor. Running on the marker threads means having access to those threads' SlotVisitors. Also, it means less load balancing. The solver will create work on each marking thread's SlotVisitor. When the solver is done "stealing" a marker thread, that thread will have work it can start doing immediately. Before this change, we had to contribute the work found by the constraint solver to the global worklist so that it could be distributed to the marker threads by load balancing. This change probably helps to avoid that load balancing step. A lot of this change is about making it easy to iterate GC data structures in parallel. This change makes almost all constraints parallel-enabled, but only the DOM's output constraint uses the parallel work API. That constraint iterates the marked cells in two subspaces. This change makes it very easy to compose parallel iterators over subspaces, allocators, blocks, and cells. The marked cell parallel iterator is composed out of parallel iterators for the others. A parallel iterator is just an iterator that can do an atomic next() very quickly. We abstract them using RefPtr<SharedTask<...()>>, where ... is the type returned from the iterator. We know it's done when it returns a falsish version of ... (in the current code, that's always a pointer type, so done is indicated by null). * API/JSMarkingConstraintPrivate.cpp: (JSContextGroupAddMarkingConstraint): * API/JSVirtualMachine.mm: (scanExternalObjectGraph): (scanExternalRememberedSet): * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * bytecode/AccessCase.cpp: (JSC::AccessCase::propagateTransitions const): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::visitWeakly): (JSC::CodeBlock::shouldJettisonDueToOldAge): (JSC::shouldMarkTransition): (JSC::CodeBlock::propagateTransitions): (JSC::CodeBlock::determineLiveness): * dfg/DFGWorklist.cpp: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * heap/ConstraintParallelism.h: Added. (WTF::printInternal): * heap/Heap.cpp: (JSC::Heap::Heap): (JSC::Heap::addToRememberedSet): (JSC::Heap::runFixpointPhase): (JSC::Heap::stopThePeriphery): (JSC::Heap::resumeThePeriphery): (JSC::Heap::addCoreConstraints): (JSC::Heap::setBonusVisitorTask): (JSC::Heap::runTaskInParallel): (JSC::Heap::forEachSlotVisitor): Deleted. * heap/Heap.h: (JSC::Heap::worldIsRunning const): (JSC::Heap::runFunctionInParallel): * heap/HeapInlines.h: (JSC::Heap::worldIsStopped const): (JSC::Heap::isMarked): (JSC::Heap::incrementDeferralDepth): (JSC::Heap::decrementDeferralDepth): (JSC::Heap::decrementDeferralDepthAndGCIfNeeded): (JSC::Heap::forEachSlotVisitor): (JSC::Heap::collectorBelievesThatTheWorldIsStopped const): Deleted. (JSC::Heap::isMarkedConcurrently): Deleted. * heap/HeapSnapshotBuilder.cpp: (JSC::HeapSnapshotBuilder::appendNode): * heap/LargeAllocation.h: (JSC::LargeAllocation::isMarked): (JSC::LargeAllocation::isMarkedConcurrently): Deleted. * heap/LockDuringMarking.h: (JSC::lockDuringMarking): * heap/MarkedAllocator.cpp: (JSC::MarkedAllocator::parallelNotEmptyBlockSource): * heap/MarkedAllocator.h: * heap/MarkedBlock.h: (JSC::MarkedBlock::aboutToMark): (JSC::MarkedBlock::isMarked): (JSC::MarkedBlock::areMarksStaleWithDependency): Deleted. (JSC::MarkedBlock::isMarkedConcurrently): Deleted. * heap/MarkedSpace.h: (JSC::MarkedSpace::activeWeakSetsBegin): (JSC::MarkedSpace::activeWeakSetsEnd): (JSC::MarkedSpace::newActiveWeakSetsBegin): (JSC::MarkedSpace::newActiveWeakSetsEnd): * heap/MarkingConstraint.cpp: (JSC::MarkingConstraint::MarkingConstraint): (JSC::MarkingConstraint::execute): (JSC::MarkingConstraint::quickWorkEstimate): (JSC::MarkingConstraint::workEstimate): (JSC::MarkingConstraint::doParallelWork): (JSC::MarkingConstraint::finishParallelWork): (JSC::MarkingConstraint::doParallelWorkImpl): (JSC::MarkingConstraint::finishParallelWorkImpl): * heap/MarkingConstraint.h: (JSC::MarkingConstraint::lastExecuteParallelism const): (JSC::MarkingConstraint::parallelism const): (JSC::MarkingConstraint::quickWorkEstimate): Deleted. (JSC::MarkingConstraint::workEstimate): Deleted. * heap/MarkingConstraintSet.cpp: (JSC::MarkingConstraintSet::MarkingConstraintSet): (JSC::MarkingConstraintSet::add): (JSC::MarkingConstraintSet::executeConvergence): (JSC::MarkingConstraintSet::executeConvergenceImpl): (JSC::MarkingConstraintSet::executeAll): (JSC::MarkingConstraintSet::ExecutionContext::ExecutionContext): Deleted. (JSC::MarkingConstraintSet::ExecutionContext::didVisitSomething const): Deleted. (JSC::MarkingConstraintSet::ExecutionContext::shouldTimeOut const): Deleted. (JSC::MarkingConstraintSet::ExecutionContext::drain): Deleted. (JSC::MarkingConstraintSet::ExecutionContext::didExecute const): Deleted. (JSC::MarkingConstraintSet::ExecutionContext::execute): Deleted. (): Deleted. * heap/MarkingConstraintSet.h: * heap/MarkingConstraintSolver.cpp: Added. (JSC::MarkingConstraintSolver::MarkingConstraintSolver): (JSC::MarkingConstraintSolver::~MarkingConstraintSolver): (JSC::MarkingConstraintSolver::didVisitSomething const): (JSC::MarkingConstraintSolver::execute): (JSC::MarkingConstraintSolver::drain): (JSC::MarkingConstraintSolver::converge): (JSC::MarkingConstraintSolver::runExecutionThread): (JSC::MarkingConstraintSolver::didExecute): * heap/MarkingConstraintSolver.h: Added. * heap/OpaqueRootSet.h: Removed. * heap/ParallelSourceAdapter.h: Added. (JSC::ParallelSourceAdapter::ParallelSourceAdapter): (JSC::createParallelSourceAdapter): * heap/SimpleMarkingConstraint.cpp: Added. (JSC::SimpleMarkingConstraint::SimpleMarkingConstraint): (JSC::SimpleMarkingConstraint::~SimpleMarkingConstraint): (JSC::SimpleMarkingConstraint::quickWorkEstimate): (JSC::SimpleMarkingConstraint::executeImpl): * heap/SimpleMarkingConstraint.h: Added. * heap/SlotVisitor.cpp: (JSC::SlotVisitor::didStartMarking): (JSC::SlotVisitor::reset): (JSC::SlotVisitor::appendToMarkStack): (JSC::SlotVisitor::visitChildren): (JSC::SlotVisitor::updateMutatorIsStopped): (JSC::SlotVisitor::mutatorIsStoppedIsUpToDate const): (JSC::SlotVisitor::drain): (JSC::SlotVisitor::performIncrementOfDraining): (JSC::SlotVisitor::didReachTermination): (JSC::SlotVisitor::hasWork): (JSC::SlotVisitor::drainFromShared): (JSC::SlotVisitor::drainInParallelPassively): (JSC::SlotVisitor::waitForTermination): (JSC::SlotVisitor::addOpaqueRoot): Deleted. (JSC::SlotVisitor::containsOpaqueRoot const): Deleted. (JSC::SlotVisitor::containsOpaqueRootTriState const): Deleted. (JSC::SlotVisitor::mergeIfNecessary): Deleted. (JSC::SlotVisitor::mergeOpaqueRootsIfProfitable): Deleted. (JSC::SlotVisitor::mergeOpaqueRoots): Deleted. * heap/SlotVisitor.h: * heap/SlotVisitorInlines.h: (JSC::SlotVisitor::addOpaqueRoot): (JSC::SlotVisitor::containsOpaqueRoot const): (JSC::SlotVisitor::vm): (JSC::SlotVisitor::vm const): * heap/Subspace.cpp: (JSC::Subspace::parallelAllocatorSource): (JSC::Subspace::parallelNotEmptyMarkedBlockSource): * heap/Subspace.h: * heap/SubspaceInlines.h: (JSC::Subspace::forEachMarkedCellInParallel): * heap/VisitCounter.h: Added. (JSC::VisitCounter::VisitCounter): (JSC::VisitCounter::visitCount const): * heap/VisitingTimeout.h: Removed. * heap/WeakBlock.cpp: (JSC::WeakBlock::specializedVisit): * runtime/Structure.cpp: (JSC::Structure::isCheapDuringGC): (JSC::Structure::markIfCheap): Source/WebCore: No new tests because no change in behavior. This change is best tested using DOM-GC-intensive benchmarks like Speedometer and Dromaeo. This parallelizes the DOM's output constraint, and makes some small changes to make this more scalable. * ForwardingHeaders/heap/SimpleMarkingConstraint.h: Added. * ForwardingHeaders/heap/VisitingTimeout.h: Removed. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/DOMGCOutputConstraint.cpp: Added. (WebCore::DOMGCOutputConstraint::DOMGCOutputConstraint): (WebCore::DOMGCOutputConstraint::~DOMGCOutputConstraint): (WebCore::DOMGCOutputConstraint::executeImpl): (WebCore::DOMGCOutputConstraint::doParallelWorkImpl): (WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): * bindings/js/DOMGCOutputConstraint.h: Added. * bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::initNormalWorld): * dom/Node.cpp: (WebCore::Node::eventTargetDataConcurrently): (WebCore::Node::ensureEventTargetData): (WebCore::Node::clearEventTargetData): Source/WTF: This does some changes to make it easier to do parallel constraint solving: - I finally removed dependencyWith. This was a silly construct whose only purpose is to confuse people about what it means to have a dependency chain. I took that as an opportunity to grealy simplify the GC's use of dependency chaining. - Added more logic to Deque<>, since I use it for part of the load balancer. - Made it possible to profile lock contention. See https://bugs.webkit.org/show_bug.cgi?id=180250#c0 for some preliminary measurements. - Introduced holdLockIf, which makes it easy to perform predicated lock acquisition. We use that to pick a lock in WebCore. - Introduced CountingLock. It's like WTF::Lock except it also enables optimistic read transactions sorta like Java's StampedLock. * WTF.xcodeproj/project.pbxproj: * wtf/Atomics.h: (WTF::dependency): (WTF::DependencyWith::DependencyWith): Deleted. (WTF::dependencyWith): Deleted. * wtf/BitVector.h: (WTF::BitVector::iterator::operator++): * wtf/CMakeLists.txt: * wtf/ConcurrentPtrHashSet.cpp: Added. (WTF::ConcurrentPtrHashSet::ConcurrentPtrHashSet): (WTF::ConcurrentPtrHashSet::~ConcurrentPtrHashSet): (WTF::ConcurrentPtrHashSet::deleteOldTables): (WTF::ConcurrentPtrHashSet::clear): (WTF::ConcurrentPtrHashSet::initialize): (WTF::ConcurrentPtrHashSet::addSlow): (WTF::ConcurrentPtrHashSet::resizeIfNecessary): (WTF::ConcurrentPtrHashSet::resizeAndAdd): (WTF::ConcurrentPtrHashSet::Table::create): * wtf/ConcurrentPtrHashSet.h: Added. (WTF::ConcurrentPtrHashSet::contains): (WTF::ConcurrentPtrHashSet::add): (WTF::ConcurrentPtrHashSet::size const): (WTF::ConcurrentPtrHashSet::Table::maxLoad const): (WTF::ConcurrentPtrHashSet::hash): (WTF::ConcurrentPtrHashSet::cast): (WTF::ConcurrentPtrHashSet::containsImpl const): (WTF::ConcurrentPtrHashSet::addImpl): * wtf/Deque.h: (WTF::inlineCapacity>::takeFirst): * wtf/FastMalloc.h: * wtf/Lock.cpp: (WTF::LockBase::lockSlow): * wtf/Locker.h: (WTF::holdLockIf): * wtf/ScopedLambda.h: * wtf/SharedTask.h: (WTF::SharedTask<PassedResultType): (WTF::SharedTask<ResultType): Deleted. * wtf/StackShot.h: Added. (WTF::StackShot::StackShot): (WTF::StackShot::operator=): (WTF::StackShot::array const): (WTF::StackShot::size const): (WTF::StackShot::operator bool const): (WTF::StackShot::operator== const): (WTF::StackShot::hash const): (WTF::StackShot::isHashTableDeletedValue const): (WTF::StackShot::operator> const): (WTF::StackShot::deletedValueArray): (WTF::StackShotHash::hash): (WTF::StackShotHash::equal): * wtf/StackShotProfiler.h: Added. (WTF::StackShotProfiler::StackShotProfiler): (WTF::StackShotProfiler::profile): (WTF::StackShotProfiler::run): Tools: * Scripts/run-jsc-benchmarks: Add splay-latency test, since this change needed to be carefully validated with that benchmark. * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/ConcurrentPtrHashSet.cpp: Added. This has unit tests of the new concurrent data structure. The tests focus on correctness under serial execution, which appears to be enough for now (it's so easy to catch a concurrency bug by just running the GC). (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/196360@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2017-12-05 17:53:57 +00:00
iterator operator++(int)
{
iterator result = *this;
++(*this);
return result;
}
bool isAtEnd() const
{
return m_index >= m_bitVector->size();
}
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
bool operator==(const iterator& other) const
{
return m_index == other.m_index;
}
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
bool operator!=(const iterator& other) const
{
return !(*this == other);
}
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
private:
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
const BitVector* m_bitVector;
size_t m_index;
FTL should sink PutLocals https://bugs.webkit.org/show_bug.cgi?id=137168 Reviewed by Oliver Hunt. Source/JavaScriptCore: We've known for a while that our PutLocal situation was sub-optimal. We emit them anytime we "pass" arguments to an inlined function call, because we need to enable the runtime to grab those arguments when doing foo.arguments where foo is inlined: our engine doesn't deoptimize in that case but rather just relies on the arguments being flushed (i.e. a copy of their values is spilled) at a well-known place in a well-known format. The PutLocals incur two costs: (1) they are store instructions and stores ain't free, and (2) they look like escaping sites and so they inhibit object allocation sinking. But in most cases, the PutLocals are unnecessary because the inlined code never performs any side effect that could transitively lead to function.arguments. Even if the inlined code could do such a side effect, it may be on a rare path so there is no need to penalize the entire function. This patch implements one solution to the PutLocal problem: it aggressively sinks PutLocals to the latest possible point. This is even more aggressive than the object allocation sinking. That sinking algorithm avoids creating situations where an object could be materialized more than one along any path. PutLocal sinking, on the other hand, doesn't avoid this at all - both to make the phase cheaper and simpler and to make it more aggressive. Every PutLocal is sunk no matter what. The upside of this patch is that it eliminates many PutLocals: many of them are sunk "past their death", thus eliminating them completely. Others are sunk to rare paths. This enables a lot of object allocation sinking and it removes a lot of pointless store instructions. It also has downsites. Sinking PutLocals increases register pressure because it increases the live ranges of things like inlined arguments. This patch is a net performance win in its current form: 1% SunSpider regression, 2% OctaneV2 progression, 0.6% Kraken regression, 1% AsmBench progression, and 0.5% CompressionBench regression. The biggest win is on Octane/raytrace, which improves by 27%. Relanding after fixing internal builds. We have to be careful about implicit casts from int64 to int32. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::dump): Deleted. * bytecode/OperandsInlines.h: (JSC::Traits>::dump): * bytecode/VirtualRegister.h: (JSC::VirtualRegister::isHeader): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry): * dfg/DFGClobberSet.h: (JSC::DFG::ClobberSetAdd::operator()): (JSC::DFG::ClobberSetOverlaps::operator()): * dfg/DFGClobberize.h: (JSC::DFG::clobberize): (JSC::DFG::NoOpClobberize::operator()): (JSC::DFG::CheckClobberize::operator()): (JSC::DFG::AbstractHeapOverlaps::operator()): (JSC::DFG::ReadMethodClobberize::operator()): (JSC::DFG::WriteMethodClobberize::operator()): (JSC::DFG::DefMethodClobberize::operator()): * dfg/DFGFlushFormat.h: (JSC::DFG::merge): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::Graph): * dfg/DFGGraph.h: (JSC::DFG::Graph::capturedVarsFor): * dfg/DFGObjectAllocationSinkingPhase.cpp: (JSC::DFG::ObjectAllocationSinkingPhase::determineMaterializationPoints): (JSC::DFG::ObjectAllocationSinkingPhase::placeMaterializationPoints): * dfg/DFGPlan.cpp: (JSC::DFG::Plan::compileInThreadImpl): * dfg/DFGPreciseLocalClobberize.h: Added. (JSC::DFG::PreciseLocalClobberizeAdaptor::PreciseLocalClobberizeAdaptor): (JSC::DFG::PreciseLocalClobberizeAdaptor::read): (JSC::DFG::PreciseLocalClobberizeAdaptor::write): (JSC::DFG::PreciseLocalClobberizeAdaptor::def): (JSC::DFG::PreciseLocalClobberizeAdaptor::callIfAppropriate): (JSC::DFG::PreciseLocalClobberizeAdaptor::readTop): (JSC::DFG::PreciseLocalClobberizeAdaptor::writeTop): (JSC::DFG::forEachLocalReadByUnwind): (JSC::DFG::preciseLocalClobberize): * dfg/DFGPutLocalSinkingPhase.cpp: Added. (JSC::DFG::performPutLocalSinking): * dfg/DFGPutLocalSinkingPhase.h: Added. * dfg/DFGSSACalculator.h: (JSC::DFG::SSACalculator::computePhis): * dfg/DFGValidate.cpp: Source/WTF: Make the set bits of a BitVector iterable. * wtf/BitVector.h: (WTF::BitVector::SetBitsIterable::SetBitsIterable): (WTF::BitVector::SetBitsIterable::iterator::iterator): (WTF::BitVector::SetBitsIterable::iterator::operator*): (WTF::BitVector::SetBitsIterable::iterator::operator++): (WTF::BitVector::SetBitsIterable::iterator::operator==): (WTF::BitVector::SetBitsIterable::iterator::operator!=): (WTF::BitVector::SetBitsIterable::begin): (WTF::BitVector::SetBitsIterable::end): (WTF::BitVector::setBits): LayoutTests: * js/regress/elidable-new-object-then-call-expected.txt: Added. * js/regress/elidable-new-object-then-call.html: Added. * js/regress/script-tests/elidable-new-object-then-call.js: Added. (sumOfArithSeries): (bar): (foo): Canonical link: https://commits.webkit.org/155232@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174318 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-10-04 17:18:25 +00:00
};
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
// Use this to iterate over set bits.
iterator begin() const { return iterator(*this, findBit(0, true)); }
iterator end() const { return iterator(*this, size()); }
Make AirAllocateRegistersByGraphColoring use less memory https://bugs.webkit.org/show_bug.cgi?id=225848 Reviewed by Filip Pizlo. Source/JavaScriptCore: We've had some jetsam problems caused by the main Air register allocator, which caused us to lower Options::maximumTmpsForGraphColoring. Hence this patch tries to improve the memory usage of the allocator. It includes several changes: - Change the datastructure used for representing the interference graph. Before it was effectively a HashSet<std::pair<uint16_t, uint16_t>. Now, it is either a Bitvector (for n < 400 for now, can be tweaked easily), or a Vector<LikelyDenseUnsignedIntegerSet<uint16_t>> otherwise. LikelyDenseUnsignedIntegerSet is a new datastructure introduced by this patch, it is either a HashSet if very sparse, or a BitVector + an amount to shift it by. This is by far the largest memory reduction in this patch, it reduces the maximum memory used for an interference graph in tsf-wasm in JetStream2 from 16MB to 700kB, and in mruby-wasm.aotoki.dev from 262MB to 20MB (the later only happen when we increase Options::maximumTmpsForGraphColoring.. this is the exact function which caused us to lower it). Its effect on smaller functions in JetStream2 is rarely as dramatic but always an improvement, and improvements between 2x and 5x are extremely common (10x to 30x are significantly rarer but do occur). - In order to easily test this change and any further change to this datastructure, the old approach was preserved as InterferenceHashSet, and a template to run two such datastructures in parallel, checking their equivalence was added: InstrumentedInterferenceGraph. Running with it and reportInterferenceGraphMemoryUse set to true was used to compute the numbers given above. - There was already some template parameter to change the size of the tmp indices from unsigned to uint16_t but the code failed to compile unless it was unsigned. I fixed this, made more consistent use of it, and switched to uint16_t in the very common case that we have less than 65k Tmps (we can have more despite the option because of spilling). This halved the memory usage of various other datastructures in the register allocator - unspillableTmps was a HashSet<unsigned>. Since it is often quite dense (often around 20% on JetStream2), I replaced it by a Bitvector instead - m_biases was a HashMap<IndexType, HashSet<IndexType>>. Since it is extremely rare that the sets have more than 8 elements (from looking at some instrumented run of JetStream2), I replaced it by HashMap<IndexType, SmallSet<IndexType>>. This not only significantly reduces memory, but nearly halves the time spent in assignColors(around 80ms -> 40ms in JetStream 2) - UseCounts was needlessly general: it is only used by the register allocator (all other references to UseCounts refer to the completely different B3::UseCounts), so there is no point in it computing, and then storing lots of irrelevant data. A float is also more than enough precision (especially since it is pretty much always 1, 10, 100, or 1000 in practice…). Also, since we only need it indexed by Tmps, we can use a Vector with AbsoluteTmpMapper instead of its HashMap. These changes are not just memory savings, they also make selectSpill way faster (570ms -> 250ms on my machine on JetStream2) - While I was at it, I did a couple of other tweaks to the logic of selectSpill. In particular, instead of having to check for isFastTmp every time, I just put the fast tmps directly in unspillableTmps, which prevents them from getting added to m_spillWorklist in the first place. This + a bit of clean-up (for example putting an early exit instead of setting score to infinity in the case of dead tmps) resulted in a further perf win (to roughly 200ms spent in selectSpill() on JetStream2) All together, this patch reduces the time spent in the register allocator by roughly 15 to 20% in JetStream2 (tested both with the Briggs and the IRC allocators on my MBP 2019). I do not yet have precise performance numbers for this exact patch, but benchmarking a previous version of it (with a less optimized interference graph) resulted in significant RAMification improvements (around 1%), and more surprisingly some JetStream2 improvements on weaker machines (e.g. an iPhone 7 gained > 1%). I believe these gains come either from less trashing of the caches, or less contention caused by the memory traffic. I will try to update the bugzilla with more up-to-date thorough results when I get them. This patch does not increase Options::maximumTmpsForGraphColoring, I intend to do that in a separate patch to make it easier to revert in case of a problem. * b3/B3ReduceLoopStrength.cpp: (JSC::B3::ReduceLoopStrength::reduceByteCopyLoopsToMemcpy): * b3/air/AirAllocateRegistersAndStackByLinearScan.cpp: * b3/air/AirAllocateRegistersByGraphColoring.cpp: (JSC::B3::Air::allocateRegistersByGraphColoring): * b3/air/AirCode.h: (JSC::B3::Air::Code::forEachFastTmp const): * b3/air/AirUseCounts.h: (JSC::B3::Air::UseCounts::UseCounts): (JSC::B3::Air::UseCounts::isConstDef const): (JSC::B3::Air::UseCounts::numWarmUsesAndDefs const): (JSC::B3::Air::UseCounts::dump const): * parser/Nodes.h: Source/WTF: Two changes: the addition of LikelyDenseUnsignedIntegerSet, and various improvements to Small(Ptr)Set. The latter include: - Renaming SmallPtrSet into SmallSet, as it now supports integers as well as pointers. - Reducing its size by sharing the same storage for m_buffer and for m_smallStorage. This is safe to do, because all operations branch on isSmall() which depends purely on m_capacity. - Adding trivial size(), isEmpty() and memoryUse() methods - Adding a comment at the top of the file explaining when to use, and (more importantly) not to use SmallSet. LikelyDenseUnsignedIntegerSet is an even more specialized data structure, that can represent sets of unsigned integers very compactly if they are clustered. Finally I added an outOfLineMemoryUse() method to BitVector, making it more convenient to compare the memory consumption of different data structures in the register allocator. * WTF.xcodeproj/project.pbxproj: * wtf/BitVector.h: * wtf/CMakeLists.txt: * wtf/LikelyDenseUnsignedIntegerSet.cpp: Copied from Source/WTF/wtf/SmallPtrSet.cpp. * wtf/LikelyDenseUnsignedIntegerSet.h: Added. (WTF::LikelyDenseUnsignedIntegerSet::LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::~LikelyDenseUnsignedIntegerSet): (WTF::LikelyDenseUnsignedIntegerSet::contains const): (WTF::LikelyDenseUnsignedIntegerSet::add): (WTF::LikelyDenseUnsignedIntegerSet::size const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::iterator): (WTF::LikelyDenseUnsignedIntegerSet::iterator::m_shift): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator++): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator* const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator== const): (WTF::LikelyDenseUnsignedIntegerSet::iterator::operator!= const): (WTF::LikelyDenseUnsignedIntegerSet::begin const): (WTF::LikelyDenseUnsignedIntegerSet::end const): (WTF::LikelyDenseUnsignedIntegerSet::memoryUse const): (WTF::LikelyDenseUnsignedIntegerSet::validate const): (WTF::LikelyDenseUnsignedIntegerSet::isBitVector const): (WTF::LikelyDenseUnsignedIntegerSet::isValidValue const): (WTF::LikelyDenseUnsignedIntegerSet::transitionToHashSet): (WTF::LikelyDenseUnsignedIntegerSet::transitionToBitVector): * wtf/SmallPtrSet.h: Removed. * wtf/SmallSet.cpp: Renamed from Source/WTF/wtf/SmallPtrSet.cpp. * wtf/SmallSet.h: Added. Tools: Simply added some tests for SmallSet. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/SmallSet.cpp: Added. (TestWebKitAPI::testSmallSetOfUnsigned): (TestWebKitAPI::testSmallSetOfPointers): (TestWebKitAPI::testVectorsOfSmallSetsOfUnsigned): (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/237893@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@277714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2021-05-19 03:24:14 +00:00
unsigned outOfLineMemoryUse() const
{
if (isInline())
return 0;
return byteCount(size());
}
It should be possible to run liveness over registers without also tracking Tmps https://bugs.webkit.org/show_bug.cgi?id=152963 Reviewed by Saam Barati. Source/JavaScriptCore: This adds a RegLivenessAdapter so that we can run Liveness over registers. This makes it easier to write certain kinds of phases, like ReportUsedRegisters. I anticipate writing more code like that for handling cold function calls. It also makes code like that somewhat more scalable, since we're no longer using HashSets. Currently, the way we track sets of registers is with a BitVector. Normally, we use the RegisterSet class, which wraps BitVector, so that we can add()/contains() on Reg's. But in the liveness analysis, everything gets turned into an index. So, we want to use BitVector directly. To do that, I needed to make the BitVector API look a bit more like a set API. I think that this is good, because the lack of set methods (add/remove/contains) has caused bugs in the past. This makes BitVector have methods both for set operations on bits and array operations on bits. I think that's good, since BitVector gets used in both contexts. * b3/B3IndexSet.h: (JSC::B3::IndexSet::Iterable::iterator::iterator): (JSC::B3::IndexSet::Iterable::begin): (JSC::B3::IndexSet::dump): * b3/air/AirInstInlines.h: (JSC::B3::Air::ForEach<Tmp>::forEach): (JSC::B3::Air::ForEach<Arg>::forEach): (JSC::B3::Air::ForEach<Reg>::forEach): (JSC::B3::Air::Inst::forEach): * b3/air/AirLiveness.h: (JSC::B3::Air::RegLivenessAdapter::RegLivenessAdapter): (JSC::B3::Air::RegLivenessAdapter::maxIndex): (JSC::B3::Air::RegLivenessAdapter::acceptsType): (JSC::B3::Air::RegLivenessAdapter::valueToIndex): (JSC::B3::Air::RegLivenessAdapter::indexToValue): * b3/air/AirReportUsedRegisters.cpp: (JSC::B3::Air::reportUsedRegisters): * jit/Reg.h: (JSC::Reg::next): (JSC::Reg::index): (JSC::Reg::maxIndex): (JSC::Reg::isSet): (JSC::Reg::operator bool): * jit/RegisterSet.h: (JSC::RegisterSet::forEach): Source/WTF: Add set methods (add/contains/remove) to BitVector, since it gets used as a set in a lot of places. This also makes BitVector a drop-in replacement for HashSet<unsigned> in a lot of places. Also made the iterator methods of BitVector live on BitVector directly rather than behind the thing returned from setBits(). This makes sense since that makes BitVector even more of a drop-in for HashSet. It's not harmful since we've never added any other mode of iterating a BitVector other than this, so it doesn't make sense to make it harder to access. * wtf/BitVector.h: (WTF::BitVector::get): (WTF::BitVector::contains): (WTF::BitVector::set): (WTF::BitVector::add): (WTF::BitVector::ensureSizeAndSet): (WTF::BitVector::clear): (WTF::BitVector::remove): (WTF::BitVector::hash): (WTF::BitVector::iterator::iterator): (WTF::BitVector::iterator::operator*): (WTF::BitVector::iterator::operator++): (WTF::BitVector::iterator::operator==): (WTF::BitVector::iterator::operator!=): (WTF::BitVector::begin): (WTF::BitVector::end): (WTF::BitVector::bitsInPointer): (WTF::BitVector::SetBitsIterable::SetBitsIterable): Deleted. (WTF::BitVector::SetBitsIterable::iterator::iterator): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator*): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator++): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator==): Deleted. (WTF::BitVector::SetBitsIterable::iterator::operator!=): Deleted. (WTF::BitVector::SetBitsIterable::begin): Deleted. (WTF::BitVector::SetBitsIterable::end): Deleted. (WTF::BitVector::setBits): Deleted. Canonical link: https://commits.webkit.org/171043@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@194834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-01-11 00:58:34 +00:00
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
private:
Cache bytecode to disk https://bugs.webkit.org/show_bug.cgi?id=192782 <rdar://problem/46084932> Reviewed by Keith Miller. Source/JavaScriptCore: Add the logic to serialize and deserialize the new JSC bytecode. For now, the cache is only used for tests. Each class that can be serialized has a counterpart in CachedTypes, which handles the decoding and encoding. When decoding, the cached objects are mmap'd from disk, but only used for creating instances of the respective in-memory version of each object. Ideally, the mmap'd objects should be used at runtime in the future. * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * Sources.txt: * builtins/BuiltinNames.cpp: (JSC::BuiltinNames::BuiltinNames): * builtins/BuiltinNames.h: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::setConstantIdentifierSetRegisters): * bytecode/CodeBlock.h: * bytecode/HandlerInfo.h: (JSC::UnlinkedHandlerInfo::UnlinkedHandlerInfo): * bytecode/InstructionStream.h: * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::addSetConstant): (JSC::UnlinkedCodeBlock::constantIdentifierSets): * bytecode/UnlinkedEvalCodeBlock.h: * bytecode/UnlinkedFunctionCodeBlock.h: * bytecode/UnlinkedFunctionExecutable.h: * bytecode/UnlinkedGlobalCodeBlock.h: (JSC::UnlinkedGlobalCodeBlock::UnlinkedGlobalCodeBlock): * bytecode/UnlinkedMetadataTable.h: * bytecode/UnlinkedModuleProgramCodeBlock.h: * bytecode/UnlinkedProgramCodeBlock.h: * interpreter/Interpreter.cpp: * jsc.cpp: (functionQuit): (runJSC): * parser/SourceCode.h: * parser/SourceCodeKey.h: (JSC::SourceCodeKey::operator!= const): * parser/UnlinkedSourceCode.h: * parser/VariableEnvironment.h: * runtime/CachedTypes.cpp: Added. (JSC::Encoder::Allocation::buffer const): (JSC::Encoder::Allocation::offset const): (JSC::Encoder::Allocation::Allocation): (JSC::Encoder::Encoder): (JSC::Encoder::vm): (JSC::Encoder::malloc): (JSC::Encoder::offsetOf): (JSC::Encoder::cachePtr): (JSC::Encoder::offsetForPtr): (JSC::Encoder::release): (JSC::Encoder::Page::Page): (JSC::Encoder::Page::malloc): (JSC::Encoder::Page::buffer const): (JSC::Encoder::Page::size const): (JSC::Encoder::Page::getOffset const): (JSC::Encoder::allocateNewPage): (JSC::Decoder::Decoder): (JSC::Decoder::~Decoder): (JSC::Decoder::vm): (JSC::Decoder::offsetOf): (JSC::Decoder::cacheOffset): (JSC::Decoder::addFinalizer): (JSC::encode): (JSC::decode): (JSC::VariableLengthObject::buffer const): (JSC::VariableLengthObject::allocate): (JSC::CachedPtr::encode): (JSC::CachedPtr::decode const): (JSC::CachedPtr::operator-> const): (JSC::CachedPtr::get const): (JSC::CachedRefPtr::encode): (JSC::CachedRefPtr::decode const): (JSC::CachedWriteBarrier::encode): (JSC::CachedWriteBarrier::decode const): (JSC::CachedVector::encode): (JSC::CachedVector::decode const): (JSC::CachedPair::encode): (JSC::CachedPair::decode const): (JSC::CachedHashMap::encode): (JSC::CachedHashMap::decode const): (JSC::CachedUniquedStringImpl::encode): (JSC::CachedUniquedStringImpl::decode const): (JSC::CachedStringImpl::encode): (JSC::CachedStringImpl::decode const): (JSC::CachedString::encode): (JSC::CachedString::decode const): (JSC::CachedIdentifier::encode): (JSC::CachedIdentifier::decode const): (JSC::CachedOptional::encode): (JSC::CachedOptional::decode const): (JSC::CachedOptional::decodeAsPtr const): (JSC::CachedSimpleJumpTable::encode): (JSC::CachedSimpleJumpTable::decode const): (JSC::CachedStringJumpTable::encode): (JSC::CachedStringJumpTable::decode const): (JSC::CachedCodeBlockRareData::encode): (JSC::CachedCodeBlockRareData::decode const): (JSC::CachedBitVector::encode): (JSC::CachedBitVector::decode const): (JSC::CachedHashSet::encode): (JSC::CachedHashSet::decode const): (JSC::CachedConstantIdentifierSetEntry::encode): (JSC::CachedConstantIdentifierSetEntry::decode const): (JSC::CachedVariableEnvironment::encode): (JSC::CachedVariableEnvironment::decode const): (JSC::CachedArray::encode): (JSC::CachedArray::decode const): (JSC::CachedScopedArgumentsTable::encode): (JSC::CachedScopedArgumentsTable::decode const): (JSC::CachedSymbolTableEntry::encode): (JSC::CachedSymbolTableEntry::decode const): (JSC::CachedSymbolTable::encode): (JSC::CachedSymbolTable::decode const): (JSC::CachedImmutableButterfly::encode): (JSC::CachedImmutableButterfly::decode const): (JSC::CachedRegExp::encode): (JSC::CachedRegExp::decode const): (JSC::CachedTemplateObjectDescriptor::encode): (JSC::CachedTemplateObjectDescriptor::decode const): (JSC::CachedBigInt::encode): (JSC::CachedBigInt::decode const): (JSC::CachedJSValue::encode): (JSC::CachedJSValue::decode const): (JSC::CachedInstructionStream::encode): (JSC::CachedInstructionStream::decode const): (JSC::CachedMetadataTable::encode): (JSC::CachedMetadataTable::decode const): (JSC::CachedSourceOrigin::encode): (JSC::CachedSourceOrigin::decode const): (JSC::CachedTextPosition::encode): (JSC::CachedTextPosition::decode const): (JSC::CachedSourceProviderShape::encode): (JSC::CachedSourceProviderShape::decode const): (JSC::CachedStringSourceProvider::encode): (JSC::CachedStringSourceProvider::decode const): (JSC::CachedWebAssemblySourceProvider::encode): (JSC::CachedWebAssemblySourceProvider::decode const): (JSC::CachedSourceProvider::encode): (JSC::CachedSourceProvider::decode const): (JSC::CachedUnlinkedSourceCodeShape::encode): (JSC::CachedUnlinkedSourceCodeShape::decode const): (JSC::CachedSourceCode::encode): (JSC::CachedSourceCode::decode const): (JSC::CachedFunctionExecutable::firstLineOffset const): (JSC::CachedFunctionExecutable::lineCount const): (JSC::CachedFunctionExecutable::unlinkedFunctionNameStart const): (JSC::CachedFunctionExecutable::unlinkedBodyStartColumn const): (JSC::CachedFunctionExecutable::unlinkedBodyEndColumn const): (JSC::CachedFunctionExecutable::startOffset const): (JSC::CachedFunctionExecutable::sourceLength const): (JSC::CachedFunctionExecutable::parametersStartOffset const): (JSC::CachedFunctionExecutable::typeProfilingStartOffset const): (JSC::CachedFunctionExecutable::typeProfilingEndOffset const): (JSC::CachedFunctionExecutable::parameterCount const): (JSC::CachedFunctionExecutable::features const): (JSC::CachedFunctionExecutable::sourceParseMode const): (JSC::CachedFunctionExecutable::isInStrictContext const): (JSC::CachedFunctionExecutable::hasCapturedVariables const): (JSC::CachedFunctionExecutable::isBuiltinFunction const): (JSC::CachedFunctionExecutable::isBuiltinDefaultClassConstructor const): (JSC::CachedFunctionExecutable::constructAbility const): (JSC::CachedFunctionExecutable::constructorKind const): (JSC::CachedFunctionExecutable::functionMode const): (JSC::CachedFunctionExecutable::scriptMode const): (JSC::CachedFunctionExecutable::superBinding const): (JSC::CachedFunctionExecutable::derivedContextType const): (JSC::CachedFunctionExecutable::name const): (JSC::CachedFunctionExecutable::ecmaName const): (JSC::CachedFunctionExecutable::inferredName const): (JSC::CachedCodeBlock::instructions const): (JSC::CachedCodeBlock::thisRegister const): (JSC::CachedCodeBlock::scopeRegister const): (JSC::CachedCodeBlock::globalObjectRegister const): (JSC::CachedCodeBlock::sourceURLDirective const): (JSC::CachedCodeBlock::sourceMappingURLDirective const): (JSC::CachedCodeBlock::usesEval const): (JSC::CachedCodeBlock::isStrictMode const): (JSC::CachedCodeBlock::isConstructor const): (JSC::CachedCodeBlock::hasCapturedVariables const): (JSC::CachedCodeBlock::isBuiltinFunction const): (JSC::CachedCodeBlock::superBinding const): (JSC::CachedCodeBlock::scriptMode const): (JSC::CachedCodeBlock::isArrowFunctionContext const): (JSC::CachedCodeBlock::isClassContext const): (JSC::CachedCodeBlock::wasCompiledWithDebuggingOpcodes const): (JSC::CachedCodeBlock::constructorKind const): (JSC::CachedCodeBlock::derivedContextType const): (JSC::CachedCodeBlock::evalContextType const): (JSC::CachedCodeBlock::hasTailCalls const): (JSC::CachedCodeBlock::lineCount const): (JSC::CachedCodeBlock::endColumn const): (JSC::CachedCodeBlock::numVars const): (JSC::CachedCodeBlock::numCalleeLocals const): (JSC::CachedCodeBlock::numParameters const): (JSC::CachedCodeBlock::features const): (JSC::CachedCodeBlock::parseMode const): (JSC::CachedCodeBlock::codeType const): (JSC::CachedCodeBlock::rareData const): (JSC::CachedProgramCodeBlock::encode): (JSC::CachedProgramCodeBlock::decode const): (JSC::CachedModuleCodeBlock::encode): (JSC::CachedModuleCodeBlock::decode const): (JSC::CachedEvalCodeBlock::encode): (JSC::CachedEvalCodeBlock::decode const): (JSC::CachedFunctionCodeBlock::encode): (JSC::CachedFunctionCodeBlock::decode const): (JSC::UnlinkedFunctionCodeBlock::UnlinkedFunctionCodeBlock): (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock): (JSC::CachedCodeBlock<CodeBlockType>::decode const): (JSC::UnlinkedProgramCodeBlock::UnlinkedProgramCodeBlock): (JSC::UnlinkedModuleProgramCodeBlock::UnlinkedModuleProgramCodeBlock): (JSC::UnlinkedEvalCodeBlock::UnlinkedEvalCodeBlock): (JSC::CachedFunctionExecutable::encode): (JSC::CachedFunctionExecutable::decode const): (JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable): (JSC::CachedCodeBlock<CodeBlockType>::encode): (JSC::CachedSourceCodeKey::encode): (JSC::CachedSourceCodeKey::decode const): (JSC::CacheEntry::encode): (JSC::CacheEntry:: const): (JSC:: const): (JSC::encodeCodeBlock): (JSC::decodeCodeBlockImpl): * runtime/CachedTypes.h: Copied from Source/JavaScriptCore/bytecode/UnlinkedGlobalCodeBlock.h. (JSC::decodeCodeBlock): * runtime/CodeCache.cpp: (JSC::CodeCacheMap::pruneSlowCase): (JSC::CodeCache::getUnlinkedGlobalCodeBlock): (JSC::CodeCache::getUnlinkedGlobalFunctionExecutable): (JSC::CodeCache::write): * runtime/CodeCache.h: (JSC::CodeCacheMap::begin): (JSC::CodeCacheMap::end): (JSC::CodeCacheMap::fetchFromDiskImpl): (JSC::CodeCacheMap::findCacheAndUpdateAge): (JSC::writeCodeBlock): * runtime/JSBigInt.cpp: * runtime/JSBigInt.h: * runtime/Options.cpp: (JSC::recomputeDependentOptions): * runtime/RegExp.h: * runtime/ScopedArgumentsTable.h: * runtime/StackFrame.h: * runtime/StructureInlines.h: * runtime/SymbolTable.h: Source/WTF: BitVectors have to be friends with JSC::CacheBitVector to allow serializing its buffer as part of the bytecode cache encoding. * wtf/BitVector.h: Tools: Add test helper to execute bytecode-cache tests: it executes each test twice, the first with JSC_diskCachePath set to a temporary directory and second with JSC_forceDiskCache=true (in addition to the cache path) to guarantee that only the disk cache is being used and no new UnlinkedCodeBlocks are being created. * Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper.sh: Added. * Scripts/run-jsc-stress-tests: Canonical link: https://commits.webkit.org/208177@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-01-22 18:00:14 +00:00
friend class JSC::CachedBitVector;
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static unsigned bitsInPointer()
{
return sizeof(void*) << 3;
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static unsigned maxInlineBits()
{
return bitsInPointer() - 1;
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static size_t byteCount(size_t bitCount)
{
return (bitCount + 7) >> 3;
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static uintptr_t makeInlineBits(uintptr_t bits)
{
ASSERT(!(bits & (static_cast<uintptr_t>(1) << maxInlineBits())));
return bits | (static_cast<uintptr_t>(1) << maxInlineBits());
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
}
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries https://bugs.webkit.org/show_bug.cgi?id=123076 Source/JavaScriptCore: Reviewed by Sam Weinig. Start preparing for a world in which we are patching code generated by LLVM, which may have very different register usage conventions than our JITs. This requires us being more explicit about the registers we are using. For example, the repatching code shouldn't take for granted that tagMaskRegister holds the TagMask or that the register is even in use. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.h: (JSC::MacroAssembler::numberOfRegisters): (JSC::MacroAssembler::registerIndex): (JSC::MacroAssembler::numberOfFPRegisters): (JSC::MacroAssembler::fpRegisterIndex): (JSC::MacroAssembler::totalNumberOfRegisters): * bytecode/StructureStubInfo.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::usedRegisters): * dfg/DFGSpeculativeJIT.h: * ftl/FTLSaveRestore.cpp: (JSC::FTL::bytesForGPRs): (JSC::FTL::bytesForFPRs): (JSC::FTL::offsetOfGPR): (JSC::FTL::offsetOfFPR): * jit/JITInlineCacheGenerator.cpp: (JSC::JITByIdGenerator::JITByIdGenerator): (JSC::JITPutByIdGenerator::JITPutByIdGenerator): * jit/JITInlineCacheGenerator.h: (JSC::JITGetByIdGenerator::JITGetByIdGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/RegisterSet.cpp: Added. (JSC::RegisterSet::specialRegisters): * jit/RegisterSet.h: Added. (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::set): (JSC::RegisterSet::clear): (JSC::RegisterSet::get): (JSC::RegisterSet::merge): * jit/Repatch.cpp: (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::tryRepatchIn): (JSC::linkClosureCall): * jit/TempRegisterSet.cpp: Added. (JSC::TempRegisterSet::TempRegisterSet): * jit/TempRegisterSet.h: Source/WTF: Reviewed by Sam Weinig. Teach BitVector how to efficiently merge (i.e. bitvector |=). * wtf/BitVector.cpp: (WTF::BitVector::mergeSlow): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::cleanseInlineBits): Canonical link: https://commits.webkit.org/141168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-21 04:48:29 +00:00
static uintptr_t cleanseInlineBits(uintptr_t bits)
{
return bits & ~(static_cast<uintptr_t>(1) << maxInlineBits());
}
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
static size_t bitCount(uintptr_t bits)
{
if (sizeof(uintptr_t) == 4)
return WTF::bitCount(static_cast<unsigned>(bits));
return WTF::bitCount(static_cast<uint64_t>(bits));
}
Beef up the DFG's CFG analyses to include iterated dominance frontiers and more user-friendly BlockSets https://bugs.webkit.org/show_bug.cgi?id=136520 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add code to compute iterated dominance frontiers. This involves using BlockSet a lot, so this patch also makes BlockSet a lot more user-friendly. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGBasicBlock.h: * dfg/DFGBlockSet.cpp: Added. (JSC::DFG::BlockSet::dump): * dfg/DFGBlockSet.h: (JSC::DFG::BlockSet::iterator::iterator): (JSC::DFG::BlockSet::iterator::operator++): (JSC::DFG::BlockSet::iterator::operator==): (JSC::DFG::BlockSet::iterator::operator!=): (JSC::DFG::BlockSet::Iterable::Iterable): (JSC::DFG::BlockSet::Iterable::begin): (JSC::DFG::BlockSet::Iterable::end): (JSC::DFG::BlockSet::iterable): (JSC::DFG::BlockAdder::BlockAdder): (JSC::DFG::BlockAdder::operator()): * dfg/DFGBlockSetInlines.h: Added. (JSC::DFG::BlockSet::iterator::operator*): * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::strictDominatorsOf): (JSC::DFG::Dominators::dominatorsOf): (JSC::DFG::Dominators::blocksStrictlyDominatedBy): (JSC::DFG::Dominators::blocksDominatedBy): (JSC::DFG::Dominators::dominanceFrontierOf): (JSC::DFG::Dominators::iteratedDominanceFrontierOf): * dfg/DFGDominators.h: (JSC::DFG::Dominators::forAllStrictDominatorsOf): (JSC::DFG::Dominators::forAllDominatorsOf): (JSC::DFG::Dominators::forAllBlocksStrictlyDominatedBy): (JSC::DFG::Dominators::forAllBlocksDominatedBy): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOfImpl): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): Source/WTF: Give BitVector a way to quickly find the next set (or unset) bit. Make BitVector equality faster. Fix a minor closure goof in Spectrum. * wtf/BitVector.cpp: (WTF::BitVector::equalsSlowCase): (WTF::BitVector::equalsSlowCaseFast): (WTF::BitVector::equalsSlowCaseSimple): * wtf/BitVector.h: (WTF::BitVector::findBit): (WTF::BitVector::findBitFast): (WTF::BitVector::findBitSimple): (WTF::BitVector::findBitInWord): * wtf/Spectrum.h: (WTF::Spectrum::removeIf): Canonical link: https://commits.webkit.org/154343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-04 21:08:38 +00:00
size_t findBitFast(size_t startIndex, bool value) const
{
if (isInline()) {
size_t index = startIndex;
findBitInWord(m_bitsOrPointer, index, maxInlineBits(), value);
return index;
}
const OutOfLineBits* bits = outOfLineBits();
// value = true: casts to 1, then xors to 0, then negates to 0.
// value = false: casts to 0, then xors to 1, then negates to -1 (i.e. all one bits).
uintptr_t skipValue = -(static_cast<uintptr_t>(value) ^ 1);
size_t numWords = bits->numWords();
size_t wordIndex = startIndex / bitsInPointer();
size_t startIndexInWord = startIndex - wordIndex * bitsInPointer();
while (wordIndex < numWords) {
uintptr_t word = bits->bits()[wordIndex];
if (word != skipValue) {
size_t index = startIndexInWord;
if (findBitInWord(word, index, bitsInPointer(), value))
return wordIndex * bitsInPointer() + index;
}
wordIndex++;
startIndexInWord = 0;
}
return bits->numBits();
}
size_t findBitSimple(size_t index, bool value) const
{
while (index < size()) {
if (get(index) == value)
return index;
index++;
}
return size();
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
class OutOfLineBits {
public:
size_t numBits() const { return m_numBits; }
Unreviewed, roll out r228306 (custom memcpy/memset) because the bots say that it was not a progression. Source/bmalloc: * bmalloc/Algorithm.h: (bmalloc::fastCopy): Deleted. (bmalloc::fastZeroFill): Deleted. * bmalloc/Allocator.cpp: (bmalloc::Allocator::reallocate): * bmalloc/Bits.h: (bmalloc::BitsWordOwner::operator=): (bmalloc::BitsWordOwner::clearAll): (bmalloc::BitsWordOwner::set): * bmalloc/IsoPageInlines.h: (bmalloc::IsoPage<Config>::IsoPage): * bmalloc/Vector.h: (bmalloc::Vector<T>::reallocateBuffer): Source/JavaScriptCore: * assembler/AssemblerBuffer.h: (JSC::AssemblerBuffer::append): * heap/LargeAllocation.cpp: (JSC::LargeAllocation::tryCreate): * heap/MarkedBlock.cpp: (JSC::MarkedBlock::Handle::didAddToDirectory): * runtime/ArrayBuffer.cpp: (JSC::ArrayBufferContents::tryAllocate): (JSC::ArrayBufferContents::copyTo): (JSC::ArrayBuffer::createInternal): * runtime/ArrayBufferView.h: (JSC::ArrayBufferView::zeroRangeImpl): * runtime/ArrayConventions.cpp: (JSC::clearArrayMemset): * runtime/ArrayConventions.h: (JSC::clearArray): * runtime/ArrayPrototype.cpp: (JSC::arrayProtoPrivateFuncConcatMemcpy): * runtime/ButterflyInlines.h: (JSC::Butterfly::tryCreate): (JSC::Butterfly::createOrGrowPropertyStorage): (JSC::Butterfly::growArrayRight): (JSC::Butterfly::resizeArray): * runtime/GenericTypedArrayViewInlines.h: (JSC::GenericTypedArrayView<Adaptor>::create): * runtime/JSArray.cpp: (JSC::JSArray::appendMemcpy): (JSC::JSArray::fastSlice): * runtime/JSArrayBufferView.cpp: (JSC::JSArrayBufferView::ConstructionContext::ConstructionContext): * runtime/JSGenericTypedArrayViewInlines.h: (JSC::JSGenericTypedArrayView<Adaptor>::set): * runtime/JSObject.cpp: (JSC::JSObject::constructConvertedArrayStorageWithoutCopyingElements): (JSC::JSObject::shiftButterflyAfterFlattening): * runtime/PropertyTable.cpp: (JSC::PropertyTable::PropertyTable): Source/WTF: * WTF.xcodeproj/project.pbxproj: * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::clearAll): (WTF::BitVector::resizeOutOfLine): * wtf/BitVector.h: (WTF::BitVector::OutOfLineBits::numWords const): (WTF::BitVector::wordCount): Deleted. * wtf/CMakeLists.txt: * wtf/ConcurrentBuffer.h: (WTF::ConcurrentBuffer::growExact): * wtf/FastBitVector.h: (WTF::FastBitVectorWordOwner::operator=): (WTF::FastBitVectorWordOwner::clearAll): (WTF::FastBitVectorWordOwner::set): * wtf/FastCopy.h: Removed. * wtf/FastMalloc.cpp: (WTF::fastZeroedMalloc): (WTF::fastStrDup): (WTF::tryFastZeroedMalloc): * wtf/FastZeroFill.h: Removed. * wtf/OSAllocator.h: (WTF::OSAllocator::reallocateCommitted): * wtf/StringPrintStream.cpp: (WTF::StringPrintStream::increaseSize): * wtf/Vector.h: * wtf/persistence/PersistentDecoder.cpp: (WTF::Persistence::Decoder::decodeFixedLengthData): * wtf/persistence/PersistentEncoder.cpp: (WTF::Persistence::Encoder::encodeFixedLengthData): * wtf/text/CString.cpp: (WTF::CString::init): (WTF::CString::copyBufferIfNeeded): * wtf/text/LineBreakIteratorPoolICU.h: (WTF::LineBreakIteratorPool::makeLocaleWithBreakKeyword): * wtf/text/StringBuilder.cpp: (WTF::StringBuilder::allocateBuffer): (WTF::StringBuilder::append): * wtf/text/StringConcatenate.h: * wtf/text/StringImpl.h: (WTF::StringImpl::copyCharacters): * wtf/text/icu/UTextProvider.cpp: (WTF::uTextCloneImpl): * wtf/text/icu/UTextProviderLatin1.cpp: (WTF::uTextLatin1Clone): (WTF::openLatin1UTextProvider): * wtf/threads/Signals.cpp: Canonical link: https://commits.webkit.org/198639@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2018-02-16 21:38:53 +00:00
size_t numWords() const { return (m_numBits + bitsInPointer() - 1) / bitsInPointer(); }
uintptr_t* bits() { return bitwise_cast<uintptr_t*>(this + 1); }
const uintptr_t* bits() const { return bitwise_cast<const uintptr_t*>(this + 1); }
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static WTF_EXPORT_PRIVATE OutOfLineBits* create(size_t numBits);
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
static WTF_EXPORT_PRIVATE void destroy(OutOfLineBits*);
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
private:
OutOfLineBits(size_t numBits)
: m_numBits(numBits)
{
}
size_t m_numBits;
};
bool isInline() const { return m_bitsOrPointer >> maxInlineBits(); }
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
const OutOfLineBits* outOfLineBits() const { return bitwise_cast<const OutOfLineBits*>(m_bitsOrPointer << 1); }
OutOfLineBits* outOfLineBits() { return bitwise_cast<OutOfLineBits*>(m_bitsOrPointer << 1); }
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
WTF_EXPORT_PRIVATE void resizeOutOfLine(size_t numBits);
WTF_EXPORT_PRIVATE void setSlow(const BitVector& other);
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries https://bugs.webkit.org/show_bug.cgi?id=123076 Source/JavaScriptCore: Reviewed by Sam Weinig. Start preparing for a world in which we are patching code generated by LLVM, which may have very different register usage conventions than our JITs. This requires us being more explicit about the registers we are using. For example, the repatching code shouldn't take for granted that tagMaskRegister holds the TagMask or that the register is even in use. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.h: (JSC::MacroAssembler::numberOfRegisters): (JSC::MacroAssembler::registerIndex): (JSC::MacroAssembler::numberOfFPRegisters): (JSC::MacroAssembler::fpRegisterIndex): (JSC::MacroAssembler::totalNumberOfRegisters): * bytecode/StructureStubInfo.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::usedRegisters): * dfg/DFGSpeculativeJIT.h: * ftl/FTLSaveRestore.cpp: (JSC::FTL::bytesForGPRs): (JSC::FTL::bytesForFPRs): (JSC::FTL::offsetOfGPR): (JSC::FTL::offsetOfFPR): * jit/JITInlineCacheGenerator.cpp: (JSC::JITByIdGenerator::JITByIdGenerator): (JSC::JITPutByIdGenerator::JITPutByIdGenerator): * jit/JITInlineCacheGenerator.h: (JSC::JITGetByIdGenerator::JITGetByIdGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/RegisterSet.cpp: Added. (JSC::RegisterSet::specialRegisters): * jit/RegisterSet.h: Added. (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::set): (JSC::RegisterSet::clear): (JSC::RegisterSet::get): (JSC::RegisterSet::merge): * jit/Repatch.cpp: (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::tryRepatchIn): (JSC::linkClosureCall): * jit/TempRegisterSet.cpp: Added. (JSC::TempRegisterSet::TempRegisterSet): * jit/TempRegisterSet.h: Source/WTF: Reviewed by Sam Weinig. Teach BitVector how to efficiently merge (i.e. bitvector |=). * wtf/BitVector.cpp: (WTF::BitVector::mergeSlow): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::cleanseInlineBits): Canonical link: https://commits.webkit.org/141168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-21 04:48:29 +00:00
WTF_EXPORT_PRIVATE void mergeSlow(const BitVector& other);
Switch FTL GetById/PutById IC's over to using AnyRegCC https://bugs.webkit.org/show_bug.cgi?id=124094 Source/JavaScriptCore: Reviewed by Sam Weinig. This closes the loop on inline caches (IC's) in the FTL. The goal is to have IC's in LLVM-generated code that are just as efficient (if not more so) than what a custom JIT could do. As in zero sources of overhead. Not a single extra instruction or even register allocation pathology. We accomplish this by having two thingies in LLVM. First is the llvm.experimental.patchpoint intrinsic, which is sort of an inline machine code snippet that we can fill in with whatever we want and then modify subsequently. But you have only two choices of how to pass values to a patchpoint: (1) via the calling convention or (2) via the stackmap. Neither are good for operands to an IC (like the base pointer for a GetById, for example). (1) is bad because it results in things being pinned to certain registers a priori; a custom JIT (like the DFG) will not pin IC operands to any registers a priori but will allow the register allocator to do whatever it wants. (2) is bad because the operands may be spilled or may be represented in other crazy ways. You generally want an IC to have its operands in registers. Also, patchpoints only return values using the calling convention, which is unfortunate since it pins the return value to a register a priori. This is where the second thingy comes in: the AnyRegCC. This is a special calling convention only for use with patchpoints. It means that arguments passed "by CC" in the patchpoint can be placed in any register, and the register that gets used is reported as part of the stackmap. It also means that the return value (if there is one) can be placed in any register, and the stackmap will tell you which one it was. Thus, patchpoints combined with AnyRegCC mean that you not only get the kind of self-modifying code that you want for IC's, but you also get all of the register allocation goodness that a custom JIT would have given you. Except that you're getting it from LLVM and not a custom JIT. Awesome. Even though all of the fun stuff is on the LLVM side, this patch was harder than you'd expect. First the obvious bits: - IC patchpoints now use AnyRegCC instead of the C CC. (CC = calling convention.) - FTL::fixFunctionBasedOnStackMaps() now correctly figures out which registers the IC is supposed to use instead of assuming C CC argument registers. And then all of the stuff that broke and that this patch fixes: - IC sizing based on generating a dummy IC (what FTLInlineCacheSize did) is totally bad on x86-64, where various register permutations lead to bizarre header bytes and eclectic SIB encodings. I changed that to have magic constants, for now. - Slow path calls didn't preserve the CC return register. - Repatch's scratch register allocation would get totally confused if the operand registers weren't one of the DFG-style "temp" registers. And by "totally confused" I mean that it would crash. - We assumed that r10 is callee-saved. It's not. That one dude's PPT about x86-64 cdecl that I found on the intertubes was not a trustworthy source of information, apparently. - Call repatching didn't know that the FTL does its IC slow calls via specially generated thunks. This was particularly fun to fix: basically, now when we relink an IC call in the FTL, we use the old call target to find the SlowPathCallKey, which tells us everything we need to know to generate (or look up) a new thunk for the new function we want to call. * assembler/MacroAssemblerCodeRef.h: (JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): (JSC::MacroAssemblerCodePtr::isEmptyValue): (JSC::MacroAssemblerCodePtr::isDeletedValue): (JSC::MacroAssemblerCodePtr::hash): (JSC::MacroAssemblerCodePtr::emptyValue): (JSC::MacroAssemblerCodePtr::deletedValue): (JSC::MacroAssemblerCodePtrHash::hash): (JSC::MacroAssemblerCodePtrHash::equal): * assembler/MacroAssemblerX86Common.h: * assembler/RepatchBuffer.h: (JSC::RepatchBuffer::RepatchBuffer): (JSC::RepatchBuffer::codeBlock): * ftl/FTLAbbreviations.h: (JSC::FTL::setInstructionCallingConvention): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheSize.cpp: (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLLocation.cpp: (JSC::FTL::Location::forStackmaps): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): (JSC::FTL::LowerDFGToLLVM::compilePutById): * ftl/FTLOSRExitCompiler.cpp: (JSC::FTL::compileStub): * ftl/FTLSlowPathCall.cpp: * ftl/FTLSlowPathCallKey.h: (JSC::FTL::SlowPathCallKey::withCallTarget): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): (JSC::FTL::StackMaps::Location::restoreInto): * ftl/FTLStackMaps.h: * ftl/FTLThunks.h: (JSC::FTL::generateIfNecessary): (JSC::FTL::keyForThunk): (JSC::FTL::Thunks::keyForSlowPathCallThunk): * jit/FPRInfo.h: (JSC::FPRInfo::toIndex): * jit/GPRInfo.h: (JSC::GPRInfo::toIndex): (JSC::GPRInfo::debugName): * jit/RegisterSet.cpp: (JSC::RegisterSet::calleeSaveRegisters): * jit/RegisterSet.h: (JSC::RegisterSet::filter): * jit/Repatch.cpp: (JSC::readCallTarget): (JSC::repatchCall): (JSC::repatchByIdSelfAccess): (JSC::tryCacheGetByID): (JSC::tryCachePutByID): (JSC::tryBuildPutByIdList): (JSC::resetGetByID): (JSC::resetPutByID): * jit/ScratchRegisterAllocator.h: (JSC::ScratchRegisterAllocator::lock): Source/WTF: Reviewed by Sam Weinig. I needed to add another set operation, namely filter(), which is an in-place set intersection. * wtf/BitVector.cpp: (WTF::BitVector::filterSlow): * wtf/BitVector.h: (WTF::BitVector::filter): Canonical link: https://commits.webkit.org/142336@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-11-11 07:30:50 +00:00
WTF_EXPORT_PRIVATE void filterSlow(const BitVector& other);
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
WTF_EXPORT_PRIVATE void excludeSlow(const BitVector& other);
WTF_EXPORT_PRIVATE size_t bitCountSlow() const;
WTF_EXPORT_PRIVATE bool isEmptySlow() const;
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
WTF_EXPORT_PRIVATE bool equalsSlowCase(const BitVector& other) const;
Beef up the DFG's CFG analyses to include iterated dominance frontiers and more user-friendly BlockSets https://bugs.webkit.org/show_bug.cgi?id=136520 Reviewed by Geoffrey Garen. Source/JavaScriptCore: Add code to compute iterated dominance frontiers. This involves using BlockSet a lot, so this patch also makes BlockSet a lot more user-friendly. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * dfg/DFGBasicBlock.h: * dfg/DFGBlockSet.cpp: Added. (JSC::DFG::BlockSet::dump): * dfg/DFGBlockSet.h: (JSC::DFG::BlockSet::iterator::iterator): (JSC::DFG::BlockSet::iterator::operator++): (JSC::DFG::BlockSet::iterator::operator==): (JSC::DFG::BlockSet::iterator::operator!=): (JSC::DFG::BlockSet::Iterable::Iterable): (JSC::DFG::BlockSet::Iterable::begin): (JSC::DFG::BlockSet::Iterable::end): (JSC::DFG::BlockSet::iterable): (JSC::DFG::BlockAdder::BlockAdder): (JSC::DFG::BlockAdder::operator()): * dfg/DFGBlockSetInlines.h: Added. (JSC::DFG::BlockSet::iterator::operator*): * dfg/DFGDominators.cpp: (JSC::DFG::Dominators::strictDominatorsOf): (JSC::DFG::Dominators::dominatorsOf): (JSC::DFG::Dominators::blocksStrictlyDominatedBy): (JSC::DFG::Dominators::blocksDominatedBy): (JSC::DFG::Dominators::dominanceFrontierOf): (JSC::DFG::Dominators::iteratedDominanceFrontierOf): * dfg/DFGDominators.h: (JSC::DFG::Dominators::forAllStrictDominatorsOf): (JSC::DFG::Dominators::forAllDominatorsOf): (JSC::DFG::Dominators::forAllBlocksStrictlyDominatedBy): (JSC::DFG::Dominators::forAllBlocksDominatedBy): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOf): (JSC::DFG::Dominators::forAllBlocksInDominanceFrontierOfImpl): (JSC::DFG::Dominators::forAllBlocksInIteratedDominanceFrontierOfImpl): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::dumpBlockHeader): * dfg/DFGInvalidationPointInjectionPhase.cpp: (JSC::DFG::InvalidationPointInjectionPhase::run): Source/WTF: Give BitVector a way to quickly find the next set (or unset) bit. Make BitVector equality faster. Fix a minor closure goof in Spectrum. * wtf/BitVector.cpp: (WTF::BitVector::equalsSlowCase): (WTF::BitVector::equalsSlowCaseFast): (WTF::BitVector::equalsSlowCaseSimple): * wtf/BitVector.h: (WTF::BitVector::findBit): (WTF::BitVector::findBitFast): (WTF::BitVector::findBitSimple): (WTF::BitVector::findBitInWord): * wtf/Spectrum.h: (WTF::Spectrum::removeIf): Canonical link: https://commits.webkit.org/154343@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173279 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-09-04 21:08:38 +00:00
bool equalsSlowCaseFast(const BitVector& other) const;
bool equalsSlowCaseSimple(const BitVector& other) const;
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
WTF_EXPORT_PRIVATE uintptr_t hashSlowCase() const;
StructureStubInfo's usedRegisters set should be able to track all registers, not just the ones that our JIT's view as temporaries https://bugs.webkit.org/show_bug.cgi?id=123076 Source/JavaScriptCore: Reviewed by Sam Weinig. Start preparing for a world in which we are patching code generated by LLVM, which may have very different register usage conventions than our JITs. This requires us being more explicit about the registers we are using. For example, the repatching code shouldn't take for granted that tagMaskRegister holds the TagMask or that the register is even in use. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MacroAssembler.h: (JSC::MacroAssembler::numberOfRegisters): (JSC::MacroAssembler::registerIndex): (JSC::MacroAssembler::numberOfFPRegisters): (JSC::MacroAssembler::fpRegisterIndex): (JSC::MacroAssembler::totalNumberOfRegisters): * bytecode/StructureStubInfo.h: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::usedRegisters): * dfg/DFGSpeculativeJIT.h: * ftl/FTLSaveRestore.cpp: (JSC::FTL::bytesForGPRs): (JSC::FTL::bytesForFPRs): (JSC::FTL::offsetOfGPR): (JSC::FTL::offsetOfFPR): * jit/JITInlineCacheGenerator.cpp: (JSC::JITByIdGenerator::JITByIdGenerator): (JSC::JITPutByIdGenerator::JITPutByIdGenerator): * jit/JITInlineCacheGenerator.h: (JSC::JITGetByIdGenerator::JITGetByIdGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/JITPropertyAccess32_64.cpp: (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emit_op_put_by_id): * jit/RegisterSet.cpp: Added. (JSC::RegisterSet::specialRegisters): * jit/RegisterSet.h: Added. (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::set): (JSC::RegisterSet::clear): (JSC::RegisterSet::get): (JSC::RegisterSet::merge): * jit/Repatch.cpp: (JSC::generateProtoChainAccessStub): (JSC::tryCacheGetByID): (JSC::tryBuildGetByIDList): (JSC::emitPutReplaceStub): (JSC::tryRepatchIn): (JSC::linkClosureCall): * jit/TempRegisterSet.cpp: Added. (JSC::TempRegisterSet::TempRegisterSet): * jit/TempRegisterSet.h: Source/WTF: Reviewed by Sam Weinig. Teach BitVector how to efficiently merge (i.e. bitvector |=). * wtf/BitVector.cpp: (WTF::BitVector::mergeSlow): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::cleanseInlineBits): Canonical link: https://commits.webkit.org/141168@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-21 04:48:29 +00:00
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
uintptr_t* bits()
{
if (isInline())
return &m_bitsOrPointer;
return outOfLineBits()->bits();
}
const uintptr_t* bits() const
{
if (isInline())
return &m_bitsOrPointer;
return outOfLineBits()->bits();
}
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
uintptr_t m_bitsOrPointer;
};
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
struct BitVectorHash {
static unsigned hash(const BitVector& vector) { return vector.hash(); }
static bool equal(const BitVector& a, const BitVector& b) { return a == b; }
Use constexpr instead of const in symbol definitions that are obviously constexpr. https://bugs.webkit.org/show_bug.cgi?id=201879 Rubber-stamped by Joseph Pecoraro. Source/bmalloc: * bmalloc/AvailableMemory.cpp: * bmalloc/IsoTLS.h: * bmalloc/Map.h: * bmalloc/Mutex.cpp: (bmalloc::Mutex::lockSlowCase): * bmalloc/PerThread.h: * bmalloc/Vector.h: * bmalloc/Zone.h: Source/JavaScriptCore: const may require external storage (at the compiler's whim) though these currently do not. constexpr makes it clear that the value is a literal constant that can be inlined. In most cases in the code, when we say static const, we actually mean static constexpr. I'm changing the code to reflect this. * API/JSAPIValueWrapper.h: * API/JSCallbackConstructor.h: * API/JSCallbackObject.h: * API/JSContextRef.cpp: * API/JSWrapperMap.mm: * API/tests/CompareAndSwapTest.cpp: * API/tests/TypedArrayCTest.cpp: * API/tests/testapi.mm: (testObjectiveCAPIMain): * KeywordLookupGenerator.py: (Trie.printAsC): * assembler/ARMv7Assembler.h: * assembler/AssemblerBuffer.h: * assembler/AssemblerCommon.h: * assembler/MacroAssembler.h: * assembler/MacroAssemblerARM64.h: * assembler/MacroAssemblerARM64E.h: * assembler/MacroAssemblerARMv7.h: * assembler/MacroAssemblerCodeRef.h: * assembler/MacroAssemblerMIPS.h: * assembler/MacroAssemblerX86.h: * assembler/MacroAssemblerX86Common.h: (JSC::MacroAssemblerX86Common::absDouble): (JSC::MacroAssemblerX86Common::negateDouble): * assembler/MacroAssemblerX86_64.h: * assembler/X86Assembler.h: * b3/B3Bank.h: * b3/B3CheckSpecial.h: * b3/B3DuplicateTails.cpp: * b3/B3EliminateCommonSubexpressions.cpp: * b3/B3FixSSA.cpp: * b3/B3FoldPathConstants.cpp: * b3/B3InferSwitches.cpp: * b3/B3Kind.h: * b3/B3LowerToAir.cpp: * b3/B3NativeTraits.h: * b3/B3ReduceDoubleToFloat.cpp: * b3/B3ReduceLoopStrength.cpp: * b3/B3ReduceStrength.cpp: * b3/B3ValueKey.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirAllocateStackByGraphColoring.cpp: * b3/air/AirArg.h: * b3/air/AirCCallSpecial.h: * b3/air/AirEmitShuffle.cpp: * b3/air/AirFixObviousSpills.cpp: * b3/air/AirFormTable.h: * b3/air/AirLowerAfterRegAlloc.cpp: * b3/air/AirPrintSpecial.h: * b3/air/AirStackAllocation.cpp: * b3/air/AirTmp.h: * b3/testb3_6.cpp: (testInterpreter): * bytecode/AccessCase.cpp: * bytecode/CallLinkStatus.cpp: * bytecode/CallVariant.h: * bytecode/CodeBlock.h: * bytecode/CodeOrigin.h: * bytecode/DFGExitProfile.h: * bytecode/DirectEvalCodeCache.h: * bytecode/ExecutableToCodeBlockEdge.h: * bytecode/GetterSetterAccessCase.cpp: * bytecode/LazyOperandValueProfile.h: * bytecode/ObjectPropertyCondition.h: * bytecode/ObjectPropertyConditionSet.cpp: * bytecode/PolymorphicAccess.cpp: * bytecode/PropertyCondition.h: * bytecode/SpeculatedType.h: * bytecode/StructureStubInfo.cpp: * bytecode/UnlinkedCodeBlock.cpp: (JSC::UnlinkedCodeBlock::typeProfilerExpressionInfoForBytecodeOffset): * bytecode/UnlinkedCodeBlock.h: * bytecode/UnlinkedEvalCodeBlock.h: * bytecode/UnlinkedFunctionCodeBlock.h: * bytecode/UnlinkedFunctionExecutable.h: * bytecode/UnlinkedModuleProgramCodeBlock.h: * bytecode/UnlinkedProgramCodeBlock.h: * bytecode/ValueProfile.h: * bytecode/VirtualRegister.h: * bytecode/Watchpoint.h: * bytecompiler/BytecodeGenerator.h: * bytecompiler/Label.h: * bytecompiler/NodesCodegen.cpp: (JSC::ThisNode::emitBytecode): * bytecompiler/RegisterID.h: * debugger/Breakpoint.h: * debugger/DebuggerParseData.cpp: * debugger/DebuggerPrimitives.h: * debugger/DebuggerScope.h: * dfg/DFGAbstractHeap.h: * dfg/DFGAbstractValue.h: * dfg/DFGArgumentsEliminationPhase.cpp: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCommon.h: * dfg/DFGCompilationKey.h: * dfg/DFGDesiredGlobalProperty.h: * dfg/DFGEdgeDominates.h: * dfg/DFGEpoch.h: * dfg/DFGForAllKills.h: (JSC::DFG::forAllKilledNodesAtNodeIndex): * dfg/DFGGraph.cpp: (JSC::DFG::Graph::isLiveInBytecode): * dfg/DFGHeapLocation.h: * dfg/DFGInPlaceAbstractState.cpp: * dfg/DFGIntegerCheckCombiningPhase.cpp: * dfg/DFGIntegerRangeOptimizationPhase.cpp: * dfg/DFGInvalidationPointInjectionPhase.cpp: * dfg/DFGLICMPhase.cpp: * dfg/DFGLazyNode.h: * dfg/DFGMinifiedID.h: * dfg/DFGMovHintRemovalPhase.cpp: * dfg/DFGNodeFlowProjection.h: * dfg/DFGNodeType.h: * dfg/DFGObjectAllocationSinkingPhase.cpp: * dfg/DFGPhantomInsertionPhase.cpp: * dfg/DFGPromotedHeapLocation.h: * dfg/DFGPropertyTypeKey.h: * dfg/DFGPureValue.h: * dfg/DFGPutStackSinkingPhase.cpp: * dfg/DFGRegisterBank.h: * dfg/DFGSSAConversionPhase.cpp: * dfg/DFGSSALoweringPhase.cpp: * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileDoubleRep): (JSC::DFG::compileClampDoubleToByte): (JSC::DFG::SpeculativeJIT::compileArithRounding): (JSC::DFG::compileArithPowIntegerFastPath): (JSC::DFG::SpeculativeJIT::compileArithPow): (JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse): * dfg/DFGStackLayoutPhase.cpp: * dfg/DFGStoreBarrierInsertionPhase.cpp: * dfg/DFGStrengthReductionPhase.cpp: * dfg/DFGStructureAbstractValue.h: * dfg/DFGVarargsForwardingPhase.cpp: * dfg/DFGVariableEventStream.cpp: (JSC::DFG::VariableEventStream::reconstruct const): * dfg/DFGWatchpointCollectionPhase.cpp: * disassembler/ARM64/A64DOpcode.h: * ftl/FTLLocation.h: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileArithRandom): * ftl/FTLSlowPathCall.cpp: * ftl/FTLSlowPathCallKey.h: * heap/CellContainer.h: * heap/CellState.h: * heap/ConservativeRoots.h: * heap/GCSegmentedArray.h: * heap/HandleBlock.h: * heap/Heap.cpp: (JSC::Heap::updateAllocationLimits): * heap/Heap.h: * heap/HeapSnapshot.h: * heap/HeapUtil.h: (JSC::HeapUtil::findGCObjectPointersForMarking): * heap/IncrementalSweeper.cpp: * heap/LargeAllocation.h: * heap/MarkedBlock.cpp: * heap/Strong.h: * heap/VisitRaceKey.h: * heap/Weak.h: * heap/WeakBlock.h: * inspector/JSInjectedScriptHost.h: * inspector/JSInjectedScriptHostPrototype.h: * inspector/JSJavaScriptCallFrame.h: * inspector/JSJavaScriptCallFramePrototype.h: * inspector/agents/InspectorConsoleAgent.cpp: * inspector/agents/InspectorRuntimeAgent.cpp: (Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets): * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: (CppProtocolTypesHeaderGenerator._generate_versions): * inspector/scripts/tests/generic/expected/version.json-result: * interpreter/Interpreter.h: * interpreter/ShadowChicken.cpp: * jit/BinarySwitch.cpp: * jit/CallFrameShuffler.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: * jit/GPRInfo.h: * jit/ICStats.h: * jit/JITThunks.h: * jit/Reg.h: * jit/RegisterSet.h: * jit/TempRegisterSet.h: * jsc.cpp: * parser/ASTBuilder.h: * parser/Nodes.h: * parser/SourceCodeKey.h: * parser/SyntaxChecker.h: * parser/VariableEnvironment.h: * profiler/ProfilerOrigin.h: * profiler/ProfilerOriginStack.h: * profiler/ProfilerUID.h: * runtime/AbstractModuleRecord.cpp: * runtime/ArrayBufferNeuteringWatchpointSet.h: * runtime/ArrayConstructor.h: * runtime/ArrayConventions.h: * runtime/ArrayIteratorPrototype.h: * runtime/ArrayPrototype.cpp: (JSC::setLength): * runtime/AsyncFromSyncIteratorPrototype.h: * runtime/AsyncGeneratorFunctionPrototype.h: * runtime/AsyncGeneratorPrototype.h: * runtime/AsyncIteratorPrototype.h: * runtime/AtomicsObject.cpp: * runtime/BigIntConstructor.h: * runtime/BigIntPrototype.h: * runtime/BooleanPrototype.h: * runtime/ClonedArguments.h: * runtime/CodeCache.h: * runtime/ControlFlowProfiler.h: * runtime/CustomGetterSetter.h: * runtime/DateConstructor.h: * runtime/DatePrototype.h: * runtime/DefinePropertyAttributes.h: * runtime/ErrorPrototype.h: * runtime/EvalExecutable.h: * runtime/Exception.h: * runtime/ExceptionHelpers.cpp: (JSC::invalidParameterInSourceAppender): (JSC::invalidParameterInstanceofSourceAppender): * runtime/ExceptionHelpers.h: * runtime/ExecutableBase.h: * runtime/FunctionExecutable.h: * runtime/FunctionRareData.h: * runtime/GeneratorPrototype.h: * runtime/GenericArguments.h: * runtime/GenericOffset.h: * runtime/GetPutInfo.h: * runtime/GetterSetter.h: * runtime/GlobalExecutable.h: * runtime/Identifier.h: * runtime/InspectorInstrumentationObject.h: * runtime/InternalFunction.h: * runtime/IntlCollatorConstructor.h: * runtime/IntlCollatorPrototype.h: * runtime/IntlDateTimeFormatConstructor.h: * runtime/IntlDateTimeFormatPrototype.h: * runtime/IntlNumberFormatConstructor.h: * runtime/IntlNumberFormatPrototype.h: * runtime/IntlObject.h: * runtime/IntlPluralRulesConstructor.h: * runtime/IntlPluralRulesPrototype.h: * runtime/IteratorPrototype.h: * runtime/JSArray.cpp: (JSC::JSArray::tryCreateUninitializedRestricted): * runtime/JSArray.h: * runtime/JSArrayBuffer.h: * runtime/JSArrayBufferView.h: * runtime/JSBigInt.h: * runtime/JSCJSValue.h: * runtime/JSCell.h: * runtime/JSCustomGetterSetterFunction.h: * runtime/JSDataView.h: * runtime/JSDataViewPrototype.h: * runtime/JSDestructibleObject.h: * runtime/JSFixedArray.h: * runtime/JSGenericTypedArrayView.h: * runtime/JSGlobalLexicalEnvironment.h: * runtime/JSGlobalObject.h: * runtime/JSImmutableButterfly.h: * runtime/JSInternalPromiseConstructor.h: * runtime/JSInternalPromiseDeferred.h: * runtime/JSInternalPromisePrototype.h: * runtime/JSLexicalEnvironment.h: * runtime/JSModuleEnvironment.h: * runtime/JSModuleLoader.h: * runtime/JSModuleNamespaceObject.h: * runtime/JSNonDestructibleProxy.h: * runtime/JSONObject.cpp: * runtime/JSONObject.h: * runtime/JSObject.h: * runtime/JSPromiseConstructor.h: * runtime/JSPromiseDeferred.h: * runtime/JSPromisePrototype.h: * runtime/JSPropertyNameEnumerator.h: * runtime/JSProxy.h: * runtime/JSScope.h: * runtime/JSScriptFetchParameters.h: * runtime/JSScriptFetcher.h: * runtime/JSSegmentedVariableObject.h: * runtime/JSSourceCode.h: * runtime/JSString.cpp: * runtime/JSString.h: * runtime/JSSymbolTableObject.h: * runtime/JSTemplateObjectDescriptor.h: * runtime/JSTypeInfo.h: * runtime/MapPrototype.h: * runtime/MinimumReservedZoneSize.h: * runtime/ModuleProgramExecutable.h: * runtime/NativeExecutable.h: * runtime/NativeFunction.h: * runtime/NativeStdFunctionCell.h: * runtime/NumberConstructor.h: * runtime/NumberPrototype.h: * runtime/ObjectConstructor.h: * runtime/ObjectPrototype.h: * runtime/ProgramExecutable.h: * runtime/PromiseDeferredTimer.cpp: * runtime/PropertyMapHashTable.h: * runtime/PropertyNameArray.h: (JSC::PropertyNameArray::add): * runtime/PrototypeKey.h: * runtime/ProxyConstructor.h: * runtime/ProxyObject.cpp: (JSC::ProxyObject::performGetOwnPropertyNames): * runtime/ProxyRevoke.h: * runtime/ReflectObject.h: * runtime/RegExp.h: * runtime/RegExpCache.h: * runtime/RegExpConstructor.h: * runtime/RegExpKey.h: * runtime/RegExpObject.h: * runtime/RegExpPrototype.h: * runtime/RegExpStringIteratorPrototype.h: * runtime/SamplingProfiler.cpp: * runtime/ScopedArgumentsTable.h: * runtime/ScriptExecutable.h: * runtime/SetPrototype.h: * runtime/SmallStrings.h: * runtime/SparseArrayValueMap.h: * runtime/StringConstructor.h: * runtime/StringIteratorPrototype.h: * runtime/StringObject.h: * runtime/StringPrototype.h: * runtime/Structure.h: * runtime/StructureChain.h: * runtime/StructureRareData.h: * runtime/StructureTransitionTable.h: * runtime/Symbol.h: * runtime/SymbolConstructor.h: * runtime/SymbolPrototype.h: * runtime/SymbolTable.h: * runtime/TemplateObjectDescriptor.h: * runtime/TypeProfiler.cpp: * runtime/TypeProfiler.h: * runtime/TypeProfilerLog.cpp: * runtime/VarOffset.h: * testRegExp.cpp: * tools/HeapVerifier.cpp: (JSC::HeapVerifier::checkIfRecorded): * tools/JSDollarVM.cpp: * wasm/WasmB3IRGenerator.cpp: * wasm/WasmBBQPlan.cpp: * wasm/WasmFaultSignalHandler.cpp: * wasm/WasmFunctionParser.h: * wasm/WasmOMGForOSREntryPlan.cpp: * wasm/WasmOMGPlan.cpp: * wasm/WasmPlan.cpp: * wasm/WasmSignature.cpp: * wasm/WasmSignature.h: * wasm/WasmWorklist.cpp: * wasm/js/JSWebAssembly.h: * wasm/js/JSWebAssemblyCodeBlock.h: * wasm/js/WebAssemblyCompileErrorConstructor.h: * wasm/js/WebAssemblyCompileErrorPrototype.h: * wasm/js/WebAssemblyFunction.h: * wasm/js/WebAssemblyInstanceConstructor.h: * wasm/js/WebAssemblyInstancePrototype.h: * wasm/js/WebAssemblyLinkErrorConstructor.h: * wasm/js/WebAssemblyLinkErrorPrototype.h: * wasm/js/WebAssemblyMemoryConstructor.h: * wasm/js/WebAssemblyMemoryPrototype.h: * wasm/js/WebAssemblyModuleConstructor.h: * wasm/js/WebAssemblyModulePrototype.h: * wasm/js/WebAssemblyRuntimeErrorConstructor.h: * wasm/js/WebAssemblyRuntimeErrorPrototype.h: * wasm/js/WebAssemblyTableConstructor.h: * wasm/js/WebAssemblyTablePrototype.h: * wasm/js/WebAssemblyToJSCallee.h: * yarr/Yarr.h: * yarr/YarrParser.h: * yarr/generateYarrCanonicalizeUnicode: Source/WebCore: No new tests. Covered by existing tests. * bindings/js/JSDOMConstructorBase.h: * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEnabledForContext.h: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestTypedefs.h: * bridge/objc/objc_runtime.h: * bridge/runtime_array.h: * bridge/runtime_method.h: * bridge/runtime_object.h: Source/WebKit: * WebProcess/Plugins/Netscape/JSNPObject.h: Source/WTF: * wtf/Assertions.cpp: * wtf/AutomaticThread.cpp: * wtf/BitVector.h: * wtf/Bitmap.h: * wtf/BloomFilter.h: * wtf/Brigand.h: * wtf/CheckedArithmetic.h: * wtf/CrossThreadCopier.h: * wtf/CurrentTime.cpp: * wtf/DataLog.cpp: * wtf/DateMath.cpp: (WTF::daysFrom1970ToYear): * wtf/DeferrableRefCounted.h: * wtf/GetPtr.h: * wtf/HashFunctions.h: * wtf/HashMap.h: * wtf/HashTable.h: * wtf/HashTraits.h: * wtf/JSONValues.cpp: * wtf/JSONValues.h: * wtf/ListHashSet.h: * wtf/Lock.h: * wtf/LockAlgorithm.h: * wtf/LockAlgorithmInlines.h: (WTF::Hooks>::lockSlow): * wtf/Logger.h: * wtf/LoggerHelper.h: (WTF::LoggerHelper::childLogIdentifier const): * wtf/MainThread.cpp: * wtf/MetaAllocatorPtr.h: * wtf/MonotonicTime.h: * wtf/NaturalLoops.h: (WTF::NaturalLoops::NaturalLoops): * wtf/ObjectIdentifier.h: * wtf/RAMSize.cpp: * wtf/Ref.h: * wtf/RefPtr.h: * wtf/RetainPtr.h: * wtf/SchedulePair.h: * wtf/StackShot.h: * wtf/StdLibExtras.h: * wtf/TinyPtrSet.h: * wtf/URL.cpp: * wtf/URLHash.h: * wtf/URLParser.cpp: (WTF::URLParser::defaultPortForProtocol): * wtf/Vector.h: * wtf/VectorTraits.h: * wtf/WallTime.h: * wtf/WeakHashSet.h: * wtf/WordLock.h: * wtf/cocoa/CPUTimeCocoa.cpp: * wtf/cocoa/MemoryPressureHandlerCocoa.mm: * wtf/persistence/PersistentDecoder.h: * wtf/persistence/PersistentEncoder.h: * wtf/text/AtomStringHash.h: * wtf/text/CString.h: * wtf/text/StringBuilder.cpp: (WTF::expandedCapacity): * wtf/text/StringHash.h: * wtf/text/StringImpl.h: * wtf/text/StringToIntegerConversion.h: (WTF::toIntegralType): * wtf/text/SymbolRegistry.h: * wtf/text/TextStream.cpp: (WTF::hasFractions): * wtf/text/WTFString.h: * wtf/text/cocoa/TextBreakIteratorInternalICUCocoa.cpp: Canonical link: https://commits.webkit.org/215538@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-09-18 00:36:19 +00:00
static constexpr bool safeToCompareToEmptyOrDeleted = false;
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
};
template<typename T> struct DefaultHash;
[WTF] Remove the unnecessary inner class DefaultHash<T>::Hash https://bugs.webkit.org/show_bug.cgi?id=214389 Reviewed by Darin Adler. Source/JavaScriptCore: * assembler/MacroAssemblerCodeRef.h: * b3/B3CheckSpecial.h: * b3/B3Kind.h: * b3/B3ValueKey.h: * b3/air/AirAllocateRegistersByGraphColoring.cpp: * b3/air/AirArg.h: * b3/air/AirTmp.h: * bytecode/BytecodeIndex.h: * bytecode/CallVariant.h: * bytecode/CodeOrigin.h: * bytecode/DFGExitProfile.h: * bytecode/LazyOperandValueProfile.h: * bytecode/ObjectPropertyCondition.h: * bytecode/PropertyCondition.h: * dfg/DFGAbstractHeap.h: * dfg/DFGArgumentsEliminationPhase.cpp: * dfg/DFGByteCodeParser.cpp: * dfg/DFGCSEPhase.cpp: * dfg/DFGCompilationKey.h: * dfg/DFGDesiredGlobalProperty.h: * dfg/DFGHeapLocation.h: * dfg/DFGLivenessAnalysisPhase.cpp: * dfg/DFGMinifiedID.h: * dfg/DFGNodeFlowProjection.h: * dfg/DFGPromotedHeapLocation.h: * dfg/DFGPropertyTypeKey.h: * dfg/DFGPureValue.h: * ftl/FTLLocation.h: * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::compileNewArrayWithSpread): (JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargsSpread): (JSC::FTL::DFG::LowerDFGToB3::compileMaterializeNewObject): * ftl/FTLSlowPathCallKey.h: * heap/MarkedBlock.h: * heap/VisitRaceKey.h: * inspector/scripts/codegen/generate_cpp_protocol_types_header.py: * inspector/scripts/tests/expected/commands-with-async-attribute.json-result: * inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result: * inspector/scripts/tests/expected/enum-values.json-result: * inspector/scripts/tests/expected/type-declaration-array-type.json-result: * inspector/scripts/tests/expected/type-declaration-enum-type.json-result: * inspector/scripts/tests/expected/type-declaration-object-type.json-result: * inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result: * jit/ICStats.h: * jit/JITThunks.h: * jit/Reg.h: * jit/RegisterSet.h: * parser/VariableEnvironment.h: * profiler/ProfilerOrigin.h: * profiler/ProfilerOriginStack.h: * profiler/ProfilerUID.h: * runtime/CachedTypes.cpp: * runtime/ControlFlowProfiler.h: * runtime/NativeFunction.h: * runtime/PrototypeKey.h: * runtime/RegExpKey.h: * runtime/TemplateObjectDescriptor.h: * runtime/TypeProfiler.h: * runtime/VarOffset.h: * runtime/WeakGCMap.h: * wasm/WasmBBQPlan.h: * wasm/WasmCodeBlock.h: * wasm/WasmEntryPlan.h: * wasm/WasmLLIntPlan.h: * wasm/WasmSignature.h: Source/WebCore: * Modules/indexeddb/IDBDatabaseIdentifier.h: * Modules/indexeddb/shared/IDBResourceIdentifier.h: * Modules/webgpu/WHLSL/AST/WHLSLUnnamedTypeHash.h: * Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: (WebCore::WHLSL::matchResources): (WebCore::WHLSL::matchVertexAttributes): (WebCore::WHLSL::matchColorAttachments): * accessibility/AccessibilityObject.cpp: * accessibility/AccessibilityObject.h: * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::serializeActions): * contentextensions/ContentExtensionRule.h: (WebCore::ContentExtensions::TriggerHash::hash): * contentextensions/ContentExtensionStyleSheet.h: * contentextensions/DFA.cpp: (WebCore::ContentExtensions::printTransitions): * contentextensions/DFABytecodeInterpreter.h: * contentextensions/DFACombiner.cpp: (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode): * contentextensions/DFANode.cpp: (WebCore::ContentExtensions::DFANode::bestFallbackTarget const): * contentextensions/ImmutableNFANodeBuilder.h: * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): * contentextensions/NFANode.h: * contentextensions/NFAToDFA.cpp: (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource): (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate): * css/makeprop.pl: * css/parser/CSSParserContext.h: * dom/GCReachableRef.h: * dom/MessagePortIdentifier.h: * dom/NodeRareData.h: (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::hash): (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal): * dom/QualifiedName.h: * history/BackForwardItemIdentifier.h: * html/canvas/WebGLRenderingContextBase.h: * layout/LayoutUnits.h: * loader/AdClickAttribution.h: * loader/ResourceCryptographicDigest.h: (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::hash): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::equal): (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash): Deleted. (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal): Deleted. * page/ClientOrigin.h: * page/GlobalWindowIdentifier.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * platform/Cookie.h: * platform/RegistrableDomain.h: * platform/graphics/ColorHash.h: * platform/graphics/FloatSizeHash.h: (WTF::FloatHash<WebCore::FloatSize>::hash): * platform/graphics/FontGenericFamilies.h: * platform/graphics/IntPointHash.h: * platform/graphics/IntRectHash.h: (WTF::IntHash<WebCore::IntRect>::hash): (WTF::IntHash<WebCore::IntRect>::equal): * platform/graphics/IntSizeHash.h: * platform/graphics/WidthCache.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FallbackFontDescriptionKey::computeHash const): * platform/network/HTTPParsers.h: * platform/network/ProtectionSpaceHash.h: * platform/win/COMPtr.h: * platform/win/WindowsKeyNames.h: * rendering/CSSValueKey.h: * rendering/GridBaselineAlignment.h: * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): * rendering/RenderTheme.h: * style/RuleSet.cpp: (WebCore::Style::RuleSet::evaluateDynamicMediaQueryRules): * svg/SVGElement.h: (WebCore::SVGAttributeHashTranslator::hash): * workers/service/ServiceWorkerClientIdentifier.h: * workers/service/ServiceWorkerRegistrationKey.h: Source/WebCore/PAL: * pal/SessionID.h: Source/WebKit: * NetworkProcess/Downloads/DownloadID.h: * NetworkProcess/cache/NetworkCache.h: * NetworkProcess/cache/NetworkCacheKey.h: * Platform/IPC/MessageReceiverMap.h: * Platform/IPC/StringReference.h: * Shared/CallbackID.h: * UIProcess/API/cpp/WKRetainPtr.h: Source/WebKitLegacy/win: * COMPropertyBag.h: Source/WTF: DefaultHash<T> doesn't need to have a inner struct Hash. This can be a problem for forward declarations (Bug 214320 Comment 5). * wtf/BitVector.h: * wtf/Forward.h: * wtf/HashFunctions.h: (WTF::PairHash::hash): (WTF::PairHash::equal): (WTF::TupleHash::hash): (WTF::TupleHash::equal): * wtf/ListHashSet.h: * wtf/LoggingHashMap.h: * wtf/LoggingHashSet.h: * wtf/MetaAllocatorPtr.h: * wtf/ObjectIdentifier.h: * wtf/OptionSetHash.h: (WTF::DefaultHash<OptionSet<T>>::hash): (WTF::DefaultHash<OptionSet<T>>::equal): (WTF::DefaultHash<OptionSet<T>>::Hash::hash): Deleted. (WTF::DefaultHash<OptionSet<T>>::Hash::equal): Deleted. * wtf/Packed.h: * wtf/RetainPtr.h: * wtf/StackShot.h: * wtf/URLHash.h: * wtf/VectorHash.h: (WTF::VectorHash::hash): * wtf/text/AtomString.h: * wtf/text/AtomStringHash.h: * wtf/text/CString.h: * wtf/text/StringHash.h: * wtf/text/StringImpl.h: * wtf/text/SymbolRegistry.h: (WTF::DefaultHash<SymbolRegistryKey>::hash): (WTF::DefaultHash<SymbolRegistryKey>::equal): (WTF::DefaultHash<SymbolRegistryKey>::Hash::hash): Deleted. (WTF::DefaultHash<SymbolRegistryKey>::Hash::equal): Deleted. * wtf/text/WTFString.h: Tools: * TestWebKitAPI/Tests/WTF/DeletedAddressOfOperator.h: (WTF::DefaultHash<DeletedAddressOfOperator>::hash): (WTF::DefaultHash<DeletedAddressOfOperator>::equal): (WTF::DefaultHash<DeletedAddressOfOperator>::Hash::hash): Deleted. (WTF::DefaultHash<DeletedAddressOfOperator>::Hash::equal): Deleted. * TestWebKitAPI/Tests/WTF/HashCountedSet.cpp: (TestWebKitAPI::bucketForKey): * TestWebKitAPI/Tests/WTF/HashMap.cpp: (TestWebKitAPI::bucketForKey): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WTF/HashSet.cpp: (TestWebKitAPI::testInitialCapacity): * TestWebKitAPI/Tests/WTF/MoveOnly.h: (WTF::DefaultHash<MoveOnly>::hash): (WTF::DefaultHash<MoveOnly>::equal): (WTF::DefaultHash<MoveOnly>::Hash::hash): Deleted. (WTF::DefaultHash<MoveOnly>::Hash::equal): Deleted. Canonical link: https://commits.webkit.org/227236@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-07-17 00:33:37 +00:00
template<> struct DefaultHash<BitVector> : BitVectorHash { };
FTL should be able to do some simple inline caches using LLVM patchpoints https://bugs.webkit.org/show_bug.cgi?id=123164 Source/JavaScriptCore: Reviewed by Mark Hahnenberg. This implements GetById inline caches in the FTL using llvm.webkit.patchpoint. The idea is that we ask LLVM for a nop slide the size of a GetById inline cache and then fill in the code after LLVM compilation is complete. For now, we just use the system calling convention for the arguments and return. We also still make some assumptions about registers that aren't correct. But, most of the scaffolding is there and this will successfully patch an inline cache. * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/AbstractMacroAssembler.h: * assembler/LinkBuffer.cpp: (JSC::LinkBuffer::finalizeCodeWithoutDisassembly): (JSC::LinkBuffer::linkCode): (JSC::LinkBuffer::allocate): * assembler/LinkBuffer.h: (JSC::LinkBuffer::LinkBuffer): (JSC::LinkBuffer::link): * ftl/FTLAbbreviations.h: (JSC::FTL::constNull): (JSC::FTL::buildCall): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLCompile.cpp: (JSC::FTL::fixFunctionBasedOnStackMaps): * ftl/FTLInlineCacheDescriptor.h: Added. (JSC::FTL::InlineCacheDescriptor::InlineCacheDescriptor): (JSC::FTL::GetByIdDescriptor::GetByIdDescriptor): (JSC::FTL::GetByIdDescriptor::stackmapID): (JSC::FTL::GetByIdDescriptor::codeOrigin): (JSC::FTL::GetByIdDescriptor::uid): * ftl/FTLInlineCacheSize.cpp: Added. (JSC::FTL::sizeOfGetById): (JSC::FTL::sizeOfPutById): * ftl/FTLInlineCacheSize.h: Added. * ftl/FTLIntrinsicRepository.h: * ftl/FTLJITFinalizer.cpp: (JSC::FTL::JITFinalizer::finalizeFunction): * ftl/FTLJITFinalizer.h: * ftl/FTLLocation.cpp: (JSC::FTL::Location::directGPR): * ftl/FTLLocation.h: * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::LowerDFGToLLVM::compileGetById): * ftl/FTLOutput.h: (JSC::FTL::Output::call): * ftl/FTLSlowPathCall.cpp: Added. (JSC::FTL::callOperation): * ftl/FTLSlowPathCall.h: Added. (JSC::FTL::SlowPathCall::SlowPathCall): (JSC::FTL::SlowPathCall::call): (JSC::FTL::SlowPathCall::key): * ftl/FTLSlowPathCallKey.cpp: Added. (JSC::FTL::SlowPathCallKey::dump): * ftl/FTLSlowPathCallKey.h: Added. (JSC::FTL::SlowPathCallKey::SlowPathCallKey): (JSC::FTL::SlowPathCallKey::usedRegisters): (JSC::FTL::SlowPathCallKey::callTarget): (JSC::FTL::SlowPathCallKey::offset): (JSC::FTL::SlowPathCallKey::isEmptyValue): (JSC::FTL::SlowPathCallKey::isDeletedValue): (JSC::FTL::SlowPathCallKey::operator==): (JSC::FTL::SlowPathCallKey::hash): (JSC::FTL::SlowPathCallKeyHash::hash): (JSC::FTL::SlowPathCallKeyHash::equal): * ftl/FTLStackMaps.cpp: (JSC::FTL::StackMaps::Location::directGPR): * ftl/FTLStackMaps.h: * ftl/FTLState.h: * ftl/FTLThunks.cpp: (JSC::FTL::slowPathCallThunkGenerator): * ftl/FTLThunks.h: (JSC::FTL::Thunks::getSlowPathCallThunk): * jit/CCallHelpers.h: (JSC::CCallHelpers::setupArguments): * jit/GPRInfo.h: * jit/JITInlineCacheGenerator.cpp: (JSC::garbageStubInfo): (JSC::JITInlineCacheGenerator::JITInlineCacheGenerator): (JSC::JITByIdGenerator::finalize): * jit/JITInlineCacheGenerator.h: (JSC::JITByIdGenerator::slowPathBegin): * jit/RegisterSet.cpp: (JSC::RegisterSet::stackRegisters): (JSC::RegisterSet::specialRegisters): (JSC::RegisterSet::calleeSaveRegisters): (JSC::RegisterSet::allGPRs): (JSC::RegisterSet::allFPRs): (JSC::RegisterSet::allRegisters): (JSC::RegisterSet::dump): * jit/RegisterSet.h: (JSC::RegisterSet::exclude): (JSC::RegisterSet::numberOfSetRegisters): (JSC::RegisterSet::RegisterSet): (JSC::RegisterSet::isEmptyValue): (JSC::RegisterSet::isDeletedValue): (JSC::RegisterSet::operator==): (JSC::RegisterSet::hash): (JSC::RegisterSetHash::hash): (JSC::RegisterSetHash::equal): * runtime/Options.h: Source/WTF: Reviewed by Mark Hahnenberg. This needed some better bitvector support, like merging (|=), excluding (&=~), hashing, and bit counting. * wtf/BitVector.cpp: (WTF::BitVector::setSlow): (WTF::BitVector::excludeSlow): (WTF::BitVector::bitCountSlow): (WTF::BitVector::equalsSlowCase): (WTF::BitVector::hashSlowCase): (WTF::BitVector::dump): * wtf/BitVector.h: (WTF::BitVector::merge): (WTF::BitVector::exclude): (WTF::BitVector::bitCount): (WTF::BitVector::BitVector): (WTF::BitVector::isEmptyValue): (WTF::BitVector::isDeletedValue): (WTF::BitVector::isEmptyOrDeletedValue): (WTF::BitVector::operator==): (WTF::BitVector::hash): (WTF::BitVectorHash::hash): (WTF::BitVectorHash::equal): * wtf/HashTraits.h: (WTF::CustomHashTraits::constructDeletedValue): (WTF::CustomHashTraits::isDeletedValue): (WTF::CustomHashTraits::emptyValue): (WTF::CustomHashTraits::isEmptyValue): * wtf/StdLibExtras.h: (WTF::bitCount): Canonical link: https://commits.webkit.org/141315@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@157872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-10-23 18:22:09 +00:00
template<> struct HashTraits<BitVector> : public CustomHashTraits<BitVector> { };
DFG should support continuous optimization https://bugs.webkit.org/show_bug.cgi?id=68329 Reviewed by Geoffrey Garen. This adds the ability to reoptimize a code block if speculation failures happen frequently. 6% speed-up on Kraken, 1% slow-down on V8, neutral on SunSpider. * CMakeLists.txt: * GNUmakefile.list.am: * JavaScriptCore.pro: * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: * JavaScriptCore.vcproj/WTF/WTF.vcproj: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CodeBlock.cpp: (JSC::CodeBlock::CodeBlock): (JSC::ProgramCodeBlock::jettison): (JSC::EvalCodeBlock::jettison): (JSC::FunctionCodeBlock::jettison): (JSC::CodeBlock::shouldOptimizeNow): (JSC::CodeBlock::dumpValueProfiles): * bytecode/CodeBlock.h: * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::getStrongPrediction): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::exitSpeculativeWithOSR): (JSC::DFG::JITCompiler::compileEntry): (JSC::DFG::JITCompiler::compileBody): * dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::noticeOSREntry): * dfg/DFGOSREntry.cpp: (JSC::DFG::prepareOSREntry): * dfg/DFGOSREntry.h: (JSC::DFG::getOSREntryDataBytecodeIndex): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compile): * heap/ConservativeRoots.cpp: (JSC::ConservativeRoots::ConservativeRoots): (JSC::ConservativeRoots::~ConservativeRoots): (JSC::DummyMarkHook::mark): (JSC::ConservativeRoots::genericAddPointer): (JSC::ConservativeRoots::genericAddSpan): (JSC::ConservativeRoots::add): * heap/ConservativeRoots.h: * heap/Heap.cpp: (JSC::Heap::addJettisonCodeBlock): (JSC::Heap::markRoots): * heap/Heap.h: * heap/JettisonedCodeBlocks.cpp: Added. (JSC::JettisonedCodeBlocks::JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::~JettisonedCodeBlocks): (JSC::JettisonedCodeBlocks::addCodeBlock): (JSC::JettisonedCodeBlocks::clearMarks): (JSC::JettisonedCodeBlocks::deleteUnmarkedCodeBlocks): (JSC::JettisonedCodeBlocks::traceCodeBlocks): * heap/JettisonedCodeBlocks.h: Added. (JSC::JettisonedCodeBlocks::mark): * interpreter/RegisterFile.cpp: (JSC::RegisterFile::gatherConservativeRoots): * interpreter/RegisterFile.h: * jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION): * runtime/Executable.cpp: (JSC::jettisonCodeBlock): (JSC::EvalExecutable::jettisonOptimizedCode): (JSC::ProgramExecutable::jettisonOptimizedCode): (JSC::FunctionExecutable::jettisonOptimizedCodeForCall): (JSC::FunctionExecutable::jettisonOptimizedCodeForConstruct): * runtime/Executable.h: (JSC::FunctionExecutable::jettisonOptimizedCodeFor): * wtf/BitVector.h: Added. (WTF::BitVector::BitVector): (WTF::BitVector::~BitVector): (WTF::BitVector::operator=): (WTF::BitVector::size): (WTF::BitVector::ensureSize): (WTF::BitVector::resize): (WTF::BitVector::clearAll): (WTF::BitVector::get): (WTF::BitVector::set): (WTF::BitVector::clear): (WTF::BitVector::bitsInPointer): (WTF::BitVector::maxInlineBits): (WTF::BitVector::byteCount): (WTF::BitVector::makeInlineBits): (WTF::BitVector::OutOfLineBits::numBits): (WTF::BitVector::OutOfLineBits::numWords): (WTF::BitVector::OutOfLineBits::bits): (WTF::BitVector::OutOfLineBits::create): (WTF::BitVector::OutOfLineBits::destroy): (WTF::BitVector::OutOfLineBits::OutOfLineBits): (WTF::BitVector::isInline): (WTF::BitVector::outOfLineBits): (WTF::BitVector::resizeOutOfLine): (WTF::BitVector::bits): Canonical link: https://commits.webkit.org/84525@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-21 23:36:35 +00:00
} // namespace WTF
using WTF::BitVector;