PerformanceTests:
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jan 2020 22:24:50 +0000 (22:24 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Jan 2020 22:24:50 +0000 (22:24 +0000)
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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc

382 files changed:
PerformanceTests/ChangeLog
PerformanceTests/JetStream2/wasm/HashSet.cpp
PerformanceTests/StitchMarker/wtf/Assertions.h
PerformanceTests/StitchMarker/wtf/DateMath.cpp
PerformanceTests/StitchMarker/wtf/HashTable.h
PerformanceTests/StitchMarker/wtf/Hasher.h
PerformanceTests/StitchMarker/wtf/NeverDestroyed.h
PerformanceTests/StitchMarker/wtf/StackBounds.h
PerformanceTests/StitchMarker/wtf/ValueCheck.h
PerformanceTests/StitchMarker/wtf/Vector.h
PerformanceTests/StitchMarker/wtf/text/AtomicStringImpl.cpp
PerformanceTests/StitchMarker/wtf/text/AtomicStringImpl.h
PerformanceTests/StitchMarker/wtf/text/StringCommon.h
PerformanceTests/StitchMarker/wtf/text/StringImpl.h
PerformanceTests/StitchMarker/wtf/text/SymbolImpl.h
PerformanceTests/StitchMarker/wtf/text/UniquedStringImpl.h
Source/JavaScriptCore/API/tests/testapi.c
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/ARM64Assembler.h
Source/JavaScriptCore/assembler/AssemblerBuffer.h
Source/JavaScriptCore/assembler/LinkBuffer.cpp
Source/JavaScriptCore/assembler/ProbeStack.cpp
Source/JavaScriptCore/assembler/ProbeStack.h
Source/JavaScriptCore/b3/B3FoldPathConstants.cpp
Source/JavaScriptCore/b3/B3LowerToAir.cpp
Source/JavaScriptCore/b3/B3MemoryValue.cpp
Source/JavaScriptCore/b3/B3Opcode.cpp
Source/JavaScriptCore/b3/B3Type.h
Source/JavaScriptCore/b3/B3TypeMap.h
Source/JavaScriptCore/b3/B3Width.h
Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h
Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
Source/JavaScriptCore/b3/air/AirArg.cpp
Source/JavaScriptCore/b3/air/AirArg.h
Source/JavaScriptCore/b3/air/AirCode.h
Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp
Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
Source/JavaScriptCore/bytecode/AccessCase.cpp
Source/JavaScriptCore/bytecode/AccessCase.h
Source/JavaScriptCore/bytecode/CallVariant.cpp
Source/JavaScriptCore/bytecode/CodeBlock.cpp
Source/JavaScriptCore/bytecode/CodeBlockHash.cpp
Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
Source/JavaScriptCore/bytecode/StructureStubInfo.h
Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
Source/JavaScriptCore/bytecompiler/RegisterID.h
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
Source/JavaScriptCore/dfg/DFGAbstractValue.h
Source/JavaScriptCore/dfg/DFGArithMode.h
Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
Source/JavaScriptCore/dfg/DFGBasicBlock.h
Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
Source/JavaScriptCore/dfg/DFGCommon.h
Source/JavaScriptCore/dfg/DFGCommonData.cpp
Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h
Source/JavaScriptCore/dfg/DFGDoesGC.cpp
Source/JavaScriptCore/dfg/DFGEdge.h
Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
Source/JavaScriptCore/dfg/DFGJITCode.cpp
Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp
Source/JavaScriptCore/dfg/DFGScoreBoard.h
Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
Source/JavaScriptCore/dfg/DFGStructureAbstractValue.cpp
Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp
Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp
Source/JavaScriptCore/ftl/FTLLink.cpp
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
Source/JavaScriptCore/ftl/FTLOperations.cpp
Source/JavaScriptCore/heap/BlockDirectory.cpp
Source/JavaScriptCore/heap/GCSegmentedArray.h
Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h
Source/JavaScriptCore/heap/HandleSet.cpp
Source/JavaScriptCore/heap/HandleSet.h
Source/JavaScriptCore/heap/Heap.cpp
Source/JavaScriptCore/heap/Heap.h
Source/JavaScriptCore/heap/MarkedBlock.cpp
Source/JavaScriptCore/heap/MarkedBlock.h
Source/JavaScriptCore/heap/MarkedSpace.cpp
Source/JavaScriptCore/heap/PreciseAllocation.cpp
Source/JavaScriptCore/heap/PreciseAllocation.h
Source/JavaScriptCore/heap/SlotVisitor.cpp
Source/JavaScriptCore/heap/SlotVisitor.h
Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
Source/JavaScriptCore/interpreter/FrameTracers.h
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/interpreter/Interpreter.h
Source/JavaScriptCore/jit/AssemblyHelpers.cpp
Source/JavaScriptCore/jit/AssemblyHelpers.h
Source/JavaScriptCore/jit/BinarySwitch.cpp
Source/JavaScriptCore/jit/CCallHelpers.h
Source/JavaScriptCore/jit/CallFrameShuffler.cpp
Source/JavaScriptCore/jit/JIT.cpp
Source/JavaScriptCore/jit/JITOpcodes.cpp
Source/JavaScriptCore/jit/JITPropertyAccess.cpp
Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
Source/JavaScriptCore/jit/Repatch.cpp
Source/JavaScriptCore/jit/ThunkGenerators.cpp
Source/JavaScriptCore/llint/LLIntData.cpp
Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
Source/JavaScriptCore/parser/Lexer.cpp
Source/JavaScriptCore/parser/Lexer.h
Source/JavaScriptCore/runtime/ArgList.h
Source/JavaScriptCore/runtime/Butterfly.h
Source/JavaScriptCore/runtime/HashMapImpl.h
Source/JavaScriptCore/runtime/JSCellInlines.h
Source/JavaScriptCore/runtime/JSFunction.cpp
Source/JavaScriptCore/runtime/JSFunction.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSObject.cpp
Source/JavaScriptCore/runtime/JSObjectInlines.h
Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
Source/JavaScriptCore/runtime/LiteralParser.cpp
Source/JavaScriptCore/runtime/LiteralParser.h
Source/JavaScriptCore/runtime/Operations.h
Source/JavaScriptCore/runtime/OptionsList.h
Source/JavaScriptCore/runtime/VM.cpp
Source/JavaScriptCore/runtime/VM.h
Source/JavaScriptCore/runtime/VarOffset.h
Source/JavaScriptCore/runtime/WeakMapImpl.h
Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
Source/JavaScriptCore/wasm/WasmFunctionParser.h
Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
Source/JavaScriptCore/wasm/WasmPlan.cpp
Source/JavaScriptCore/wasm/WasmSectionParser.h
Source/JavaScriptCore/wasm/WasmSections.h
Source/JavaScriptCore/wasm/WasmSignatureInlines.h
Source/JavaScriptCore/wasm/WasmWorklist.cpp
Source/JavaScriptCore/wasm/js/JSToWasm.cpp
Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
Source/WTF/ChangeLog
Source/WTF/wtf/Assertions.h
Source/WTF/wtf/AutomaticThread.cpp
Source/WTF/wtf/BitVector.h
Source/WTF/wtf/BlockObjCExceptions.mm
Source/WTF/wtf/BloomFilter.h
Source/WTF/wtf/CallbackAggregator.h
Source/WTF/wtf/CheckedArithmetic.h
Source/WTF/wtf/CheckedBoolean.h
Source/WTF/wtf/CompletionHandler.h
Source/WTF/wtf/DateMath.cpp
Source/WTF/wtf/Gigacage.cpp
Source/WTF/wtf/HashTable.h
Source/WTF/wtf/LoggerHelper.h
Source/WTF/wtf/NaturalLoops.h
Source/WTF/wtf/NeverDestroyed.h
Source/WTF/wtf/OptionSet.h
Source/WTF/wtf/Platform.h
Source/WTF/wtf/PtrTag.h
Source/WTF/wtf/RefCounted.h
Source/WTF/wtf/SingleRootGraph.h
Source/WTF/wtf/SizeLimits.cpp
Source/WTF/wtf/StackBounds.h
Source/WTF/wtf/URLParser.cpp
Source/WTF/wtf/ValueCheck.h
Source/WTF/wtf/Vector.h
Source/WTF/wtf/WeakHashSet.h
Source/WTF/wtf/WeakPtr.h
Source/WTF/wtf/text/AtomStringImpl.cpp
Source/WTF/wtf/text/AtomStringImpl.h
Source/WTF/wtf/text/StringBuilder.cpp
Source/WTF/wtf/text/StringBuilder.h
Source/WTF/wtf/text/StringCommon.h
Source/WTF/wtf/text/StringHasher.h
Source/WTF/wtf/text/StringImpl.h
Source/WTF/wtf/text/SymbolImpl.h
Source/WTF/wtf/text/UniquedStringImpl.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/fetch/FetchBodySource.cpp
Source/WebCore/Modules/fetch/FetchBodySource.h
Source/WebCore/Modules/webdatabase/DatabaseDetails.h
Source/WebCore/Modules/webdatabase/DatabaseTask.cpp
Source/WebCore/Modules/webdatabase/DatabaseTask.h
Source/WebCore/Modules/webdatabase/DatabaseThread.cpp
Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h
Source/WebCore/Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLInferTypes.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp
Source/WebCore/Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp
Source/WebCore/bindings/js/JSCallbackData.h
Source/WebCore/bindings/js/JSLazyEventListener.cpp
Source/WebCore/bindings/js/JSLazyEventListener.h
Source/WebCore/contentextensions/ContentExtensionCompiler.cpp
Source/WebCore/css/CSSCalculationValue.cpp
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSPrimitiveValue.cpp
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/CSSStyleSheet.cpp
Source/WebCore/dom/ActiveDOMObject.cpp
Source/WebCore/dom/ActiveDOMObject.h
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.cpp
Source/WebCore/dom/ContainerNodeAlgorithms.h
Source/WebCore/dom/CustomElementReactionQueue.cpp
Source/WebCore/dom/CustomElementReactionQueue.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementAndTextDescendantIterator.h
Source/WebCore/dom/ElementDescendantIterator.h
Source/WebCore/dom/ElementIterator.h
Source/WebCore/dom/EventContext.cpp
Source/WebCore/dom/EventContext.h
Source/WebCore/dom/EventListener.h
Source/WebCore/dom/EventPath.cpp
Source/WebCore/dom/EventSender.h
Source/WebCore/dom/EventTarget.cpp
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/dom/ScriptDisallowedScope.h
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/ScriptExecutionContext.h
Source/WebCore/dom/SelectorQuery.cpp
Source/WebCore/dom/SlotAssignment.cpp
Source/WebCore/dom/SlotAssignment.h
Source/WebCore/dom/TreeScopeOrderedMap.cpp
Source/WebCore/dom/TreeScopeOrderedMap.h
Source/WebCore/fileapi/Blob.cpp
Source/WebCore/fileapi/Blob.h
Source/WebCore/history/BackForwardCache.cpp
Source/WebCore/history/BackForwardCache.h
Source/WebCore/html/CanvasBase.cpp
Source/WebCore/html/CanvasBase.h
Source/WebCore/html/HTMLCollection.h
Source/WebCore/html/HTMLSelectElement.cpp
Source/WebCore/html/HTMLTableRowsCollection.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
Source/WebCore/html/parser/HTMLParserScheduler.cpp
Source/WebCore/html/parser/HTMLParserScheduler.h
Source/WebCore/html/parser/HTMLToken.h
Source/WebCore/html/parser/HTMLTreeBuilder.cpp
Source/WebCore/html/parser/HTMLTreeBuilder.h
Source/WebCore/layout/FormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.cpp
Source/WebCore/layout/blockformatting/BlockFormattingContext.h
Source/WebCore/layout/displaytree/DisplayBox.cpp
Source/WebCore/layout/displaytree/DisplayBox.h
Source/WebCore/layout/displaytree/DisplayInlineRect.h
Source/WebCore/layout/displaytree/DisplayLineBox.h
Source/WebCore/layout/displaytree/DisplayRect.h
Source/WebCore/layout/floats/FloatingContext.cpp
Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp
Source/WebCore/layout/tableformatting/TableGrid.cpp
Source/WebCore/layout/tableformatting/TableGrid.h
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/loader/DocumentLoader.h
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/cache/CachedResource.h
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/page/FrameView.cpp
Source/WebCore/page/FrameViewLayoutContext.cpp
Source/WebCore/page/FrameViewLayoutContext.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/ViewportConfiguration.cpp
Source/WebCore/page/ViewportConfiguration.h
Source/WebCore/page/mac/EventHandlerMac.mm
Source/WebCore/platform/DateComponents.cpp
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/Supplementable.h
Source/WebCore/platform/Timer.cpp
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/BitmapImage.h
Source/WebCore/platform/graphics/Image.h
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.cpp
Source/WebCore/platform/graphics/ca/win/CACFLayerTreeHost.h
Source/WebCore/platform/graphics/cg/ImageBufferDataCG.cpp
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
Source/WebCore/platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp
Source/WebCore/platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp
Source/WebCore/platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp
Source/WebCore/platform/graphics/win/GradientDirect2D.cpp
Source/WebCore/platform/graphics/win/ImageBufferDataDirect2D.cpp
Source/WebCore/platform/graphics/win/PathDirect2D.cpp
Source/WebCore/platform/graphics/win/PlatformContextDirect2D.cpp
Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.h
Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp
Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp
Source/WebCore/platform/network/HTTPParsers.cpp
Source/WebCore/platform/sql/SQLiteDatabase.cpp
Source/WebCore/platform/sql/SQLiteDatabase.h
Source/WebCore/platform/sql/SQLiteStatement.cpp
Source/WebCore/platform/sql/SQLiteStatement.h
Source/WebCore/platform/win/COMPtr.h
Source/WebCore/rendering/ComplexLineLayout.cpp
Source/WebCore/rendering/FloatingObjects.cpp
Source/WebCore/rendering/FloatingObjects.h
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
Source/WebCore/rendering/GridTrackSizingAlgorithm.h
Source/WebCore/rendering/LayoutDisallowedScope.cpp
Source/WebCore/rendering/LayoutDisallowedScope.h
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderBlock.h
Source/WebCore/rendering/RenderBlockFlow.cpp
Source/WebCore/rendering/RenderBoxModelObject.cpp
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderGeometryMap.cpp
Source/WebCore/rendering/RenderGrid.cpp
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayoutState.cpp
Source/WebCore/rendering/RenderLayoutState.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderQuote.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderTableSection.cpp
Source/WebCore/rendering/RenderTextLineBoxes.cpp
Source/WebCore/rendering/RenderTextLineBoxes.h
Source/WebCore/rendering/line/BreakingContext.h
Source/WebCore/rendering/style/GridArea.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/updating/RenderTreeBuilderRuby.cpp
Source/WebCore/rendering/updating/RenderTreePosition.cpp
Source/WebCore/rendering/updating/RenderTreePosition.h
Source/WebCore/svg/SVGToOTFFontConversion.cpp
Source/WebCore/svg/SVGTransformDistance.cpp
Source/WebCore/svg/graphics/SVGImage.cpp
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/workers/service/ServiceWorkerJob.h
Source/WebCore/worklets/PaintWorkletGlobalScope.h
Source/WebCore/xml/XPathStep.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkSession.cpp
Source/WebKit/NetworkProcess/NetworkSession.h
Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
Source/WebKit/NetworkProcess/cocoa/NetworkSessionCocoa.mm
Source/WebKit/Platform/IPC/Connection.cpp
Source/WebKit/Platform/IPC/MessageReceiver.h
Source/WebKit/Platform/IPC/cocoa/ConnectionCocoa.mm
Source/WebKit/Platform/mac/MachUtilities.cpp
Source/WebKit/Shared/API/APIClient.h
Source/WebKit/Shared/API/Cocoa/WKRemoteObjectCoder.mm
Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.h
Source/WebKit/Shared/SharedStringHashTableReadOnly.cpp
Source/WebKit/UIProcess/BackingStore.cpp
Source/WebKit/UIProcess/GenericCallback.h
Source/WebKit/UIProcess/Launcher/mac/ProcessLauncherMac.mm
Source/WebKit/UIProcess/PageLoadState.h
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/WebProcess/Network/WebResourceLoader.cpp
Source/WebKit/WebProcess/Network/WebResourceLoader.h
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.cpp
Source/WebKit/WebProcess/Plugins/Netscape/NetscapePluginStream.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKitLegacy/ChangeLog
Source/WebKitLegacy/Storage/StorageAreaImpl.cpp
Source/WebKitLegacy/Storage/StorageAreaImpl.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/History/WebHistory.mm
Source/WebKitLegacy/mac/WebView/WebFrame.mm
Source/WebKitLegacy/win/ChangeLog
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAD3DRenderer.cpp
Source/WebKitLegacy/win/WebKitQuartzCoreAdditions/CAD3DRenderer.h
Source/WebKitLegacy/win/WebView.cpp
Source/WebKitLegacy/win/WebView.h
Tools/ChangeLog
Tools/DumpRenderTree/mac/ObjCController.m

index 35d23ad..f6260b3 100644 (file)
@@ -1,3 +1,32 @@
+2020-01-06  Mark Lam  <mark.lam@apple.com>
+
+        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:
+
 2020-01-05  Dean Jackson  <dino@apple.com>
 
         Rename GraphicsContext3D to GraphicsContextGL
index eca979b..a8cea65 100644 (file)
@@ -42,7 +42,7 @@
         }                                                               \
     } while(0)
 
-#define ASSERT_DISABLED 1
+#define ASSERT_ENABLED 0
 
 #define DUMP_HASHTABLE_STATS 0
 #define DUMP_HASHTABLE_STATS_PER_TABLE 0
@@ -1033,7 +1033,7 @@ struct CustomHashTraits : public GenericHashTraits<T> {
         template<typename HashTranslator, typename T> ValueType* lookup(const T&);
         template<typename HashTranslator, typename T> ValueType* inlineLookup(const T&);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistency() const;
 #else
         static void checkTableConsistency() { }
@@ -1085,7 +1085,7 @@ struct CustomHashTraits : public GenericHashTraits<T> {
         iterator makeKnownGoodIterator(ValueType* pos) { return iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
         const_iterator makeKnownGoodConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistencyExceptSize() const;
 #else
         static void checkTableConsistencyExceptSize() { }
@@ -1182,7 +1182,7 @@ struct CustomHashTraits : public GenericHashTraits<T> {
         return key;
     }
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     template<typename HashTranslator, typename T>
@@ -1951,7 +1951,7 @@ struct CustomHashTraits : public GenericHashTraits<T> {
         return *this;
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkTableConsistency() const
@@ -1993,7 +1993,7 @@ struct CustomHashTraits : public GenericHashTraits<T> {
         ASSERT(m_tableSize == m_tableSizeMask + 1);
     }
 
-#endif // ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 #if CHECK_HASHTABLE_ITERATORS
 
index 2191d96..c63b3d9 100644 (file)
@@ -63,39 +63,36 @@ extern "C" void _ReadWriteBarrier(void);
 #endif
 #endif
 
+#ifndef ASSERT_ENABLED
 #ifdef NDEBUG
-/* Disable ASSERT* macros in release mode. */
-#define ASSERTIONS_DISABLED_DEFAULT 1
+#define ASSERT_ENABLED 0
 #else
-#define ASSERTIONS_DISABLED_DEFAULT 0
+#define ASSERT_ENABLED 1
 #endif
-
-#ifndef BACKTRACE_DISABLED
-#define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
 #endif
 
-#ifndef ASSERT_DISABLED
-#define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#ifndef BACKTRACE_DISABLED
+#define BACKTRACE_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ASSERT_MSG_DISABLED
-#define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_MSG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ASSERT_ARG_DISABLED
-#define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_ARG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef FATAL_DISABLED
-#define FATAL_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define FATAL_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ERROR_DISABLED
-#define ERROR_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ERROR_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef LOG_DISABLED
-#define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define LOG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef RELEASE_LOG_DISABLED
@@ -267,7 +264,7 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication()
 #undef ASSERT
 #endif
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 
 #define ASSERT(assertion) ((void)0)
 #define ASSERT_AT(assertion, file, line, function) ((void)0)
@@ -446,7 +443,7 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication()
 
 /* RELEASE_ASSERT */
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 #define RELEASE_ASSERT(assertion) do { \
     if (UNLIKELY(!(assertion))) \
         CRASH(); \
index 57e24dd..8287330 100644 (file)
@@ -553,7 +553,7 @@ LocalTimeOffset calculateLocalTimeOffset(double ms, TimeType inputTimeType)
 
 void initializeDates()
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     static bool alreadyInitialized;
     ASSERT(!alreadyInitialized);
     alreadyInitialized = true;
index 7f4fa9f..62fd9a1 100644 (file)
@@ -416,7 +416,7 @@ namespace WTF {
         template<typename HashTranslator, typename T> ValueType* lookup(const T&);
         template<typename HashTranslator, typename T> ValueType* inlineLookup(const T&);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistency() const;
 #else
         static void checkTableConsistency() { }
@@ -468,7 +468,7 @@ namespace WTF {
         iterator makeKnownGoodIterator(ValueType* pos) { return iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
         const_iterator makeKnownGoodConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistencyExceptSize() const;
 #else
         static void checkTableConsistencyExceptSize() { }
@@ -568,7 +568,7 @@ namespace WTF {
         return key;
     }
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     template<typename HashTranslator, typename T>
@@ -1337,7 +1337,7 @@ namespace WTF {
         return *this;
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkTableConsistency() const
@@ -1379,7 +1379,7 @@ namespace WTF {
         ASSERT(m_tableSize == m_tableSizeMask + 1);
     }
 
-#endif // ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 #if CHECK_HASHTABLE_ITERATORS
 
index a8e690d..9aba29f 100644 (file)
@@ -76,12 +76,12 @@ public:
     void addCharacters(UChar a, UChar b)
     {
         if (m_hasPendingCharacter) {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             m_hasPendingCharacter = false;
 #endif
             addCharactersAssumingAligned(m_pendingCharacter, a);
             m_pendingCharacter = b;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             m_hasPendingCharacter = true;
 #endif
             return;
index 8784b6e..4f02d72 100644 (file)
@@ -89,7 +89,7 @@ public:
     {
         ASSERT(!m_isConstructed);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_isConstructed = true;
 #endif
 
@@ -126,7 +126,7 @@ private:
         explicit MaybeRelax(PtrType* ptr) { ptr->relaxAdoptionRequirement(); }
     };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     // LazyNeverDestroyed objects are always static, so this variable is initialized to false.
     // It must not be initialized dynamically; that would not be thread safe.
     bool m_isConstructed;
index 5234cd2..77cdb39 100644 (file)
@@ -141,7 +141,7 @@ private:
 
     void checkConsistency() const
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void* currentPosition = &currentPosition;
         ASSERT(m_origin != m_bound);
         ASSERT(isGrowingDownward()
index 2a86eb0..9e3f40c 100644 (file)
@@ -35,7 +35,7 @@ template<typename T> struct ValueCheck {
     static void checkConsistency(const T&) { }
 };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 template<typename P> struct ValueCheck<P*> {
     typedef P* TraitType;
     static void checkConsistency(const P* p)
index ba2a570..7e2df92 100644 (file)
@@ -1494,7 +1494,7 @@ inline MallocPtr<T> Vector<T, inlineCapacity, OverflowHandler, minCapacity>::rel
 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity>
 inline void Vector<T, inlineCapacity, OverflowHandler, minCapacity>::checkConsistency()
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     for (size_t i = 0; i < size(); ++i)
         ValueCheck<T>::checkConsistency(at(i));
 #endif
@@ -1521,7 +1521,7 @@ inline bool operator!=(const Vector<T, inlineCapacity, OverflowHandler, minCapac
     return !(a == b);
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 template<typename T> struct ValueCheck<Vector<T>> {
     typedef Vector<T> TraitType;
     static void checkConsistency(const Vector<T>& v)
index ed32147..0ba6e02 100644 (file)
@@ -536,7 +536,7 @@ RefPtr<AtomicStringImpl> AtomicStringImpl::lookUp(const UChar* characters, unsig
     return nullptr;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 bool AtomicStringImpl::isInAtomicStringTable(StringImpl* string)
 {
     AtomicStringTableLocker locker;
index 2876376..210d747 100644 (file)
@@ -69,7 +69,7 @@ public:
         return add(*stringTableProvider.atomicStringTable(), *string);
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     WTF_EXPORT_STRING_API static bool isInAtomicStringTable(StringImpl*);
 #endif
 
@@ -100,7 +100,7 @@ private:
     WTF_EXPORT_STRING_API static RefPtr<AtomicStringImpl> lookUpSlowCase(StringImpl&);
 };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 // AtomicStringImpls created from StaticStringImpl will ASSERT
 // in the generic ValueCheck<T>::checkConsistency
 // as they are not allocated by fastMalloc.
index 9332957..59f2bcd 100644 (file)
@@ -605,7 +605,7 @@ template<typename CharacterType, unsigned lowercaseLettersLength> inline bool eq
 
 template<typename StringClass> bool inline hasPrefixWithLettersIgnoringASCIICaseCommon(const StringClass& string, const char* lowercaseLetters, unsigned length)
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     ASSERT(*lowercaseLetters);
     for (const char* letter = lowercaseLetters; *letter; ++letter)
         ASSERT(toASCIILowerUnchecked(*letter) == *letter);
index 9009060..2755e54 100644 (file)
@@ -878,7 +878,7 @@ using StaticStringImpl = StringImpl::StaticStringImpl;
 
 static_assert(sizeof(StringImpl) == sizeof(StaticStringImpl), "");
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 // StringImpls created from StaticStringImpl will ASSERT
 // in the generic ValueCheck<T>::checkConsistency
 // as they are not allocated by fastMalloc.
index 8c50145..1bb5a42 100644 (file)
@@ -199,7 +199,7 @@ inline RegisteredSymbolImpl* SymbolImpl::asRegisteredSymbolImpl()
     return static_cast<RegisteredSymbolImpl*>(this);
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 // SymbolImpls created from StaticStringImpl will ASSERT
 // in the generic ValueCheck<T>::checkConsistency
 // as they are not allocated by fastMalloc.
index 09aba85..2bdd8cd 100644 (file)
@@ -41,7 +41,7 @@ protected:
     UniquedStringImpl(CreateSymbolTag) : StringImpl(CreateSymbol) { }
 };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 // UniquedStringImpls created from StaticStringImpl will ASSERT
 // in the generic ValueCheck<T>::checkConsistency
 // as they are not allocated by fastMalloc.
index f2993ee..782162e 100644 (file)
@@ -23,7 +23,7 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#define ASSERT_DISABLED 0
+#define ASSERT_ENABLED 1
 #include "config.h"
 
 #if USE(CF)
index 412015f..b83cdb2 100644 (file)
@@ -1,3 +1,249 @@
+2020-01-06  Mark Lam  <mark.lam@apple.com>
+
+        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):
+
 2020-01-06  Alexey Shvayka  <shvaikalesh@gmail.com>
 
         Proxy's [[OwnPropertyKeys]] is incorrect in DontEnumPropertiesMode::Exclude
index ee6f1a6..ced8059 100644 (file)
@@ -2618,7 +2618,7 @@ public:
             performJITMemcpy(where, &insn, sizeof(int));
             cacheFlush(where, sizeof(int));
         }
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         else {
             MemOpSize size;
             bool V;
@@ -2632,7 +2632,7 @@ public:
             ASSERT(opc == MemOp_LOAD);
             ASSERT(!(imm12 & ~0x1ff));
         }
-#endif
+#endif // ASSERT_ENABLED
     }
 
     static void replaceWithAddressComputation(void* where)
@@ -2653,7 +2653,7 @@ public:
             performJITMemcpy(where, &insn, sizeof(int));
             cacheFlush(where, sizeof(int));
         }
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         else {
             Datasize sf;
             AddOp op;
@@ -2669,7 +2669,7 @@ public:
             ASSERT(!shift);
             ASSERT(!(imm12 & ~0xff8));
         }
-#endif
+#endif // ASSERT_ENABLED
     }
 
     static void repatchPointer(void* where, void* valuePtr)
index 8ebc688..41ba792 100644 (file)
@@ -247,7 +247,7 @@ namespace JSC {
                 buffer.ensureSpace(requiredSpace);
                 m_storageBuffer = buffer.m_storage.buffer();
                 m_index = buffer.m_index;
-#if !defined(NDEBUG)
+#if ASSERT_ENABLED
                 m_initialIndex = m_index;
                 m_requiredSpace = requiredSpace;
 #endif
@@ -276,7 +276,7 @@ namespace JSC {
             AssemblerBuffer& m_buffer;
             char* m_storageBuffer;
             unsigned m_index;
-#if !defined(NDEBUG)
+#if ASSERT_ENABLED
             unsigned m_initialIndex;
             unsigned m_requiredSpace;
 #endif
index 209fe88..2103fb7 100644 (file)
@@ -210,7 +210,7 @@ void LinkBuffer::copyCompactAndLinkCode(MacroAssembler& macroAssembler, void* ow
             jumpsToLink[i].setFrom(writePtr);
         }
     } else {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             for (unsigned i = 0; i < jumpCount; ++i)
                 ASSERT(!MacroAssembler::canCompact(jumpsToLink[i].type()));
         }
index da47705..c412c58 100644 (file)
@@ -104,7 +104,7 @@ Stack::Stack(Stack&& other)
     , m_pages(WTFMove(other.m_pages))
 {
     m_savedStackPointer = other.m_savedStackPointer;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     other.m_isValid = false;
 #endif
 }
index 3b138f0..f04bb63 100644 (file)
@@ -190,7 +190,7 @@ public:
     bool hasWritesToFlush();
     void flushWrites();
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool isValid() { return m_isValid; }
 #endif
 
@@ -211,7 +211,7 @@ private:
     StackBounds m_stackBounds;
     HashMap<void*, std::unique_ptr<Page>> m_pages;
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_isValid { true };
 #endif
 };
index e2c29af..e67f304 100644 (file)
@@ -77,7 +77,7 @@ public:
             Vector<Override>& forValue =
                 overrides.add(value, Vector<Override>()).iterator->value;
 
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 for (const Override& otherOverride : forValue)
                     ASSERT_UNUSED(otherOverride, otherOverride.block != override.block);
             }
index 19248a5..157409e 100644 (file)
@@ -64,7 +64,7 @@
 #include <wtf/IndexSet.h>
 #include <wtf/ListDump.h>
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -3688,7 +3688,7 @@ void lowerToAir(Procedure& procedure)
 
 } } // namespace JSC::B3
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index 3b8727f..0ac1cff 100644 (file)
@@ -81,7 +81,7 @@ MemoryValue::MemoryValue(MemoryValue::MemoryValueLoad, Kind kind, Type type, Ori
     , m_range(range)
     , m_fenceRange(fenceRange)
 {
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         switch (kind.opcode()) {
         case Load:
             break;
@@ -106,7 +106,7 @@ MemoryValue::MemoryValue(MemoryValue::MemoryValueLoad, Kind kind, Type type, Ori
 MemoryValue::MemoryValue(MemoryValue::MemoryValueLoadImplied, Kind kind, Origin origin, Value* pointer, MemoryValue::OffsetType offset, HeapRange range, HeapRange fenceRange)
     : MemoryValue(kind, Int32, origin, pointer, offset, range, fenceRange)
 {
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         switch (kind.opcode()) {
         case Load8Z:
         case Load8S:
index 96c0b9a..360f045 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <wtf/PrintStream.h>
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -375,7 +375,7 @@ void printInternal(PrintStream& out, Opcode opcode)
 
 } // namespace WTF
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index 647f8da..9322f88 100644 (file)
@@ -30,7 +30,7 @@
 #include "B3Common.h"
 #include <wtf/StdLibExtras.h>
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -135,7 +135,7 @@ void printInternal(PrintStream&, JSC::B3::Type);
 
 } // namespace WTF
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index d06e661..6acf1e6 100644 (file)
@@ -30,7 +30,7 @@
 #include "B3Type.h"
 #include <wtf/PrintStream.h>
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -103,7 +103,7 @@ private:
 
 } } // namespace JSC::B3
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index ca23dc4..a0202d0 100644 (file)
@@ -30,7 +30,7 @@
 #include "B3Bank.h"
 #include "B3Type.h"
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -143,7 +143,7 @@ void printInternal(PrintStream&, JSC::B3::Width);
 
 } // namespace WTF
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index c1e1300..17bff7b 100644 (file)
@@ -286,7 +286,7 @@ void GenerateAndAllocateRegisters::prepareForGeneration()
         data.spillSlot = m_code.addStackSlot(8, StackSlotKind::Spill);
         data.reg = Reg();
         m_map[tmp] = data;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_allTmps[tmp.bank()].append(tmp);
 #endif
     };
@@ -324,7 +324,7 @@ void GenerateAndAllocateRegisters::prepareForGeneration()
     lowerStackArgs(m_code);
 
     // Verify none of these passes add any tmps.
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     forEachBank([&] (Bank bank) {
         ASSERT(m_allTmps[bank].size() - m_registers[bank].size() == m_code.numTmps(bank));
     });
@@ -417,7 +417,7 @@ void GenerateAndAllocateRegisters::generate(CCallHelpers& jit)
         }
 
         forEachBank([&] (Bank bank) {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             // By default, everything is spilled at block boundaries. We do this after we process each block
             // so we don't have to walk all Tmps, since #Tmps >> #Available regs. Instead, we walk the register file at
             // each block boundary and clear entries in this map.
index 086068a..bcb19ff 100644 (file)
@@ -162,7 +162,7 @@ protected:
 
     bool hasBeenSimplified(IndexType tmpIndex)
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             if (!!m_coalescedTmps[tmpIndex])
                 ASSERT(getAlias(tmpIndex) != tmpIndex);
         }
@@ -648,7 +648,7 @@ public:
         // added to the select stack, it's not on either list, but only on the select stack.
         // Once on the select stack, logically, it's no longer in the interference graph.
         auto assertInvariants = [&] () {
-            if (ASSERT_DISABLED)
+            if (!ASSERT_ENABLED)
                 return;
             if (!shouldValidateIRAtEachPhase())
                 return;
@@ -689,7 +689,7 @@ public:
             }
         } while (changed);
 
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             ASSERT(!m_simplifyWorklist.size());
             ASSERT(m_spillWorklist.isEmpty());
             IndexType firstNonRegIndex = m_lastPrecoloredRegisterIndex + 1;
@@ -727,7 +727,7 @@ protected:
             // No coalescing will remove the interference.
             moveIndex = UINT_MAX;
 
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 if (isPrecolored(v))
                     ASSERT(isPrecolored(u));
             }
@@ -910,7 +910,7 @@ protected:
             if (traceDebug)
                 dataLogLn("Moving tmp ", tmpIndex, " from spill list to simplify list because it's degree is now less than k");
 
-            if (!ASSERT_DISABLED)
+            if (ASSERT_ENABLED)
                 ASSERT(m_unspillableTmps.contains(tmpIndex) || m_spillWorklist.contains(tmpIndex));
             m_spillWorklist.quickClear(tmpIndex);
 
index 8fa0d50..3f9aaef 100644 (file)
@@ -34,7 +34,7 @@
 #include "FPRInfo.h"
 #include "GPRInfo.h"
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -383,7 +383,7 @@ void printInternal(PrintStream& out, Arg::Signedness signedness)
 
 } // namespace WTF
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index 517e4be..bf9ae5e 100644 (file)
@@ -35,7 +35,7 @@
 #include "B3Width.h"
 #include <wtf/Optional.h>
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -1494,7 +1494,7 @@ template<> struct HashTraits<JSC::B3::Air::Arg> : SimpleClassHashTraits<JSC::B3:
 
 } // namespace WTF
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index 3c44aff..fbeea99 100644 (file)
@@ -44,7 +44,7 @@ namespace JSC { namespace B3 {
 
 class Procedure;
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -392,7 +392,7 @@ private:
 
 } } } // namespace JSC::B3::Air
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index b9697ec..5c27b4e 100644 (file)
@@ -139,13 +139,13 @@ Vector<Inst> emitShuffle(
         });
     
     // First validate that this is the kind of shuffle that we know how to deal with.
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     for (const ShufflePair& pair : pairs) {
         ASSERT(pair.src().isBank(bank));
         ASSERT(pair.dst().isBank(bank));
         ASSERT(pair.dst().isTmp() || pair.dst().isMemory());
     }
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
     // There are two possible kinds of operations that we will do:
     //
index 8d23748..c4b1ee3 100644 (file)
@@ -205,7 +205,7 @@ UnlinkedFunctionExecutable* BuiltinExecutables::createExecutable(VM& vm, const S
     metadata.overrideName(name);
     metadata.setEndPosition(positionBeforeLastNewline);
 
-    if (!ASSERT_DISABLED || Options::validateBytecode()) {
+    if (UNLIKELY(ASSERT_ENABLED || Options::validateBytecode())) {
         JSTextPosition positionBeforeLastNewlineFromParser;
         ParserError error;
         JSParserBuiltinMode builtinMode = isBuiltinDefaultClassConstructor ? JSParserBuiltinMode::NotBuiltin : JSParserBuiltinMode::Builtin;
index 9899362..823603a 100644 (file)
@@ -1983,7 +1983,7 @@ TypedArrayType AccessCase::toTypedArrayType(AccessType accessType)
     }
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void AccessCase::checkConsistency(StructureStubInfo& stubInfo)
 {
     RELEASE_ASSERT(!(requiresInt32PropertyCheck() && requiresIdentifierNameMatch()));
@@ -1993,7 +1993,7 @@ void AccessCase::checkConsistency(StructureStubInfo& stubInfo)
         RELEASE_ASSERT(requiresIdentifierNameMatch());
     }
 }
-#endif
+#endif // ASSERT_ENABLED
 
 } // namespace JSC
 
index 3d2a74d..5fa2e0c 100644 (file)
@@ -239,7 +239,7 @@ public:
     Box<Identifier> identifier() const { return m_identifier; }
 
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     void checkConsistency(StructureStubInfo&);
 #else
     ALWAYS_INLINE void checkConsistency(StructureStubInfo&) { }
index 7169786..5272775 100644 (file)
@@ -115,7 +115,7 @@ CallVariantList variantListWithVariant(const CallVariantList& list, CallVariant
     if (!!variantToAdd)
         result.append(variantToAdd);
     
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         for (unsigned i = 0; i < result.size(); ++i) {
             for (unsigned j = i + 1; j < result.size(); ++j) {
                 if (result[i] != result[j])
index c63dbdc..4e4790d 100644 (file)
@@ -1783,7 +1783,7 @@ void CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex(BytecodeIndex byte
     OpCatch op = instruction->as<OpCatch>();
     auto& metadata = op.metadata(this);
     if (!!metadata.m_buffer) {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         ConcurrentJSLocker locker(m_lock);
         bool found = false;
         auto* rareData = m_rareData.get();
@@ -1795,7 +1795,7 @@ void CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex(BytecodeIndex byte
             }
         }
         ASSERT(found);
-#endif
+#endif // ASSERT_ENABLED
         return;
     }
 
index ee1b03d..b13c999 100644 (file)
@@ -58,10 +58,10 @@ void CodeBlockHash::dump(PrintStream& out) const
 {
     std::array<char, 7> buffer = integerToSixCharacterHashString(m_hash);
     
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     CodeBlockHash recompute(buffer.data());
     ASSERT(recompute == *this);
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
     
     out.print(buffer.data());
 }
index a930996..f648b53 100644 (file)
@@ -374,7 +374,7 @@ void StructureStubInfo::setCacheType(CacheType newCacheType)
     m_cacheType = newCacheType;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void StructureStubInfo::checkConsistency()
 {
     if (thisValueIsInThisGPR()) {
@@ -383,7 +383,7 @@ void StructureStubInfo::checkConsistency()
         RELEASE_ASSERT(hasConstantIdentifier);
     }
 }
-#endif
+#endif // ASSERT_ENABLED
 
 #endif // ENABLE(JIT)
 
index 8025b9f..f4e51cf 100644 (file)
@@ -263,7 +263,7 @@ public:
 
     bool thisValueIsInThisGPR() const { return accessType == AccessType::GetByIdWithThis; }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     void checkConsistency();
 #else
     ALWAYS_INLINE void checkConsistency() { }
index e4f2aea..f4a1efe 100644 (file)
@@ -941,8 +941,8 @@ RegisterID* FunctionCallValueNode::emitBytecode(BytecodeGenerator& generator, Re
 
 RegisterID* FunctionCallResolveNode::emitBytecode(BytecodeGenerator& generator, RegisterID* dst)
 {
-    if (UNLIKELY(m_ident == generator.vm().propertyNames->builtinNames().assertPrivateName())) {
-        if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED) {
+        if (UNLIKELY(m_ident == generator.vm().propertyNames->builtinNames().assertPrivateName()))
             return generator.move(dst, generator.emitLoad(nullptr, jsUndefined()));
     }
 
index f819b12..73b4320 100644 (file)
@@ -43,7 +43,7 @@ namespace JSC {
         RegisterID()
             : m_refCount(0)
             , m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
             , m_didSetIndex(false)
 #endif
         {
@@ -53,7 +53,7 @@ namespace JSC {
             : m_refCount(0)
             , m_virtualRegister(virtualRegister)
             , m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
             , m_didSetIndex(true)
 #endif
         {
@@ -63,7 +63,7 @@ namespace JSC {
             : m_refCount(0)
             , m_virtualRegister(VirtualRegister(index))
             , m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
             , m_didSetIndex(true)
 #endif
         {
@@ -71,7 +71,7 @@ namespace JSC {
 
         void setIndex(VirtualRegister index)
         {
-#ifndef NDEBUG
+#if ASSERT_ENABLED
             m_didSetIndex = true;
 #endif
             m_virtualRegister = index;
@@ -120,7 +120,7 @@ namespace JSC {
         int m_refCount;
         VirtualRegister m_virtualRegister;
         bool m_isTemporary;
-#ifndef NDEBUG
+#if ASSERT_ENABLED
         bool m_didSetIndex;
 #endif
     };
index 409075d..9c7cfbc 100644 (file)
@@ -451,14 +451,14 @@ void Debugger::removeBreakpoint(BreakpointID id)
     toggleBreakpoint(*breakpoint, BreakpointDisabled);
 
     BreakpointsList& breakpoints = *breaksIt->value;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool found = false;
     for (Breakpoint* current = breakpoints.head(); current && !found; current = current->next()) {
         if (current->id == breakpoint->id)
             found = true;
     }
     ASSERT(found);
-#endif
+#endif // ASSERT_ENABLED
 
     m_breakpointIDToBreakpoint.remove(idIt);
     breakpoints.remove(breakpoint);
index 461f0a6..910d817 100644 (file)
@@ -39,7 +39,7 @@ public:
 
     DebuggerEvalEnabler(JSGlobalObject* globalObject, Mode mode = Mode::EvalOnCurrentCallFrame)
         : m_globalObject(globalObject)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_mode(mode)
 #endif
         
@@ -49,7 +49,7 @@ public:
             m_evalWasDisabled = !globalObject->evalEnabled();
             if (m_evalWasDisabled)
                 globalObject->setEvalEnabled(true, globalObject->evalDisabledErrorMessage());
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             if (m_mode == Mode::EvalOnGlobalObjectAtDebuggerEntry)
                 globalObject->setGlobalObjectAtDebuggerEntry(globalObject);
 #endif
@@ -62,7 +62,7 @@ public:
             JSGlobalObject* globalObject = m_globalObject;
             if (m_evalWasDisabled)
                 globalObject->setEvalEnabled(false, globalObject->evalDisabledErrorMessage());
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             if (m_mode == Mode::EvalOnGlobalObjectAtDebuggerEntry)
                 globalObject->setGlobalObjectAtDebuggerEntry(nullptr);
 #endif
@@ -72,7 +72,7 @@ public:
 private:
     JSGlobalObject* m_globalObject;
     bool m_evalWasDisabled { false };
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     DebuggerEvalEnabler::Mode m_mode;
 #endif
 };
index 71c4d06..b6f94d4 100644 (file)
@@ -4378,7 +4378,7 @@ void AbstractInterpreter<AbstractStateType>::observeTransitions(
     AbstractValue::TransitionsObserver transitionsObserver(vector);
     forAllValues(clobberLimit, transitionsObserver);
     
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         // We don't need to claim to be in a clobbered state because none of the Transition::previous structures are watchable.
         for (unsigned i = vector.size(); i--;)
             ASSERT(!vector[i].previous->dfgShouldWatch());
index 19f93b7..ba019c9 100644 (file)
@@ -441,7 +441,7 @@ FiltrationResult AbstractValue::normalizeClarity(Graph& graph)
     return result;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void AbstractValue::checkConsistency() const
 {
     if (!(m_type & SpecCell)) {
@@ -465,7 +465,7 @@ void AbstractValue::assertIsRegistered(Graph& graph) const
 {
     m_structure.assertIsRegistered(graph);
 }
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 ResultType AbstractValue::resultType() const
 {
index edc194b..cf9fd08 100644 (file)
@@ -283,7 +283,7 @@ struct AbstractValue {
         if (other.isClear())
             return false;
         
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         AbstractValue oldMe = *this;
 #endif
         bool result = false;
@@ -431,12 +431,12 @@ struct AbstractValue {
             || !arrayModesAreClearOrTop(m_arrayModes);
     }
     
-#if ASSERT_DISABLED
-    void checkConsistency() const { }
-    void assertIsRegistered(Graph&) const { }
-#else
+#if ASSERT_ENABLED
     JS_EXPORT_PRIVATE void checkConsistency() const;
     void assertIsRegistered(Graph&) const;
+#else
+    void checkConsistency() const { }
+    void assertIsRegistered(Graph&) const { }
 #endif
 
     ResultType resultType() const;
index 2b7a3c2..1cdf5f5 100644 (file)
@@ -92,7 +92,7 @@ inline bool doesOverflow(Arith::Mode mode)
     switch (mode) {
     case Arith::NotSet:
         ASSERT_NOT_REACHED();
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
         FALLTHROUGH;
 #endif
     case Arith::Unchecked:
index 99fda62..e48e0c2 100644 (file)
@@ -46,7 +46,7 @@ BasicBlock::BasicBlock(BytecodeIndex bytecodeBegin, unsigned numArguments, unsig
     , intersectionOfCFAHasVisited(true)
     , isOSRTarget(false)
     , isCatchEntrypoint(false)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     , isLinked(false)
 #endif
     , isReachable(false)
index 7f5b395..d2c5ae9 100644 (file)
@@ -175,7 +175,7 @@ struct BasicBlock : RefCounted<BasicBlock> {
     
     void didLink()
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         isLinked = true;
 #endif
     }
@@ -197,7 +197,7 @@ struct BasicBlock : RefCounted<BasicBlock> {
     bool isOSRTarget;
     bool isCatchEntrypoint;
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool isLinked;
 #endif
     bool isReachable;
index 3dc7568..4bdb7ba 100644 (file)
@@ -235,7 +235,7 @@ private:
                 break;
             }
             
-            if (!ASSERT_DISABLED
+            if (ASSERT_ENABLED
                 && m_state.didClobberOrFolded() != writesOverlap(m_graph, node, JSCell_structureID))
                 DFG_CRASH(m_graph, node, toCString("AI-clobberize disagreement; AI says ", m_state.clobberState(), " while clobberize says ", writeSet(m_graph, node)).data());
         }
index f272670..eddeaba 100644 (file)
@@ -83,7 +83,7 @@ inline bool shouldDumpGraphAtEachPhase(CompilationMode mode)
 
 inline bool validationEnabled()
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     return true;
 #else
     return Options::validateGraph() || Options::validateGraphAtEachPhase();
index 7c80750..0712ccb 100644 (file)
@@ -215,7 +215,7 @@ void CommonData::finalizeCatchEntrypoints()
     std::sort(catchEntrypoints.begin(), catchEntrypoints.end(),
         [] (const CatchEntrypointData& a, const CatchEntrypointData& b) { return a.bytecodeIndex < b.bytecodeIndex; });
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     for (unsigned i = 0; i + 1 < catchEntrypoints.size(); ++i)
         ASSERT(catchEntrypoints[i].bytecodeIndex <= catchEntrypoints[i + 1].bytecodeIndex);
 #endif
index 9e13b62..5fbaebc 100644 (file)
@@ -113,7 +113,7 @@ struct AdaptiveStructureWatchpointAdaptor {
 
 template<typename WatchpointSetType, typename Adaptor = SetPointerAdaptor<WatchpointSetType>>
 class GenericDesiredWatchpoints {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     typedef HashMap<WatchpointSetType, bool> StateMap;
 #endif
 public:
index f5bd1f5..6eb8402 100644 (file)
@@ -249,7 +249,7 @@ bool doesGC(Graph& graph, Node* node)
     case DataViewSet:
         return false;
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     case ArrayPush:
     case ArrayPop:
     case PushWithScope:
@@ -399,11 +399,11 @@ bool doesGC(Graph& graph, Node* node)
     case ValuePow:
     case ValueBitNot:
     case ValueNegate:
-#else
-    // See comment at the top for why be default for all nodes should be to
+#else // not ASSERT_ENABLED
+    // See comment at the top for why the default for all nodes should be to
     // return true.
     default:
-#endif
+#endif // not ASSERT_ENABLED
         return true;
 
     case CallStringConstructor:
index 31aa2d5..b78e18b 100644 (file)
@@ -198,7 +198,7 @@ private:
         ASSERT(useKind >= 0 && useKind < LastUseKind);
         static_assert((static_cast<uintptr_t>(LastUseKind) << 2) < (static_cast<uintptr_t>(1) << shift()), "We rely on this being true to not clobber the node pointer.");
         uintptr_t result = shiftedValue | (static_cast<uintptr_t>(useKind) << 2) | (DFG::doesKill(killStatus) << 1) | static_cast<uintptr_t>(DFG::isProved(proofStatus));
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             union U {
                 U() { word = 0; }
                 uintptr_t word;
index 7649242..dce8e3f 100644 (file)
@@ -2438,9 +2438,7 @@ private:
             break;
         }
 
-
-
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         // Have these no-op cases here to ensure that nobody forgets to add handlers for new opcodes.
         case SetArgumentDefinitely:
         case SetArgumentMaybe:
@@ -2530,10 +2528,10 @@ private:
         case InvalidationPoint:
         case CreateArgumentsButterfly:
             break;
-#else
+#else // not ASSERT_ENABLED
         default:
             break;
-#endif
+#endif // not ASSERT_ENABLED
         }
     }
 
index 7e2f9ea..9b21df3 100644 (file)
@@ -253,7 +253,7 @@ void JITCode::finalizeOSREntrypoints()
     };
     std::sort(osrEntry.begin(), osrEntry.end(), comparator);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     auto verifyIsSorted = [&] (auto& osrVector) {
         for (unsigned i = 0; i + 1 < osrVector.size(); ++i)
             ASSERT(osrVector[i].m_bytecodeIndex <= osrVector[i + 1].m_bytecodeIndex);
index 7da6afd..335034b 100644 (file)
@@ -494,7 +494,7 @@ public:
         for (Node* identifier : toEscape)
             escapeAllocation(identifier);
 
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             for (const auto& entry : m_allocations)
                 ASSERT_UNUSED(entry, entry.value.isEscapedAllocation() || other.m_allocations.contains(entry.key));
         }
@@ -519,7 +519,7 @@ public:
 
     void assertIsValid() const
     {
-        if (ASSERT_DISABLED)
+        if (!ASSERT_ENABLED)
             return;
 
         // Pointers should point to an actual allocation
index 04f2c0c..ca99026 100644 (file)
@@ -159,7 +159,7 @@ public:
                         nodeIndex, node->variableAccessData()->prediction(),
                         GetStack, node->origin,
                         OpInfo(m_graph.m_stackAccessData.add(variable->operand(), variable->flushFormat())));
-                    if (!ASSERT_DISABLED)
+                    if (ASSERT_ENABLED)
                         m_argumentGetters.add(childNode);
                     m_argumentMapping.add(node, childNode);
                 }
index d362a1b..c295d21 100644 (file)
@@ -60,7 +60,7 @@ public:
     
     void assertClear()
     {
-        if (ASSERT_DISABLED)
+        if (!ASSERT_ENABLED)
             return;
         
         // For every entry in the used list the use count of the virtual register should be zero, or max, due to it being a preserved local.
index cdcdaa6..8ffbd3c 100644 (file)
@@ -52,7 +52,7 @@ public:
         jit->m_origin = m_origin;
         generateInternal(jit);
         jit->m_outOfLineStreamIndex = WTF::nullopt;
-        if (!ASSERT_DISABLED)
+        if (ASSERT_ENABLED)
             jit->m_jit.abortWithReason(DFGSlowPathGeneratorFellThrough);
     }
     MacroAssembler::Label label() const { return m_label; }
index 7ce376a..91f338f 100644 (file)
@@ -1888,7 +1888,7 @@ void SpeculativeJIT::compileCurrentBlock()
     }
     
     // Perform the most basic verification that children have been used correctly.
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         for (auto& info : m_generationInfo)
             RELEASE_ASSERT(!info.alive());
     }
@@ -10958,7 +10958,7 @@ void SpeculativeJIT::emitBinarySwitchStringRecurse(
         // We've already checked that the input string is a prefix of all of the cases,
         // so we just check length to jump to that case.
         
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             ASSERT(cases[begin].string->length() == commonChars);
             for (unsigned i = begin + 1; i < end; ++i)
                 ASSERT(cases[i].string->length() > commonChars);
@@ -11975,7 +11975,7 @@ void SpeculativeJIT::emitAllocateButterfly(GPRReg storageResultGPR, GPRReg sizeG
     m_jit.zeroExtend32ToPtr(sizeGPR, scratch1);
     m_jit.lshift32(TrustedImm32(3), scratch1);
     m_jit.add32(TrustedImm32(sizeof(IndexingHeader)), scratch1, scratch2);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     MacroAssembler::Jump didNotOverflow = m_jit.branch32(MacroAssembler::AboveOrEqual, scratch2, sizeGPR);
     m_jit.abortWithReason(UncheckedOverflow);
     didNotOverflow.link(&m_jit);
@@ -13482,14 +13482,14 @@ void SpeculativeJIT::compileAllocateNewArrayWithSize(JSGlobalObject* globalObjec
     MacroAssembler::JumpList slowCases;
     if (shouldConvertLargeSizeToArrayStorage)
         slowCases.append(m_jit.branch32(MacroAssembler::AboveOrEqual, sizeGPR, TrustedImm32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH)));
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     else {
         MacroAssembler::Jump lengthIsWithinLimits;
         lengthIsWithinLimits = m_jit.branch32(MacroAssembler::Below, sizeGPR, TrustedImm32(MIN_ARRAY_STORAGE_CONSTRUCTION_LENGTH));
         m_jit.abortWithReason(UncheckedOverflow);
         lengthIsWithinLimits.link(&m_jit);
     }
-#endif
+#endif // ASSERT_ENABLED
 
     // We can use resultGPR as a scratch right now.
     emitAllocateButterfly(storageGPR, sizeGPR, scratchGPR, scratch2GPR, resultGPR, slowCases);
@@ -14010,7 +14010,7 @@ void SpeculativeJIT::compileMakeRope(Node* node)
             }
         }
 
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             CCallHelpers::Jump ok = m_jit.branch32(
                 CCallHelpers::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
             m_jit.abortWithReason(DFGNegativeStringLength);
@@ -14054,7 +14054,7 @@ void SpeculativeJIT::compileMakeRope(Node* node)
         }
     }
 
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         CCallHelpers::Jump ok = m_jit.branch32(
             CCallHelpers::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
         m_jit.abortWithReason(DFGNegativeStringLength);
index cd5e5da..adf6714 100644 (file)
@@ -1208,7 +1208,7 @@ GPRReg SpeculativeJIT::fillSpeculateCell(Edge edge)
     case DataFormatJSCell: {
         GPRReg gpr = info.gpr();
         m_gprs.lock(gpr);
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             MacroAssembler::Jump checkCell = m_jit.branchIfCell(JSValueRegs(gpr));
             m_jit.abortWithReason(DFGIsNotCell);
             checkCell.link(&m_jit);
index d9d9c6c..1243321 100644 (file)
@@ -32,7 +32,7 @@
 
 namespace JSC { namespace DFG {
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void StructureAbstractValue::assertIsRegistered(Graph& graph) const
 {
     if (isTop())
@@ -41,7 +41,7 @@ void StructureAbstractValue::assertIsRegistered(Graph& graph) const
     for (unsigned i = size(); i--;)
         graph.assertIsRegistered(at(i).get());
 }
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 void StructureAbstractValue::clobber()
 {
index 9107a8a..ddff717 100644 (file)
@@ -90,10 +90,10 @@ public:
         m_set.m_pointer = topValue;
     }
     
-#if ASSERT_DISABLED
-    void assertIsRegistered(Graph&) const { }
-#else
+#if ASSERT_ENABLED
     void assertIsRegistered(Graph&) const;
+#else
+    void assertIsRegistered(Graph&) const { }
 #endif
     
     void clobber();
index 95cdc92..74ea618 100644 (file)
@@ -421,7 +421,7 @@ private:
                 break;
 
             default:
-                if (ASSERT_DISABLED)
+                if (!ASSERT_ENABLED)
                     break;
                 m_graph.doToChildren(
                     node,
index 7415acd..4e763ed 100644 (file)
@@ -55,7 +55,7 @@ public:
                 continue;
             if (!block->isReachable)
                 continue;
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 // Force usage of highest-numbered virtual registers.
                 scoreBoard.sortFree();
             }
index e307b09..3e0d58f 100644 (file)
@@ -151,7 +151,7 @@ void link(State& state)
             jit.jumpToExceptionHandler(vm);
             noException.link(&jit);
 
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 jit.load64(vm.addressOfException(), GPRInfo::regT1);
                 jit.jitAssertIsNull(GPRInfo::regT1);
             }
index 47048da..eec481e 100644 (file)
@@ -121,7 +121,7 @@ namespace {
 
 std::atomic<int> compileCounter;
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 NO_RETURN_DUE_TO_CRASH static void ftlUnreachable(
     CodeBlock* codeBlock, BlockIndex blockIndex, unsigned nodeIndex)
 {
@@ -131,7 +131,7 @@ NO_RETURN_DUE_TO_CRASH static void ftlUnreachable(
     dataLog(".\n");
     CRASH();
 }
-#endif
+#endif // ASSERT_ENABLED
 
 // Using this instead of typeCheck() helps to reduce the load on B3, by creating
 // significantly less dead code.
@@ -17566,7 +17566,7 @@ private:
         m_out.store32(
             m_out.constInt32(callSiteIndex.bits()),
             tagFor(VirtualRegister(CallFrameSlot::argumentCountIncludingThis)));
-#if !USE(BUILTIN_FRAME_ADDRESS) || !ASSERT_DISABLED
+#if !USE(BUILTIN_FRAME_ADDRESS) || ASSERT_ENABLED
         m_out.storePtr(m_callFrame, m_out.absolute(&vm().topCallFrame));
 #endif
     }
@@ -17598,7 +17598,7 @@ private:
     {
         JSGlobalObject* globalObject = m_graph.globalObjectFor(m_node->origin.semantic);
         if (Options::useExceptionFuzz()) {
-#if !USE(BUILTIN_FRAME_ADDRESS) || !ASSERT_DISABLED
+#if !USE(BUILTIN_FRAME_ADDRESS) || ASSERT_ENABLED
             m_out.storePtr(m_callFrame, m_out.absolute(&vm().topCallFrame));
 #endif
             m_out.call(Void, m_out.operation(operationExceptionFuzz), weakPointer(globalObject));
@@ -18170,7 +18170,7 @@ private:
     {
         BlockIndex blockIndex = block->index;
         unsigned nodeIndex = node ? node->index() : UINT_MAX;
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
         m_out.patchpoint(Void)->setGenerator(
             [=] (CCallHelpers& jit, const StackmapGenerationParams&) {
                 AllowMacroScratchRegisterUsage allowScratch(jit);
@@ -18181,7 +18181,7 @@ private:
                     jit.move(CCallHelpers::TrustedImm32(node->op()), GPRInfo::regT2);
                 jit.abortWithReason(FTLCrash);
             });
-#else
+#else // ASSERT_ENABLED
         m_out.call(
             Void,
             m_out.constIntPtr(ftlUnreachable),
@@ -18189,7 +18189,7 @@ private:
             // that would cause it to always get collected.
             m_out.constIntPtr(bitwise_cast<intptr_t>(codeBlock())), m_out.constInt32(blockIndex),
             m_out.constInt32(nodeIndex));
-#endif
+#endif // ASSERT_ENABLED
         m_out.unreachable();
     }
 
index 102c1e6..71f74dd 100644 (file)
@@ -411,7 +411,7 @@ extern "C" JSCell* JIT_OPERATION operationMaterializeObjectInOSR(JSGlobalObject*
                 array->putDirectIndex(globalObject, arrayIndex, JSValue::decode(values[i]));
             }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             // We avoid this O(n^2) loop when asserts are disabled, but the condition checked here
             // must hold to ensure the correctness of the above loop because of how we allocate the array.
             for (unsigned targetIndex = 0; targetIndex < arraySize; ++targetIndex) {
@@ -434,7 +434,7 @@ extern "C" JSCell* JIT_OPERATION operationMaterializeObjectInOSR(JSGlobalObject*
                 }
                 ASSERT(found);
             }
-#endif
+#endif // ASSERT_ENABLED
             return array;
         }
 
@@ -540,7 +540,7 @@ extern "C" JSCell* JIT_OPERATION operationMaterializeObjectInOSR(JSGlobalObject*
         JSArray* result = JSArray::tryCreate(vm, structure, arraySize);
         RELEASE_ASSERT(result);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         // Ensure we see indices for everything in the range: [0, numProperties)
         for (unsigned i = 0; i < numProperties; ++i) {
             bool found = false;
@@ -553,7 +553,7 @@ extern "C" JSCell* JIT_OPERATION operationMaterializeObjectInOSR(JSGlobalObject*
             }
             ASSERT(found);
         }
-#endif
+#endif // ASSERT_ENABLED
 
         Vector<JSValue, 8> arguments;
         arguments.grow(numProperties);
index a8bd31f..12c9c6f 100644 (file)
@@ -296,7 +296,7 @@ void BlockDirectory::shrink()
 
 void BlockDirectory::assertNoUnswept()
 {
-    if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED)
         return;
     
     if (m_bits.unswept().isEmpty())
index b0c92af..d407d5a 100644 (file)
@@ -40,7 +40,7 @@ class GCArraySegment : public DoublyLinkedListNode<GCArraySegment<T>> {
 public:
     GCArraySegment()
         : DoublyLinkedListNode<GCArraySegment<T>>()
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_top(0)
 #endif
     {
@@ -58,7 +58,7 @@ public:
 
     GCArraySegment* m_prev;
     GCArraySegment* m_next;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     size_t m_top;
 #endif
 };
index 46858e6..3555de5 100644 (file)
@@ -62,7 +62,7 @@ void GCSegmentedArray<T>::clear()
     }
     m_top = 0;
     m_numberOfSegments = 1;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     m_segments.head()->m_top = 0;
 #endif
 }
@@ -75,7 +75,7 @@ void GCSegmentedArray<T>::expand()
     GCArraySegment<T>* nextSegment = GCArraySegment<T>::create();
     m_numberOfSegments++;
     
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     nextSegment->m_top = 0;
 #endif
 
@@ -174,9 +174,7 @@ inline size_t GCSegmentedArray<T>::top()
 }
 
 template <typename T>
-#if ASSERT_DISABLED
-inline void GCSegmentedArray<T>::validatePrevious() { }
-#else
+#if ASSERT_ENABLED
 inline void GCSegmentedArray<T>::validatePrevious()
 {
     unsigned count = 0;
@@ -184,7 +182,9 @@ inline void GCSegmentedArray<T>::validatePrevious()
         count++;
     ASSERT(m_segments.size() == m_numberOfSegments);
 }
-#endif
+#else
+inline void GCSegmentedArray<T>::validatePrevious() { }
+#endif // ASSERT_ENABLED
 
 template <typename T>
 inline void GCSegmentedArray<T>::append(T value)
index 7fa06ae..814070a 100644 (file)
@@ -102,7 +102,7 @@ unsigned HandleSet::protectedGlobalObjectCount()
     return count;
 }
 
-#if ENABLE(GC_VALIDATION) || !ASSERT_DISABLED
+#if ENABLE(GC_VALIDATION) || ASSERT_ENABLED
 bool HandleSet::isLiveNode(Node* node)
 {
     if (node->prev()->next() != node)
@@ -112,6 +112,6 @@ bool HandleSet::isLiveNode(Node* node)
         
     return true;
 }
-#endif
+#endif // ENABLE(GC_VALIDATION) || ASSERT_ENABLED
 
 } // namespace JSC
index 656f4c4..5d222d9 100644 (file)
@@ -88,7 +88,7 @@ private:
 
     JS_EXPORT_PRIVATE void grow();
     
-#if ENABLE(GC_VALIDATION) || !ASSERT_DISABLED
+#if ENABLE(GC_VALIDATION) || ASSERT_ENABLED
     bool isLiveNode(Node*);
 #endif
 
index 1adcb21..6be9171 100644 (file)
@@ -2289,7 +2289,7 @@ void Heap::updateAllocationLimits()
     // It's up to the user to ensure that extraMemorySize() ends up corresponding to allocation-time
     // extra memory reporting.
     currentHeapSize += extraMemorySize();
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         Checked<size_t, RecordOverflow> checkedCurrentHeapSize = m_totalBytesVisited;
         checkedCurrentHeapSize += extraMemorySize();
         ASSERT(!checkedCurrentHeapSize.hasOverflowed() && checkedCurrentHeapSize.unsafeGet() == currentHeapSize);
index 1ce5d0c..237f18f 100644 (file)
@@ -96,11 +96,7 @@ class SpeculativeJIT;
 class Worklist;
 }
 
-#if !ASSERT_DISABLED
-#define ENABLE_DFG_DOES_GC_VALIDATION 1
-#else
-#define ENABLE_DFG_DOES_GC_VALIDATION 0
-#endif
+#define ENABLE_DFG_DOES_GC_VALIDATION ASSERT_ENABLED
 constexpr bool validateDFGDoesGC = ENABLE_DFG_DOES_GC_VALIDATION;
 
 typedef HashCountedSet<JSCell*> ProtectCountSet;
index b4a9a96..d781126 100644 (file)
@@ -265,12 +265,12 @@ void MarkedBlock::resetMarks()
     footer().m_markingVersion = MarkedSpace::nullVersion;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void MarkedBlock::assertMarksNotStale()
 {
     ASSERT(footer().m_markingVersion == vm().heap.objectSpace().markingVersion());
 }
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 bool MarkedBlock::areMarksStale()
 {
@@ -361,13 +361,13 @@ void MarkedBlock::Handle::didRemoveFromDirectory()
     blockFooter().m_subspace = nullptr;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void MarkedBlock::assertValidCell(VM& vm, HeapCell* cell) const
 {
     RELEASE_ASSERT(&vm == &this->vm());
     RELEASE_ASSERT(const_cast<MarkedBlock*>(this)->handle().cellAlign(cell) == cell);
 }
-#endif
+#endif // ASSERT_ENABLED
 
 void MarkedBlock::Handle::dumpState(PrintStream& out)
 {
index debcb55..e804e1b 100644 (file)
@@ -352,10 +352,10 @@ public:
     
     bool hasAnyMarked() const;
     void noteMarked();
-#if ASSERT_DISABLED
-    void assertValidCell(VM&, HeapCell*) const { }
-#else
+#if ASSERT_ENABLED
     void assertValidCell(VM&, HeapCell*) const;
+#else
+    void assertValidCell(VM&, HeapCell*) const { }
 #endif
         
     WeakSet& weakSet();
@@ -365,10 +365,10 @@ public:
     
     Dependency aboutToMark(HeapVersion markingVersion);
         
-#if ASSERT_DISABLED
-    void assertMarksNotStale() { }
-#else
+#if ASSERT_ENABLED
     JS_EXPORT_PRIVATE void assertMarksNotStale();
+#else
+    void assertMarksNotStale() { }
 #endif
         
     void resetMarks();
index d408d6e..149ce8d 100644 (file)
@@ -437,7 +437,7 @@ void MarkedSpace::beginMarking()
             allocation->flip();
     }
 
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         forEachBlock(
             [&] (MarkedBlock::Handle* block) {
                 if (block->areMarksStale())
@@ -463,7 +463,7 @@ void MarkedSpace::endMarking()
     for (unsigned i = m_preciseAllocationsOffsetForThisCollection; i < m_preciseAllocations.size(); ++i)
         m_preciseAllocations[i]->clearNewlyAllocated();
 
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         for (PreciseAllocation* allocation : m_preciseAllocations)
             ASSERT_UNUSED(allocation, !allocation->isNewlyAllocated());
     }
@@ -569,7 +569,7 @@ void MarkedSpace::snapshotUnswept()
 
 void MarkedSpace::assertNoUnswept()
 {
-    if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED)
         return;
     forEachDirectory(
         [&] (BlockDirectory& directory) -> IterationStatus {
index 5ddcc1b..6cbaec1 100644 (file)
@@ -250,7 +250,7 @@ void PreciseAllocation::dump(PrintStream& out) const
     out.print(RawPointer(this), ":(cell at ", RawPointer(cell()), " with size ", m_cellSize, " and attributes ", m_attributes, ")");
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void PreciseAllocation::assertValidCell(VM& vm, HeapCell* cell) const
 {
     ASSERT(&vm == &this->vm());
index 466459f..10eb67d 100644 (file)
@@ -142,10 +142,10 @@ public:
     
     void noteMarked() { }
     
-#if ASSERT_DISABLED
-    void assertValidCell(VM&, HeapCell*) const { }
-#else
+#if ASSERT_ENABLED
     void assertValidCell(VM&, HeapCell*) const;
+#else
+    void assertValidCell(VM&, HeapCell*) const { }
 #endif
     
     void sweep();
index 0c2eb41..1a7164e 100644 (file)
@@ -89,7 +89,7 @@ SlotVisitor::SlotVisitor(Heap& heap, CString codeName)
     , m_markingVersion(MarkedSpace::initialVersion)
     , m_heap(heap)
     , m_codeName(codeName)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     , m_isCheckingForDefaultMarkViolation(false)
     , m_isDraining(false)
 #endif
@@ -209,7 +209,7 @@ void SlotVisitor::appendJSCellOrAuxiliary(HeapCell* heapCell)
     
     // In debug mode, we validate before marking since this makes it clearer what the problem
     // was. It's also slower, so we don't do it normally.
-    if (!ASSERT_DISABLED && isJSCellKind(heapCell->cellKind()))
+    if (ASSERT_ENABLED && isJSCellKind(heapCell->cellKind()))
         validateCell(static_cast<JSCell*>(heapCell));
     
     if (Heap::testAndSetMarked(m_markingVersion, heapCell))
index 48c6403..306275b 100644 (file)
@@ -266,7 +266,7 @@ private:
     // Put padding here to mitigate false sharing between multiple SlotVisitors.
     char padding[64];
 public:
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_isCheckingForDefaultMarkViolation;
     bool m_isDraining;
 #endif
index 5b1565b..d7010a5 100644 (file)
@@ -57,16 +57,16 @@ template<typename T> struct BindingTraits<JSON::ArrayOf<T>> {
 
     static void assertValueHasExpectedType(JSON::Value* value)
     {
-#if ASSERT_DISABLED
-        UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
         ASSERT_ARG(value, value);
         RefPtr<JSON::Array> array;
         bool castSucceeded = value->asArray(array);
         ASSERT_UNUSED(castSucceeded, castSucceeded);
         for (unsigned i = 0; i < array->length(); i++)
             BindingTraits<T>::assertValueHasExpectedType(array->get(i).get());
-#endif // !ASSERT_DISABLED
+#else
+        UNUSED_PARAM(value);
+#endif // ASSERT_ENABLED
     }
 };
 
index 863553c..65cebf5 100755 (executable)
@@ -213,9 +213,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
 
         lines.append('void BindingTraits<%s>::assertValueHasExpectedType(JSON::Value* value)' % (CppGenerator.cpp_protocol_type_for_type(object_declaration.type)))
         lines.append("""{
-#if ASSERT_DISABLED
-    UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
     ASSERT_ARG(value, value);
     RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
@@ -255,7 +253,9 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
         if should_count_properties:
             lines.append('    if (foundPropertiesCount != object->size())')
             lines.append('        FATAL("Unexpected properties in object: %s\\n", object->toJSONString().ascii().data());')
-        lines.append('#endif // !ASSERT_DISABLED')
+        lines.append('#else // ASSERT_ENABLED')
+        lines.append('    UNUSED_PARAM(value);')
+        lines.append('#endif // ASSERT_ENABLED')
         lines.append('}')
         return '\n'.join(lines)
 
@@ -263,9 +263,7 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
         lines = []
         lines.append('void %s(JSON::Value* value)' % CppGenerator.cpp_assertion_method_for_type_member(enum_member, object_declaration))
         lines.append('{')
-        lines.append('#if ASSERT_DISABLED')
-        lines.append('    UNUSED_PARAM(value);')
-        lines.append('#else')
+        lines.append('#if ASSERT_ENABLED')
         lines.append('    ASSERT_ARG(value, value);')
         lines.append('    String result;')
         lines.append('    bool castSucceeded = value->asString(result);')
@@ -273,7 +271,9 @@ class CppProtocolTypesImplementationGenerator(CppGenerator):
 
         assert_condition = ' || '.join(['result == "%s"' % enum_value for enum_value in enum_member.type.enum_values()])
         lines.append('    ASSERT(%s);' % assert_condition)
-        lines.append('#endif // !ASSERT_DISABLED')
+        lines.append('#else // ASSERT_ENABLED')
+        lines.append('    UNUSED_PARAM(value);')
+        lines.append('#endif // ASSERT_ENABLED')
         lines.append('}')
 
         return '\n'.join(lines)
index c96a166..e84dacd 100644 (file)
@@ -709,22 +709,20 @@ Optional<Inspector::Protocol::Test::CastedAnimals> parseEnumValueFromString<Insp
 
 void BindingTraits<Inspector::Protocol::Test::CastedAnimals>::assertValueHasExpectedType(JSON::Value* value)
 {
-#if ASSERT_DISABLED
-    UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
     ASSERT_ARG(value, value);
     String result;
     bool castSucceeded = value->asString(result);
     ASSERT(castSucceeded);
     ASSERT(result == "Ducks" || result == "Hens" || result == "Crows" || result == "Flamingos");
-#endif // !ASSERT_DISABLED
+#else // ASSERT_ENABLED
+    UNUSED_PARAM(value);
+#endif // ASSERT_ENABLED
 }
 
 void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasExpectedType(JSON::Value* value)
 {
-#if ASSERT_DISABLED
-    UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
     ASSERT_ARG(value, value);
     RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
@@ -758,7 +756,9 @@ void BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::assertValueHasEx
     int foundPropertiesCount = 5;
     if (foundPropertiesCount != object->size())
         FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
-#endif // !ASSERT_DISABLED
+#else // ASSERT_ENABLED
+    UNUSED_PARAM(value);
+#endif // ASSERT_ENABLED
 }
 
 RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Protocol::Test::TypeNeedingCast>::runtimeCast(RefPtr<JSON::Value>&& value)
@@ -774,9 +774,7 @@ RefPtr<Inspector::Protocol::Test::TypeNeedingCast> BindingTraits<Inspector::Prot
 
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasExpectedType(JSON::Value* value)
 {
-#if ASSERT_DISABLED
-    UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
     ASSERT_ARG(value, value);
     RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
@@ -792,14 +790,14 @@ void BindingTraits<Inspector::Protocol::Test::RecursiveObject1>::assertValueHasE
     }
     if (foundPropertiesCount != object->size())
         FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
-#endif // !ASSERT_DISABLED
+#else // ASSERT_ENABLED
+    UNUSED_PARAM(value);
+#endif // ASSERT_ENABLED
 }
 
 void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasExpectedType(JSON::Value* value)
 {
-#if ASSERT_DISABLED
-    UNUSED_PARAM(value);
-#else
+#if ASSERT_ENABLED
     ASSERT_ARG(value, value);
     RefPtr<JSON::Object> object;
     bool castSucceeded = value->asObject(object);
@@ -815,7 +813,9 @@ void BindingTraits<Inspector::Protocol::Test::RecursiveObject2>::assertValueHasE
     }
     if (foundPropertiesCount != object->size())
         FATAL("Unexpected properties in object: %s\n", object->toJSONString().ascii().data());
-#endif // !ASSERT_DISABLED
+#else // ASSERT_ENABLED
+    UNUSED_PARAM(value);
+#endif // ASSERT_ENABLED
 }
 
 } // namespace Protocol
index f8d35f7..56feb25 100644 (file)
@@ -106,7 +106,7 @@ public:
 class JITOperationPrologueCallFrameTracer {
 public:
     ALWAYS_INLINE JITOperationPrologueCallFrameTracer(VM& vm, CallFrame* callFrame)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         : m_vm(vm)
 #endif
     {
@@ -116,7 +116,7 @@ public:
         ASSERT(reinterpret_cast<void*>(callFrame) < reinterpret_cast<void*>(vm.topEntryFrame));
         assertStackPointerIsAligned();
 #if USE(BUILTIN_FRAME_ADDRESS)
-        // If !ASSERT_DISABLED and USE(BUILTIN_FRAME_ADDRESS), prepareCallOperation() will put the frame pointer into vm.topCallFrame.
+        // If ASSERT_ENABLED and USE(BUILTIN_FRAME_ADDRESS), prepareCallOperation() will put the frame pointer into vm.topCallFrame.
         // We can ensure here that a call to prepareCallOperation() (or its equivalent) is not missing by comparing vm.topCallFrame to
         // the result of __builtin_frame_address which is passed in as callFrame.
         ASSERT(vm.topCallFrame == callFrame);
@@ -124,7 +124,7 @@ public:
 #endif
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     ~JITOperationPrologueCallFrameTracer()
     {
         // Fill vm.topCallFrame with invalid value when leaving from JIT operation functions.
index 8ef1c3d..e7e0e44 100644 (file)
@@ -335,7 +335,7 @@ Interpreter::Interpreter(VM& vm)
     , m_cloopStack(vm)
 #endif
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     static std::once_flag assertOnceKey;
     std::call_once(assertOnceKey, [] {
         for (unsigned i = 0; i < NUMBER_OF_BYTECODE_IDS; ++i) {
@@ -343,7 +343,7 @@ Interpreter::Interpreter(VM& vm)
             RELEASE_ASSERT(getOpcodeID(getOpcode(opcodeID)) == opcodeID);
         }
     });
-#endif // USE(LLINT_EMBEDDED_OPCODE_ID)
+#endif // ASSERT_ENABLED
 }
 
 Interpreter::~Interpreter()
@@ -351,7 +351,7 @@ Interpreter::~Interpreter()
 }
 
 #if ENABLE(COMPUTED_GOTO_OPCODES)
-#if !USE(LLINT_EMBEDDED_OPCODE_ID) || !ASSERT_DISABLED
+#if !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
 HashMap<Opcode, OpcodeID>& Interpreter::opcodeIDTable()
 {
     static NeverDestroyed<HashMap<Opcode, OpcodeID>> opcodeIDTable;
@@ -365,10 +365,10 @@ HashMap<Opcode, OpcodeID>& Interpreter::opcodeIDTable()
 
     return opcodeIDTable;
 }
-#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || !ASSERT_DISABLED
+#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
 #endif // ENABLE(COMPUTED_GOTO_OPCODES)
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 bool Interpreter::isOpcode(Opcode opcode)
 {
 #if ENABLE(COMPUTED_GOTO_OPCODES)
@@ -379,7 +379,7 @@ bool Interpreter::isOpcode(Opcode opcode)
     return opcode >= 0 && opcode <= op_end;
 #endif
 }
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 class GetStackTraceFunctor {
 public:
index ff1b4e8..e83f489 100644 (file)
@@ -100,7 +100,7 @@ namespace JSC {
 
         static inline OpcodeID getOpcodeID(Opcode);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         static bool isOpcode(Opcode);
 #endif
 
@@ -144,9 +144,9 @@ namespace JSC {
 #endif
         
 #if ENABLE(COMPUTED_GOTO_OPCODES)
-#if !USE(LLINT_EMBEDDED_OPCODE_ID) || !ASSERT_DISABLED
+#if !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
         static HashMap<Opcode, OpcodeID>& opcodeIDTable(); // Maps Opcode => OpcodeID.
-#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || !ASSERT_DISABLED
+#endif // !USE(LLINT_EMBEDDED_OPCODE_ID) || ASSERT_ENABLED
 #endif // ENABLE(COMPUTED_GOTO_OPCODES)
     };
 
index 9ee9163..eb8082e 100644 (file)
@@ -100,7 +100,7 @@ void AssemblyHelpers::clearSamplingFlag(int32_t flag)
 }
 #endif
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 #if USE(JSVALUE64)
 void AssemblyHelpers::jitAssertIsInt32(GPRReg gpr)
 {
@@ -216,7 +216,7 @@ void AssemblyHelpers::jitAssertArgumentCountSane()
     ok.link(this);
 }
 
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 void AssemblyHelpers::jitReleaseAssertNoException(VM& vm)
 {
@@ -315,7 +315,7 @@ void AssemblyHelpers::emitStoreStructureWithTypeInfo(AssemblyHelpers& jit, Trust
     const Structure* structurePtr = reinterpret_cast<const Structure*>(structure.m_value);
 #if USE(JSVALUE64)
     jit.store64(TrustedImm64(structurePtr->idBlob()), MacroAssembler::Address(dest, JSCell::structureIDOffset()));
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         Jump correctStructure = jit.branch32(Equal, MacroAssembler::Address(dest, JSCell::structureIDOffset()), TrustedImm32(structurePtr->id()));
         jit.abortWithReason(AHStructureIDIsValid);
         correctStructure.link(&jit);
index 24277bd..a3afdc4 100644 (file)
@@ -69,7 +69,7 @@ public:
     void prepareCallOperation(VM& vm)
     {
         UNUSED_PARAM(vm);
-#if !USE(BUILTIN_FRAME_ADDRESS) || !ASSERT_DISABLED
+#if !USE(BUILTIN_FRAME_ADDRESS) || ASSERT_ENABLED
         storePtr(GPRInfo::callFrameRegister, &vm.topCallFrame);
 #endif
     }
@@ -1277,7 +1277,7 @@ public:
     void debugCall(VM&, V_DebugOperation_EPP function, void* argument);
 
     // These methods JIT generate dynamic, debug-only checks - akin to ASSERTs.
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     void jitAssertIsInt32(GPRReg);
     void jitAssertIsJSInt32(GPRReg);
     void jitAssertIsJSNumber(GPRReg);
index 7a2bd90..f38a65d 100644 (file)
@@ -60,7 +60,7 @@ BinarySwitch::BinarySwitch(GPRReg value, const Vector<int64_t>& cases, Type type
     if (BinarySwitchInternal::verbose)
         dataLog("Sorted cases: ", listDump(m_cases), "\n");
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     for (unsigned i = 1; i < m_cases.size(); ++i)
         ASSERT(m_cases[i - 1] < m_cases[i], i, m_cases.size(), m_cases[i].value, m_cases[i].index);
 #endif
index 11fe37a..35d509b 100644 (file)
@@ -89,7 +89,7 @@ private:
     template<unsigned NumberOfRegisters, typename RegType>
     ALWAYS_INLINE void setupStubArgs(std::array<RegType, NumberOfRegisters> destinations, std::array<RegType, NumberOfRegisters> sources)
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             RegisterSet set;
             for (RegType dest : destinations)
                 set.set(dest);
@@ -104,7 +104,7 @@ private:
                 pairs.append(std::make_pair(sources[i], destinations[i]));
         }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         auto numUniqueSources = [&] () -> unsigned {
             RegisterSet set;
             for (auto& pair : pairs) {
index a2ea462..d8d06cf 100644 (file)
@@ -292,7 +292,7 @@ void CallFrameShuffler::spill(CachedRecovery& cachedRecovery)
 
 void CallFrameShuffler::emitDeltaCheck()
 {
-    if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED)
         return;
 
     GPRReg scratchGPR { getFreeGPR() };
@@ -725,7 +725,7 @@ void CallFrameShuffler::prepareAny()
     // stack, and written everything we had to to the stack.
     if (verbose)
         dataLog("  Callee frame is fully set up\n");
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         for (VirtualRegister reg = firstNew(); reg <= lastNew(); reg += 1)
             ASSERT_UNUSED(reg, !getNew(reg));
 
index efa78bc..724578d 100644 (file)
@@ -126,7 +126,7 @@ void JIT::emitNotifyWrite(GPRReg pointerToSet)
 
 void JIT::assertStackPointerOffset()
 {
-    if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED)
         return;
     
     addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, regT0);
@@ -770,7 +770,7 @@ void JIT::compileWithoutLinking(JITCompilationEffort effort)
         move(returnValueGPR, GPRInfo::argumentGPR0);
         emitNakedCall(m_vm->getCTIStub(arityFixupGenerator).retaggedCode<NoPtrTag>());
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_bytecodeIndex = BytecodeIndex(); // Reset this, in order to guard its use with ASSERTs.
 #endif
 
index 2795f97..9c82bb4 100644 (file)
@@ -1059,7 +1059,7 @@ void JIT::emitSlow_op_loop_hint(const Instruction* currentInstruction, Vector<Sl
 
         callOperation(operationOptimize, &vm(), m_bytecodeIndex.asBits());
         Jump noOptimizedEntry = branchTestPtr(Zero, returnValueGPR);
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             Jump ok = branchPtr(MacroAssembler::Above, returnValueGPR, TrustedImmPtr(bitwise_cast<void*>(static_cast<intptr_t>(1000))));
             abortWithReason(JITUnreasonableLoopHintJumpTarget);
             ok.link(this);
index e729fc0..abf52f7 100644 (file)
@@ -821,7 +821,7 @@ void JIT::emit_op_get_from_scope(const Instruction* currentInstruction)
             }));
 
             load32(operandSlot, offset);
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));
                 abortWithReason(JITOffsetIsNotOutOfLine);
                 isOutOfLine.link(this);
index 87d2699..b024b65 100644 (file)
@@ -840,7 +840,7 @@ void JIT::emit_op_get_from_scope(const Instruction* currentInstruction)
             
             move(regT0, base);
             load32(operandSlot, offset);
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));
                 abortWithReason(JITOffsetIsNotOutOfLine);
                 isOutOfLine.link(this);
index de3ee23..0726f4e 100644 (file)
@@ -1145,7 +1145,7 @@ void linkPolymorphicCall(JSGlobalObject* globalObject, CallFrame* callFrame, Cal
                 newCaseValue = bitwise_cast<intptr_t>(variant.internalFunction());
         }
 
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             if (caseValues.contains(newCaseValue)) {
                 dataLog("ERROR: Attempt to add duplicate case value.\n");
                 dataLog("Existing case values: ");
index f961f0e..71a4ac7 100644 (file)
@@ -48,7 +48,7 @@ namespace JSC {
 template<typename TagType>
 inline void emitPointerValidation(CCallHelpers& jit, GPRReg pointerGPR, TagType tag)
 {
-    if (ASSERT_DISABLED)
+    if (!ASSERT_ENABLED)
         return;
     CCallHelpers::Jump isNonZero = jit.branchTestPtr(CCallHelpers::NonZero, pointerGPR);
     jit.abortWithReason(TGInvalidPointer);
index f50a17b..39a5412 100644 (file)
@@ -139,7 +139,7 @@ void Data::performAssertions(VM& vm)
     ASSERT(!(reinterpret_cast<ptrdiff_t>((reinterpret_cast<WriteBarrier<JSCell>*>(0x4000)->slot())) - 0x4000));
 
     // FIXME: make these assertions less horrible.
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     Vector<int> testVector;
     testVector.resize(42);
     ASSERT(bitwise_cast<uint32_t*>(&testVector)[sizeof(void*)/sizeof(uint32_t) + 1] == 42);
index aa3ec34..52435a6 100644 (file)
 #define OFFLINE_ASM_ADDRESS64 0
 #endif
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 #define OFFLINE_ASM_ASSERT_ENABLED 1
 #else
 #define OFFLINE_ASM_ASSERT_ENABLED 0
index c691dac..c341f49 100644 (file)
@@ -905,7 +905,7 @@ template<typename CharacterType> inline void Lexer<CharacterType>::recordUnicode
     }
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 bool isSafeBuiltinIdentifier(VM& vm, const Identifier* ident)
 {
     if (!ident)
@@ -924,7 +924,7 @@ bool isSafeBuiltinIdentifier(VM& vm, const Identifier* ident)
         return false;
     return true;
 }
-#endif
+#endif // ASSERT_ENABLED
     
 template <>
 template <bool shouldCreateIdentifier> ALWAYS_INLINE JSTokenType Lexer<LChar>::parseIdentifier(JSTokenData* tokenData, OptionSet<LexerFlags> lexerFlags, bool strictMode)
index c7a14db..fd82580 100644 (file)
@@ -333,11 +333,11 @@ ALWAYS_INLINE const Identifier* Lexer<T>::makeLCharIdentifier(const UChar* chara
     return &m_arena->makeIdentifierLCharFromUChar(m_vm, characters, length);
 }
 
-#if ASSERT_DISABLED
-ALWAYS_INLINE bool isSafeBuiltinIdentifier(VM&, const Identifier*) { return true; }
-#else
+#if ASSERT_ENABLED
 bool isSafeBuiltinIdentifier(VM&, const Identifier*);
-#endif
+#else
+ALWAYS_INLINE bool isSafeBuiltinIdentifier(VM&, const Identifier*) { return true; }
+#endif // ASSERT_ENABLED
 
 template <typename T>
 ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSToken* tokenRecord, OptionSet<LexerFlags> lexerFlags, bool strictMode)
@@ -375,7 +375,7 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSToken* tokenRecord, Op
 
     // Create the identifier if needed
     if (lexerFlags.contains(LexerFlags::DontBuildKeywords)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         && !m_parsingBuiltinFunction
 #endif
         )
@@ -390,7 +390,7 @@ ALWAYS_INLINE JSTokenType Lexer<T>::lexExpectIdentifier(JSToken* tokenRecord, Op
     ASSERT(tokenLocation->startOffset >= tokenLocation->lineStartOffset);
     tokenRecord->m_startPosition = startPosition;
     tokenRecord->m_endPosition = currentPosition();
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     if (m_parsingBuiltinFunction) {
         if (!isSafeBuiltinIdentifier(m_vm, tokenData->ident))
             return ERRORTOK;
index 8f505cc..949b9b0 100644 (file)
@@ -165,15 +165,15 @@ private:
         return &slotFor(0);
     }
 
-#if ASSERT_DISABLED
-    void setNeedsOverflowCheck() { }
-    void clearNeedsOverflowCheck() { }
-#else
+#if ASSERT_ENABLED
     void setNeedsOverflowCheck() { m_needsOverflowCheck = true; }
     void clearNeedsOverflowCheck() { m_needsOverflowCheck = false; }
 
     bool m_needsOverflowCheck { false };
-#endif
+#else
+    void setNeedsOverflowCheck() { }
+    void clearNeedsOverflowCheck() { }
+#endif // ASSERT_ENABLED
     int m_size;
     int m_capacity;
     EncodedJSValue m_inlineBuffer[inlineCapacity];
index c05456a..49351c7 100644 (file)
@@ -43,7 +43,7 @@ struct ContiguousData {
     ContiguousData() = default;
     ContiguousData(T* data, size_t length)
         : m_data(data)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_length(length)
 #endif
     {
@@ -53,7 +53,7 @@ struct ContiguousData {
     struct Data {
         Data(T& location, IndexingType indexingMode)
             : m_data(location)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             , m_isWritable(!isCopyOnWrite(indexingMode))
 #endif
         {
@@ -103,7 +103,7 @@ struct ContiguousData {
 
 
         T& m_data;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         bool m_isWritable;
 #endif
     };
@@ -114,13 +114,13 @@ struct ContiguousData {
     T& atUnsafe(size_t index) { ASSERT(index < m_length); return m_data[index]; }
 
     T* data() const { return m_data; }
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     size_t length() const { return m_length; }
 #endif
 
 private:
     T* m_data { nullptr };
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     size_t m_length { 0 };
 #endif
 };
index d116d64..ec3feb6 100644 (file)
@@ -703,7 +703,7 @@ private:
 
     ALWAYS_INLINE void checkConsistency() const
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             HashMapBucketType* iter = m_head->next();
             HashMapBucketType* end = m_tail.get();
             uint32_t size = 0;
@@ -729,7 +729,7 @@ private:
 
     ALWAYS_INLINE void assertBufferIsEmpty() const
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             for (unsigned i = 0; i < m_capacity; i++)
                 ASSERT(isEmpty(buffer()[i]));
         }
index f6a32b2..2daf7bc 100644 (file)
@@ -292,7 +292,7 @@ ALWAYS_INLINE void JSCell::setStructure(VM& vm, Structure* structure)
 inline const MethodTable* JSCell::methodTable(VM& vm) const
 {
     Structure* structure = this->structure(vm);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     if (Structure* rootStructure = structure->structure(vm))
         ASSERT(rootStructure == rootStructure->structure(vm));
 #endif
index cb9345c..34e6585 100644 (file)
@@ -909,7 +909,7 @@ JSFunction::PropertyStatus JSFunction::reifyLazyBoundNameIfNeeded(VM& vm, JSGlob
     return PropertyStatus::Reified;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 void JSFunction::assertTypeInfoFlagInvariants()
 {
     // If you change this, you'll need to update speculationFromClassInfo.
@@ -919,6 +919,6 @@ void JSFunction::assertTypeInfoFlagInvariants()
     else
         RELEASE_ASSERT(info != JSBoundFunction::info());
 }
-#endif
+#endif // ASSERT_ENABLED
 
 } // namespace JSC
index 4892352..addde2a 100644 (file)
@@ -210,10 +210,10 @@ private:
     PropertyStatus reifyLazyNameIfNeeded(VM&, JSGlobalObject*, PropertyName);
     PropertyStatus reifyLazyBoundNameIfNeeded(VM&, JSGlobalObject*, PropertyName);
 
-#if ASSERT_DISABLED
-    void assertTypeInfoFlagInvariants() { }
-#else
+#if ASSERT_ENABLED
     void assertTypeInfoFlagInvariants();
+#else
+    void assertTypeInfoFlagInvariants() { }
 #endif
 
     friend class LLIntOffsetsExtractor;
index 247607c..58c1aee 100644 (file)
@@ -299,7 +299,7 @@ static EncodedJSValue JSC_HOST_CALL hasOwnLengthProperty(JSGlobalObject* globalO
     return JSValue::encode(jsBoolean(target->hasOwnProperty(globalObject, vm.propertyNames->length)));
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 static EncodedJSValue JSC_HOST_CALL assertCall(JSGlobalObject* globalObject, CallFrame* callFrame)
 {
     RELEASE_ASSERT(callFrame->argument(0).isBoolean());
@@ -325,7 +325,7 @@ static EncodedJSValue JSC_HOST_CALL assertCall(JSGlobalObject* globalObject, Cal
     RELEASE_ASSERT_WITH_MESSAGE(false, "JS assertion failed at line %u in:\n%s\n", line, codeBlock->sourceCodeForTools().data());
     return JSValue::encode(jsUndefined());
 }
-#endif
+#endif // ASSERT_ENABLED
 
 } // namespace JSC
 
@@ -1168,7 +1168,7 @@ capitalName ## Constructor* lowerName ## Constructor = featureFlag ? capitalName
         GlobalPropertyInfo(vm.propertyNames->NaN, jsNaN(), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->Infinity, jsNumber(std::numeric_limits<double>::infinity()), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
         GlobalPropertyInfo(vm.propertyNames->undefinedKeyword, jsUndefined(), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         GlobalPropertyInfo(vm.propertyNames->builtinNames().assertPrivateName(), JSFunction::create(vm, this, 1, String(), assertCall), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
 #endif
     };
index f30b93c..ce3df49 100644 (file)
@@ -511,7 +511,7 @@ public:
     ConsoleClient* m_consoleClient { nullptr };
     Optional<unsigned> m_stackTraceLimit;
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     const JSGlobalObject* m_globalObjectAtDebuggerEntry { nullptr };
 #endif
 
@@ -963,7 +963,7 @@ public:
         m_webAssemblyDisabledErrorMessage = errorMessage;
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     const JSGlobalObject* globalObjectAtDebuggerEntry() const { return m_globalObjectAtDebuggerEntry; }
     void setGlobalObjectAtDebuggerEntry(const JSGlobalObject* globalObject) { m_globalObjectAtDebuggerEntry = globalObject; }
 #endif
index b73b5d4..64f95e1 100644 (file)
@@ -436,7 +436,7 @@ void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     JSObject* thisObject = jsCast<JSObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool wasCheckingForDefaultMarkViolation = visitor.m_isCheckingForDefaultMarkViolation;
     visitor.m_isCheckingForDefaultMarkViolation = false;
 #endif
@@ -445,7 +445,7 @@ void JSObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
     
     thisObject->visitButterfly(visitor);
     
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
 #endif
 }
@@ -492,7 +492,7 @@ void JSFinalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
 {
     JSFinalObject* thisObject = jsCast<JSFinalObject*>(cell);
     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool wasCheckingForDefaultMarkViolation = visitor.m_isCheckingForDefaultMarkViolation;
     visitor.m_isCheckingForDefaultMarkViolation = false;
 #endif
@@ -504,7 +504,7 @@ void JSFinalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
             visitor.appendValuesHidden(thisObject->inlineStorage(), storageSize);
     }
     
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
 #endif
 }
index 06a714f..b241aea 100644 (file)
@@ -477,7 +477,7 @@ inline void JSObject::setIndexQuicklyForTypedArray(unsigned i, JSValue value)
     
 inline void JSObject::validatePutOwnDataProperty(VM& vm, PropertyName propertyName, JSValue value)
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     ASSERT(value);
     ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));
     unsigned attributes;
@@ -488,11 +488,11 @@ inline void JSObject::validatePutOwnDataProperty(VM& vm, PropertyName propertyNa
         if (auto entry = findPropertyHashEntry(vm, propertyName))
             ASSERT(!(entry->value->attributes() & (PropertyAttribute::Accessor | PropertyAttribute::CustomAccessor | PropertyAttribute::ReadOnly)));
     }
-#else
+#else // not ASSERT_ENABLED
     UNUSED_PARAM(vm);
     UNUSED_PARAM(propertyName);
     UNUSED_PARAM(value);
-#endif
+#endif // not ASSERT_ENABLED
 }
 
 inline bool JSObject::putOwnDataProperty(VM& vm, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
index 4dcfd07..31ee397 100644 (file)
@@ -77,7 +77,7 @@ public:
     
     WriteBarrier<Unknown>* assertVariableIsInThisObject(WriteBarrier<Unknown>* variablePointer)
     {
-        if (!ASSERT_DISABLED)
+        if (ASSERT_ENABLED)
             findVariableIndex(variablePointer);
         return variablePointer;
     }
index 50f1eca..6976f70 100644 (file)
@@ -438,7 +438,7 @@ static constexpr const TokenType TokenTypesOfLatin1Characters[256] = {
 template <typename CharType>
 ALWAYS_INLINE TokenType LiteralParser<CharType>::Lexer::lex(LiteralParserToken<CharType>& token)
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     m_currentTokenID++;
 #endif
 
index 93da4ad..670c9ae 100644 (file)
@@ -134,7 +134,7 @@ private:
         
         TokenType next();
         
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
         typedef const LiteralParserToken<CharType>* LiteralParserTokenPtr;
 
         LiteralParserTokenPtr currentToken()
@@ -167,7 +167,7 @@ private:
         {
             return LiteralParserTokenPtr(*this);
         }
-#endif
+#endif // ASSERT_ENABLED
         
         String getErrorMessage() { return m_lexErrorMessage; }
         
@@ -183,7 +183,7 @@ private:
         const CharType* m_ptr;
         const CharType* m_end;
         StringBuilder m_builder;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         unsigned m_currentTokenID { 0 };
 #endif
     };
index 2c365c4..4bbe23c 100644 (file)
@@ -501,7 +501,7 @@ ALWAYS_INLINE JSValue jsMul(JSGlobalObject* globalObject, JSValue v1, JSValue v2
 
 inline bool scribbleFreeCells()
 {
-    return !ASSERT_DISABLED || Options::scribbleFreeCells();
+    return ASSERT_ENABLED || Options::scribbleFreeCells();
 }
 
 #define SCRIBBLE_WORD static_cast<intptr_t>(0xbadbeef0)
index 03f2852..8acc27e 100644 (file)
@@ -221,8 +221,8 @@ constexpr bool enableWebAssemblyStreamingApi = false;
     v(Bool, b3AlwaysFailsBeforeCompile, false, Normal, nullptr) \
     v(Bool, b3AlwaysFailsBeforeLink, false, Normal, nullptr) \
     v(Bool, ftlCrashes, false, Normal, nullptr) /* fool-proof way of checking that you ended up in the FTL. ;-) */\
-    v(Bool, clobberAllRegsInFTLICSlowPath, !ASSERT_DISABLED, Normal, nullptr) \
-    v(Bool, enableJITDebugAssertions, !ASSERT_DISABLED, Normal, nullptr) \
+    v(Bool, clobberAllRegsInFTLICSlowPath, ASSERT_ENABLED, Normal, nullptr) \
+    v(Bool, enableJITDebugAssertions, ASSERT_ENABLED, Normal, nullptr) \
     v(Bool, useAccessInlining, true, Normal, nullptr) \
     v(Unsigned, maxAccessVariantListSize, 8, Normal, nullptr) \
     v(Bool, usePolyvariantDevirtualization, true, Normal, nullptr) \
index 52b7bbd..9c6c00c 100644 (file)
 namespace JSC {
 
 #if ENABLE(JIT)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 bool VM::s_canUseJITIsSet = false;
 #endif
 bool VM::s_canUseJIT = false;
@@ -271,7 +271,7 @@ bool VM::canUseAssembler()
 void VM::computeCanUseJIT()
 {
 #if ENABLE(JIT)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     RELEASE_ASSERT(!s_canUseJITIsSet);
     s_canUseJITIsSet = true;
 #endif
index c9ad516..abec994 100644 (file)
@@ -808,9 +808,7 @@ public:
     ALWAYS_INLINE static bool canUseJIT()
     {
 #if ENABLE(JIT)
-#if !ASSERT_DISABLED
-        RELEASE_ASSERT(s_canUseJITIsSet);
-#endif
+        ASSERT(s_canUseJITIsSet);
         return s_canUseJIT;
 #else
         return false;
@@ -1239,7 +1237,7 @@ private:
     uintptr_t m_currentWeakRefVersion { 0 };
 
 #if ENABLE(JIT)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     JS_EXPORT_PRIVATE static bool s_canUseJITIsSet;
 #endif
     JS_EXPORT_PRIVATE static bool s_canUseJIT;
index 5c894f1..2002f9d 100644 (file)
@@ -169,7 +169,7 @@ public:
     
     void checkSanity() const
     {
-        if (ASSERT_DISABLED)
+        if (!ASSERT_ENABLED)
             return;
         
         switch (m_kind) {
index 9946d5d..db81639 100644 (file)
@@ -444,7 +444,7 @@ private:
 
     ALWAYS_INLINE void checkConsistency() const
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             uint32_t size = 0;
             auto* buffer = this->buffer();
             for (uint32_t index = 0; index < m_capacity; ++index) {
@@ -469,7 +469,7 @@ private:
 
     ALWAYS_INLINE void assertBufferIsEmpty() const
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             for (unsigned i = 0; i < m_capacity; i++)
                 ASSERT((buffer() + i)->isEmpty());
         }
index 59b8bf2..27201e8 100644 (file)
@@ -331,7 +331,7 @@ private:
     B3::Type toB3ResultType(BlockSignature returnType);
     ALWAYS_INLINE void validateInst(Inst& inst)
     {
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             if (!inst.isValidForm()) {
                 dataLogLn("Inst validation failed:");
                 dataLogLn(inst, "\n");
index a118fbf..c79f498 100644 (file)
@@ -1993,7 +1993,7 @@ Expected<std::unique_ptr<InternalFunction>, String> parseAndCompile(CompilationC
     irGenerator.insertConstants();
 
     procedure.resetReachability();
-    if (!ASSERT_DISABLED)
+    if (ASSERT_ENABLED)
         validate(procedure, "After parsing:\n");
 
     dataLogIf(WasmB3IRGeneratorInternal::verbose, "Pre SSA: ", procedure);
index 1f7e06a..723a033 100644 (file)
@@ -133,7 +133,7 @@ private:
     NEVER_INLINE UnexpectedResult WARN_UNUSED_RETURN validationFail(const Args&... args) const
     {
         using namespace FailureHelper; // See ADL comment in WasmParser.h.
-        if (UNLIKELY(!ASSERT_DISABLED && Options::crashOnFailedWebAssemblyValidate()))
+        if (UNLIKELY(ASSERT_ENABLED && Options::crashOnFailedWebAssemblyValidate()))
             WTFBreakpointTrap();
 
         StringPrintStream out;
index ab80f6f..579d27b 100644 (file)
@@ -341,7 +341,7 @@ private:
 
     void checkConsistency()
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         // The rules for locals and constants in the stack are:
         // 1) Locals have to be materialized whenever a control entry is pushed to the control stack (i.e. every time we splitStack)
         //    NOTE: This is a trade-off so that set_local does not have to walk up the control stack looking for delayed get_locals
@@ -357,7 +357,7 @@ private:
         walkExpressionStack(m_parser->expressionStack(), [&](VirtualRegister expression, VirtualRegister slot) {
             ASSERT(expression == slot || expression.isConstant() || expression.isArgument() || expression.toLocal() < m_codeBlock->m_numVars);
         });
-#endif
+#endif // ASSERT_ENABLED
     }
 
     void materializeConstantsAndLocals(Stack& expressionStack)
index 3565f76..fd45bad 100644 (file)
@@ -89,7 +89,7 @@ bool Plan::tryRemoveContextAndCancelIfLast(Context& context)
 {
     LockHolder locker(m_lock);
 
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         // We allow the first completion task to not have a Context.
         for (unsigned i = 1; i < m_completionTasks.size(); ++i)
             ASSERT(m_completionTasks[i].first);
index 4833714..5277a7a 100644 (file)
@@ -54,7 +54,7 @@ private:
     NEVER_INLINE UnexpectedResult WARN_UNUSED_RETURN fail(Args... args) const
     {
         using namespace FailureHelper; // See ADL comment in namespace above.
-        if (UNLIKELY(!ASSERT_DISABLED && Options::crashOnFailedWebAssemblyValidate()))
+        if (UNLIKELY(ASSERT_ENABLED && Options::crashOnFailedWebAssemblyValidate()))
             CRASH();
 
         return UnexpectedResult(makeString("WebAssembly.Module doesn't parse at byte "_s, String::number(m_offset + m_offsetInSource), ": "_s, makeString(args)...));
index b097d14..b88ee74 100644 (file)
@@ -27,7 +27,7 @@
 
 #if ENABLE(WEBASSEMBLY)
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_BEGIN
 #endif
 
@@ -106,7 +106,7 @@ inline const char* makeString(Section section)
 
 } } // namespace JSC::Wasm
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 IGNORE_RETURN_TYPE_WARNINGS_END
 #endif
 
index 510ac3e..dee6f7a 100644 (file)
@@ -48,7 +48,7 @@ inline const Signature& SignatureInformation::get(SignatureIndex index)
 
 inline SignatureIndex SignatureInformation::get(const Signature& signature)
 {
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         SignatureInformation& info = singleton();
         auto locker = holdLock(info.m_lock);
         ASSERT_UNUSED(info, info.m_signatureSet.contains(SignatureHash { makeRef(const_cast<Signature&>(signature)) }));
index fa716e2..4b596d1 100644 (file)
@@ -146,7 +146,7 @@ void Worklist::enqueue(Ref<Plan> plan)
 {
     LockHolder locker(*m_lock);
 
-    if (!ASSERT_DISABLED) {
+    if (ASSERT_ENABLED) {
         for (const auto& element : m_queue)
             ASSERT_UNUSED(element, element.plan.get() != &plan.get());
     }
index 2587740..016ae53 100644 (file)
@@ -143,7 +143,7 @@ std::unique_ptr<InternalFunction> createJSToWasmWrapper(CCallHelpers& jit, const
     const PinnedRegisterInfo& pinnedRegs = PinnedRegisterInfo::get();
     RegisterSet toSave = pinnedRegs.toSave(mode);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     unsigned toSaveSize = toSave.numberOfSetGPRs();
     // They should all be callee saves.
     toSave.filter(RegisterSet::calleeSaveRegisters());
index c3949c8..44f99be 100644 (file)
@@ -173,7 +173,7 @@ ptrdiff_t WebAssemblyFunction::previousInstanceOffset() const
 {
     ptrdiff_t result = calleeSaves().numberOfSetRegisters() * sizeof(CPURegister);
     result = -result - sizeof(CPURegister);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     ptrdiff_t minOffset = 1;
     for (const RegisterAtOffset& regAtOffset : usedCalleeSaveRegisters()) {
         ptrdiff_t offset = regAtOffset.offset();
index e7a46f1..e8052d2 100644 (file)
@@ -1,3 +1,94 @@
+2020-01-06  Mark Lam  <mark.lam@apple.com>
+
+        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:
+
 2020-01-05  Dean Jackson  <dino@apple.com>
 
         Rename GraphicsContext3D to GraphicsContextGL
index 7a6b75b..beb0853 100644 (file)
@@ -64,39 +64,30 @@ extern "C" void _ReadWriteBarrier(void);
 #endif
 #endif
 
-#ifdef NDEBUG
-/* Disable ASSERT* macros in release mode. */
-#define ASSERTIONS_DISABLED_DEFAULT 1
-#else
-#define ASSERTIONS_DISABLED_DEFAULT 0
-#endif
+/* ASSERT_ENABLED is defined in Platform.h. */
 
 #ifndef BACKTRACE_DISABLED
-#define BACKTRACE_DISABLED ASSERTIONS_DISABLED_DEFAULT
-#endif
-
-#ifndef ASSERT_DISABLED
-#define ASSERT_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define BACKTRACE_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ASSERT_MSG_DISABLED
-#define ASSERT_MSG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_MSG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ASSERT_ARG_DISABLED
-#define ASSERT_ARG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ASSERT_ARG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef FATAL_DISABLED
-#define FATAL_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define FATAL_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef ERROR_DISABLED
-#define ERROR_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define ERROR_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef LOG_DISABLED
-#define LOG_DISABLED ASSERTIONS_DISABLED_DEFAULT
+#define LOG_DISABLED !ASSERT_ENABLED
 #endif
 
 #ifndef RELEASE_LOG_DISABLED
@@ -302,7 +293,7 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v
 #undef ASSERT
 #endif
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 
 #define ASSERT(assertion, ...) ((void)0)
 #define ASSERT_UNDER_CONSTEXPR_CONTEXT(assertion) ((void)0)
@@ -322,12 +313,12 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v
         (void)0)
 
 #define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0
-#else
+#else /* not ENABLE(SECURITY_ASSERTIONS) */
 #define ASSERT_WITH_SECURITY_IMPLICATION(assertion) ((void)0)
 #define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 1
-#endif
+#endif /* ENABLE(SECURITY_ASSERTIONS) */
 
-#else
+#else /* ASSERT_ENABLED */
 
 #define ASSERT(assertion, ...) do { \
     if (!(assertion)) { \
@@ -385,7 +376,8 @@ WTF_EXPORT_PRIVATE NO_RETURN_DUE_TO_CRASH void WTFCrashWithSecurityImplication(v
          CRASH_WITH_SECURITY_IMPLICATION()) : \
         (void)0)
 #define ASSERT_WITH_SECURITY_IMPLICATION_DISABLED 0
-#endif
+
+#endif /* ASSERT_ENABLED */
 
 /* ASSERT_WITH_MESSAGE */
 
@@ -531,7 +523,8 @@ constexpr bool assertionFailureDueToUnreachableCode = false;
 
 /* RELEASE_ASSERT */
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
+
 #define RELEASE_ASSERT(assertion, ...) do { \
     if (UNLIKELY(!(assertion))) \
         CRASH_WITH_INFO(__VA_ARGS__); \
@@ -544,13 +537,16 @@ constexpr bool assertionFailureDueToUnreachableCode = false;
         CRASH_UNDER_CONSTEXPR_CONTEXT(); \
     } \
 } while (0)
-#else
+
+#else /* ASSERT_ENABLED */
+
 #define RELEASE_ASSERT(assertion, ...) ASSERT(assertion, __VA_ARGS__)
 #define RELEASE_ASSERT_WITH_MESSAGE(assertion, ...) ASSERT_WITH_MESSAGE(assertion, __VA_ARGS__)
 #define RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(assertion) ASSERT_WITH_SECURITY_IMPLICATION(assertion)
 #define RELEASE_ASSERT_NOT_REACHED() ASSERT_NOT_REACHED()
 #define RELEASE_ASSERT_UNDER_CONSTEXPR_CONTEXT(assertion) ASSERT_UNDER_CONSTEXPR_CONTEXT(assertion)
-#endif
+
+#endif /* ASSERT_ENABLED */
 
 #ifdef __cplusplus
 #define RELEASE_ASSERT_NOT_REACHED_WITH_MESSAGE(...) RELEASE_ASSERT_WITH_MESSAGE(assertionFailureDueToUnreachableCode, __VA_ARGS__)
index 74d881a..de06405 100644 (file)
@@ -171,7 +171,7 @@ void AutomaticThread::start(const AbstractLocker&)
             RefPtr<AutomaticThread> thread = preserveThisForThread;
             thread->threadDidStart();
             
-            if (!ASSERT_DISABLED) {
+            if (ASSERT_ENABLED) {
                 LockHolder locker(*m_lock);
                 ASSERT(m_condition->contains(locker, this));
             }
index 6f10d89..3e61348 100644 (file)
@@ -247,7 +247,7 @@ public:
     size_t findBit(size_t index, bool value) const
     {
         size_t result = findBitFast(index, value);
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             size_t expectedResult = findBitSimple(index, value);
             if (result != expectedResult) {
                 dataLog("findBit(", index, ", ", value, ") on ", *this, " should have gotten ", expectedResult, " but got ", result, "\n");
index 031b65d..13d8a1e 100644 (file)
@@ -33,7 +33,7 @@ void ReportBlockedObjCException(NSException *exception)
     // FIXME: This is probably going to be confusing when JavaScriptCore is used standalone. JSC
     // will call this code as part of default locale detection.
     // https://bugs.webkit.org/show_bug.cgi?id=157804
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
     NSLog(@"*** WebKit discarding exception: <%@> %@", [exception name], [exception reason]);
 #else
     ASSERT_WITH_MESSAGE(0, "Uncaught exception - %@", exception);
index 9324dbf..b06a1eb 100644 (file)
@@ -182,7 +182,7 @@ public:
     bool mayContain(const AtomString& string) const { return mayContain(string.impl()->existingHash()); }
     bool mayContain(const String& string) const { return mayContain(string.impl()->hash()); }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     // Slow.
     bool likelyEmpty() const;
     bool isClear() const;
@@ -236,7 +236,7 @@ inline void CountingBloomFilter<keyBits>::clear()
     m_buckets.fill(0);
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 template <unsigned keyBits>
 bool CountingBloomFilter<keyBits>::likelyEmpty() const
 {
@@ -256,9 +256,9 @@ bool CountingBloomFilter<keyBits>::isClear() const
     }
     return true;
 }
-#endif
+#endif // ASSERT_ENABLED
 
-}
+} // namespace WTF
 
 using WTF::BloomFilter;
 using WTF::CountingBloomFilter;
index 5ffe1d9..75a18ab 100644 (file)
@@ -45,14 +45,14 @@ public:
 private:
     explicit CallbackAggregator(CompletionHandler<void()>&& callback)
         : m_callback(WTFMove(callback))
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_wasConstructedOnMainThread(isMainThread())
 #endif
     {
     }
 
     CompletionHandler<void()> m_callback;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_wasConstructedOnMainThread;
 #endif
 };
index c3900b6..5d88d39 100644 (file)
@@ -545,7 +545,7 @@ template <class OverflowHandler, typename = std::enable_if_t<!std::is_scalar<Ove
 inline constexpr bool observesOverflow() { return true; }
 
 template <>
-inline constexpr bool observesOverflow<AssertNoOverflow>() { return !ASSERT_DISABLED; }
+inline constexpr bool observesOverflow<AssertNoOverflow>() { return ASSERT_ENABLED; }
 
 template <typename U, typename V, typename R> static inline bool safeAdd(U lhs, V rhs, R& result)
 {
index 5f0acea..4cb14e3 100644 (file)
@@ -30,7 +30,7 @@
 class CheckedBoolean {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     CheckedBoolean(const CheckedBoolean& other)
         : m_value(other.m_value)
         , m_checked(false)
@@ -41,7 +41,7 @@ public:
 
     CheckedBoolean(bool value)
         : m_value(value)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_checked(false)
 #endif
     {
@@ -54,7 +54,7 @@ public:
     
     operator bool()
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_checked = true;
 #endif
         return m_value;
@@ -62,7 +62,7 @@ public:
     
 private:
     bool m_value;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     mutable bool m_checked;
 #endif
 };
index 0276a24..938b496 100644 (file)
@@ -64,7 +64,7 @@ public:
 
 private:
     Function<Out(In...)> m_function;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_wasConstructedOnMainThread { isMainThread() };
 #endif
 };
index 106257e..2473278 100644 (file)
@@ -377,7 +377,7 @@ LocalTimeOffset calculateLocalTimeOffset(double ms, TimeType inputTimeType)
 
 void initializeDates()
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     static bool alreadyInitialized;
     ASSERT(!alreadyInitialized);
     alreadyInitialized = true;
index 6952cad..0574754 100644 (file)
@@ -49,7 +49,7 @@ void* tryAllocateZeroedVirtualPages(Kind, size_t requestedSize)
     size_t size = roundUpToMultipleOf(WTF::pageSize(), requestedSize);
     RELEASE_ASSERT(size >= requestedSize);
     void* result = OSAllocator::reserveAndCommit(size);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     if (result) {
         for (size_t i = 0; i < size / sizeof(uintptr_t); ++i)
             ASSERT(static_cast<uintptr_t*>(result)[i] == 0);
index 4c282e6..0a0ab01 100644 (file)
@@ -453,7 +453,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         template<typename HashTranslator, typename T> ValueType* lookup(const T&);
         template<typename HashTranslator, typename T> ValueType* inlineLookup(const T&);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistency() const;
 #else
         static void checkTableConsistency() { }
@@ -509,7 +509,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         iterator makeKnownGoodIterator(ValueType* pos) { return iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
         const_iterator makeKnownGoodConstIterator(ValueType* pos) const { return const_iterator(this, pos, m_table + m_tableSize, HashItemKnownGood); }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void checkTableConsistencyExceptSize() const;
 #else
         static void checkTableConsistencyExceptSize() { }
@@ -609,7 +609,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         return key;
     }
 
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     template<typename HashTranslator, typename T>
@@ -617,7 +617,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
     {
     }
 
-#else
+#else // ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     template<typename HashTranslator, typename T>
@@ -633,7 +633,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         ASSERT(!HashTranslator::equal(Extractor::extract(deletedValue), key));
     }
 
-#endif
+#endif // ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     template<typename HashTranslator, typename T>
@@ -1417,7 +1417,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         return *this;
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 
     template<typename Key, typename Value, typename Extractor, typename HashFunctions, typename Traits, typename KeyTraits>
     void HashTable<Key, Value, Extractor, HashFunctions, Traits, KeyTraits>::checkTableConsistency() const
@@ -1460,7 +1460,7 @@ DECLARE_ALLOCATOR_WITH_HEAP_IDENTIFIER(HashTable);
         ASSERT(m_tableSize == m_tableSizeMask + 1);
     }
 
-#endif // ASSERT_DISABLED
+#endif // ASSERT_ENABLED
 
 #if CHECK_HASHTABLE_ITERATORS
 
index 66c4272..4c869fd 100644 (file)
@@ -69,7 +69,7 @@ public:
         static uint64_t lowWord = cryptographicallyRandomNumber();
         return reinterpret_cast<const void*>((highWord << 32) + lowWord);
     }
-#else
+#else // RELEASE_LOG_DISABLED
 
 #define LOGIDENTIFIER (WTF::nullopt)
 
@@ -88,8 +88,8 @@ public:
 #define INFO_LOG_IF(condition, ...)       ((void)0)
 #define DEBUG_LOG_IF(condition, ...)      ((void)0)
 
-#endif
-    
+#endif // RELEASE_LOG_DISABLED
+
 };
 
 } // namespace WTF
index 7da0f84..9ed765b 100644 (file)
@@ -287,7 +287,7 @@ public:
             return nullptr;
         if (loop->header() == block)
             return loop;
-        if (!ASSERT_DISABLED) {
+        if (ASSERT_ENABLED) {
             for (; loop; loop = innerMostOuterLoop(*loop))
                 ASSERT(loop->header() != block);
         }
index e0e4677..b9c915a 100644 (file)
@@ -100,7 +100,7 @@ public:
     {
         ASSERT(!m_isConstructed);
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_isConstructed = true;
 #endif
 
@@ -117,7 +117,7 @@ public:
 
     const T* operator->() const { return storagePointer(); }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool isConstructed() const { return m_isConstructed; }
 #endif
 
@@ -137,7 +137,7 @@ private:
         explicit MaybeRelax(PtrType* ptr) { ptr->relaxAdoptionRequirement(); }
     };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     // LazyNeverDestroyed objects are always static, so this variable is initialized to false.
     // It must not be initialized dynamically; that would not be thread safe.
     bool m_isConstructed;
index 3a6e781..70cb9ec 100644 (file)
@@ -79,13 +79,19 @@ public:
     constexpr OptionSet(T t)
         : m_storage(static_cast<StorageType>(t))
     {
+#ifndef NDEBUG
+        // This assertion will conflict with the constexpr attribute if we enable it on NDEBUG builds.
         ASSERT_WITH_MESSAGE(!m_storage || hasOneBitSet(m_storage), "Enumerator is not a zero or a positive power of two.");
+#endif
     }
 
     constexpr OptionSet(std::initializer_list<T> initializerList)
     {
         for (auto& option : initializerList) {
+#ifndef NDEBUG
+            // This assertion will conflict with the constexpr attribute if we enable it on NDEBUG builds.
             ASSERT_WITH_MESSAGE(hasOneBitSet(static_cast<StorageType>(option)), "Enumerator is not a positive power of two.");
+#endif
             m_storage |= static_cast<StorageType>(option);
         }
     }
index 27b0f4f..45e1761 100644 (file)
 #endif
 #endif
 
-#ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION
+/* ASSERT_ENABLED should be true if we want the current compilation unit to
+   do debug assertion checks unconditionally (e.g. treat a debug ASSERT
+   like a RELEASE_ASSERT.
+*/
+#ifndef ASSERT_ENABLED
 #ifdef NDEBUG
-#define ENABLE_EXCEPTION_SCOPE_VERIFICATION 0
+#define ASSERT_ENABLED 0
 #else
-#define ENABLE_EXCEPTION_SCOPE_VERIFICATION 1
+#define ASSERT_ENABLED 1
+#endif
 #endif
+
+#ifndef ENABLE_EXCEPTION_SCOPE_VERIFICATION
+#define ENABLE_EXCEPTION_SCOPE_VERIFICATION ASSERT_ENABLED
 #endif
 
 #if ENABLE(DFG_JIT) && HAVE(MACHINE_CONTEXT) && (CPU(X86_64) || CPU(ARM64))
index 70704be..a65bb7c 100644 (file)
@@ -103,10 +103,10 @@ constexpr PtrTag AnyPtrTag = static_cast<PtrTag>(-1); // Only used for assertion
 WTF_EXPORT_PRIVATE void registerPtrTagLookup(PtrTagLookup*);
 WTF_EXPORT_PRIVATE void reportBadTag(const void*, PtrTag expectedTag);
 
-#if ASSERT_DISABLED
-constexpr bool enablePtrTagDebugAssert = false;
-#else
+#if ASSERT_ENABLED
 constexpr bool enablePtrTagDebugAssert = true;
+#else
+constexpr bool enablePtrTagDebugAssert = false;
 #endif
 
 #define WTF_PTRTAG_ASSERT(action, ptr, expectedTag, assertion) \
index 9416e37..caa33d7 100644 (file)
 
 namespace WTF {
 
-#if defined(NDEBUG) && !ENABLE(SECURITY_ASSERTIONS)
-#define CHECK_REF_COUNTED_LIFECYCLE 0
-#else
+#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
 #define CHECK_REF_COUNTED_LIFECYCLE 1
+#else
+#define CHECK_REF_COUNTED_LIFECYCLE 0
 #endif
 
 // This base class holds the non-template methods and attributes.
@@ -75,14 +75,14 @@ public:
     // locking at call sites).
     void disableThreadingChecks()
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         m_areThreadingChecksEnabled = false;
 #endif
     }
 
     static void enableThreadingChecksGlobally()
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         areThreadingChecksEnabledGlobally = true;
 #endif
     }
@@ -90,7 +90,7 @@ public:
 protected:
     RefCountedBase()
         : m_refCount(1)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_isOwnedByMainThread(isMainThread())
 #endif
 #if CHECK_REF_COUNTED_LIFECYCLE
@@ -102,7 +102,7 @@ protected:
 
     void applyRefDerefThreadingCheck() const
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         if (hasOneRef()) {
             // Likely an ownership transfer across threads that may be safe.
             m_isOwnedByMainThread = isMainThread();
@@ -160,7 +160,7 @@ private:
 #endif
 
     mutable unsigned m_refCount;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     mutable bool m_isOwnedByMainThread;
     bool m_areThreadingChecksEnabled { true };
 #endif
index d919135..1311078 100644 (file)
@@ -285,7 +285,7 @@ public:
 private:
     ALWAYS_INLINE void assertIsConsistent() const
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         // We expect the roots() function to be idempotent while we're alive so we can cache
         // the result in the constructor. If a user of this changes the result of its roots()
         // function, it's expected that the user will create a new instance of this class.
index 67fa62e..0bebbc2 100644 (file)
@@ -40,7 +40,7 @@
 
 namespace WTF {
 
-#if !defined(NDEBUG) || ENABLE(SECURITY_ASSERTIONS)
+#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
 struct SameSizeAsRefCounted {
     int a;
     bool b;
index a63b0bd..75c7049 100644 (file)
@@ -128,7 +128,7 @@ private:
 
     void checkConsistency() const
     {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         void* currentPosition = currentStackPointer();
         ASSERT(m_origin != m_bound);
         ASSERT(currentPosition < m_origin && currentPosition > m_bound);
index 59045fc..e9ad1b9 100644 (file)
@@ -1148,7 +1148,7 @@ URLParser::URLParser(const String& input, const URL& base, const URLTextEncoding
         || (input.isAllSpecialCharacters<isC0ControlOrSpace>()
             && m_url.m_string == base.m_string.left(base.m_queryEnd)));
     ASSERT(internalValuesConsistent(m_url));
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     if (!m_didSeeSyntaxViolation) {
         // Force a syntax violation at the beginning to make sure we get the same result.
         URLParser parser(makeString(" ", input), base, nonUTF8QueryEncoding);
@@ -1156,7 +1156,7 @@ URLParser::URLParser(const String& input, const URL& base, const URLTextEncoding
         if (parsed.isValid())
             ASSERT(allValuesEqual(parser.result(), m_url));
     }
-#endif
+#endif // ASSERT_ENABLED
 }
 
 template<typename CharacterType>
@@ -2548,14 +2548,14 @@ template<typename CharacterType> Optional<URLParser::LCharBuffer> URLParser::dom
     int32_t numCharactersConverted = uidna_nameToASCII(&internationalDomainNameTranscoder(), StringView(domain).upconvertedCharacters(), domain.length(), hostnameBuffer, maxDomainLength, &processingDetails, &error);
 
     if (U_SUCCESS(error) && !processingDetails.errors) {
-#if ASSERT_DISABLED
-        UNUSED_PARAM(numCharactersConverted);
-#else
+#if ASSERT_ENABLED
         for (int32_t i = 0; i < numCharactersConverted; ++i) {
             ASSERT(isASCII(hostnameBuffer[i]));
             ASSERT(!isASCIIUpper(hostnameBuffer[i]));
         }
-#endif
+#else
+        UNUSED_PARAM(numCharactersConverted);
+#endif // ASSERT_ENABLED
         ascii.append(hostnameBuffer, numCharactersConverted);
         if (domain != StringView(ascii.data(), ascii.size()))
             syntaxViolation(iteratorForSyntaxViolationPosition);
index b425f3a..26eaa53 100644 (file)
@@ -34,7 +34,7 @@ template<typename T> struct ValueCheck {
     static void checkConsistency(const T&) { }
 };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 template<typename P> struct ValueCheck<P*> {
     typedef P* TraitType;
     static void checkConsistency(const P* p)
@@ -45,6 +45,6 @@ template<typename P> struct ValueCheck<P*> {
         ValueCheck<P>::checkConsistency(*p);
     }
 };
-#endif
+#endif // ASSERT_ENABLED
 
 }
index 9dd4b41..97763e0 100644 (file)
@@ -1598,7 +1598,7 @@ inline MallocPtr<T, Malloc> Vector<T, inlineCapacity, OverflowHandler, minCapaci
 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity, typename Malloc>
 inline void Vector<T, inlineCapacity, OverflowHandler, minCapacity, Malloc>::checkConsistency()
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     for (size_t i = 0; i < size(); ++i)
         ValueCheck<T>::checkConsistency(at(i));
 #endif
@@ -1625,7 +1625,7 @@ inline bool operator!=(const Vector<T, inlineCapacityA, OverflowHandlerA, minCap
     return !(a == b);
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 template<typename T> struct ValueCheck<Vector<T>> {
     typedef Vector<T> TraitType;
     static void checkConsistency(const Vector<T>& v)
@@ -1633,7 +1633,7 @@ template<typename T> struct ValueCheck<Vector<T>> {
         v.checkConsistency();
     }
 };
-#endif
+#endif // ASSERT_ENABLED
 
 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity, typename Malloc>
 template<typename U>
index 6bc1e2a..c00368c 100644 (file)
@@ -138,10 +138,10 @@ public:
         return m_set.size();
     }
 
-#if ASSERT_DISABLED
-    void checkConsistency() const { }
-#else
+#if ASSERT_ENABLED
     void checkConsistency() const { m_set.checkConsistency(); }
+#else
+    void checkConsistency() const { }
 #endif
 
 private:
index a224fc3..d11857c 100644 (file)
@@ -68,14 +68,14 @@ public:
     explicit operator bool() const { return m_ptr; }
     void clear() { m_ptr = nullptr; }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool wasConstructedOnMainThread() const { return m_wasConstructedOnMainThread; }
 #endif
 
 private:
     template<typename T> explicit WeakPtrImpl(T* ptr)
         : m_ptr(static_cast<typename T::WeakValueType*>(ptr))
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         , m_wasConstructedOnMainThread(isMainThread())
 #endif
     {
@@ -83,7 +83,7 @@ private:
     }
 
     void* m_ptr;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_wasConstructedOnMainThread;
 #endif
 };
@@ -141,7 +141,7 @@ class WeakPtrFactory {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     WeakPtrFactory()
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
         : m_wasConstructedOnMainThread(isMainThread())
 #endif
     {
@@ -192,7 +192,7 @@ private:
     template<typename> friend class WeakHashSet;
 
     mutable RefPtr<WeakPtrImpl> m_impl;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     bool m_wasConstructedOnMainThread;
 #endif
 };
index bfb69d3..ad22234 100644 (file)
@@ -542,7 +542,7 @@ RefPtr<AtomStringImpl> AtomStringImpl::lookUp(const UChar* characters, unsigned
     return nullptr;
 }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 bool AtomStringImpl::isInAtomStringTable(StringImpl* string)
 {
     AtomStringTableLocker locker;
index b134247..8b99ba2 100644 (file)
@@ -70,7 +70,7 @@ public:
         return add(*stringTableProvider.atomStringTable(), *string);
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     WTF_EXPORT_PRIVATE static bool isInAtomStringTable(StringImpl*);
 #endif
 
@@ -101,7 +101,7 @@ private:
     WTF_EXPORT_PRIVATE static RefPtr<AtomStringImpl> lookUpSlowCase(StringImpl&);
 };
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
 
 // AtomStringImpls created from StaticStringImpl will ASSERT in the generic ValueCheck<T>::checkConsistency,
 // as they are not allocated by fastMalloc. We don't currently have any way to detect that case, so we don't
@@ -115,7 +115,7 @@ template<> struct ValueCheck<const AtomStringImpl*> {
     static void checkConsistency(const AtomStringImpl*) { }
 };
 
-#endif
+#endif // ASSERT_ENABLED
 
 }
 
index e6790ca..2a42060 100644 (file)
@@ -50,7 +50,7 @@ void StringBuilder::reifyString() const
         return;
     }
 
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     m_isReified = true;
 #endif
 
index 8f00ed6..782c9ce 100644 (file)
@@ -370,7 +370,7 @@ private:
     static_assert(String::MaxLength == std::numeric_limits<int32_t>::max(), "");
     Checked<int32_t, ConditionalCrashOnOverflow> m_length;
     bool m_is8Bit { true };
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     mutable bool m_isReified { false };
 #endif
 };
index 25527a6..811320f 100644 (file)
@@ -612,7 +612,7 @@ template<typename CharacterType, unsigned lowercaseLettersLength> inline bool eq
 
 template<typename StringClass> bool inline hasPrefixWithLettersIgnoringASCIICaseCommon(const StringClass& string, const char* lowercaseLetters, unsigned length)
 {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
     ASSERT(*lowercaseLetters);
     for (const char* letter = lowercaseLetters; *letter; ++letter)
         ASSERT(toASCIILowerUnchecked(*letter) == *letter);
index b958004..a5dd8d8 100644 (file)
@@ -77,12 +77,12 @@ public:
     void addCharacters(UChar a, UChar b)
     {
         if (m_hasPendingCharacter) {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             m_hasPendingCharacter = false;
 #endif
             addCharactersAssumingAligned(m_pendingCharacter, a);
             m_pendingCharacter = b;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
             m_hasPendingCharacter = true;
 #endif
             return;
diff --git