PerformanceTests:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* JetStream2/wasm/HashSet.cpp:
* StitchMarker/wtf/Assertions.h:
* StitchMarker/wtf/DateMath.cpp:
(WTF::initializeDates):
* StitchMarker/wtf/HashTable.h:
* StitchMarker/wtf/Hasher.h:
(WTF::StringHasher::addCharacters):
* StitchMarker/wtf/NeverDestroyed.h:
(WTF::LazyNeverDestroyed::construct):
* StitchMarker/wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
* StitchMarker/wtf/ValueCheck.h:
* StitchMarker/wtf/Vector.h:
(WTF::minCapacity>::checkConsistency):
* StitchMarker/wtf/text/AtomicStringImpl.cpp:
* StitchMarker/wtf/text/AtomicStringImpl.h:
* StitchMarker/wtf/text/StringCommon.h:
(WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
* StitchMarker/wtf/text/StringImpl.h:
* StitchMarker/wtf/text/SymbolImpl.h:
* StitchMarker/wtf/text/UniquedStringImpl.h:
Source/JavaScriptCore:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* API/tests/testapi.c:
* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::replaceWithLoad):
(JSC::ARM64Assembler::replaceWithAddressComputation):
* assembler/AssemblerBuffer.h:
(JSC::AssemblerBuffer::LocalWriter::LocalWriter):
* assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::copyCompactAndLinkCode):
* assembler/ProbeStack.cpp:
(JSC::Probe::Stack::Stack):
* assembler/ProbeStack.h:
* b3/B3FoldPathConstants.cpp:
* b3/B3LowerToAir.cpp:
* b3/B3MemoryValue.cpp:
(JSC::B3::MemoryValue::MemoryValue):
* b3/B3Opcode.cpp:
* b3/B3Type.h:
* b3/B3TypeMap.h:
* b3/B3Width.h:
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration):
(JSC::B3::Air::GenerateAndAllocateRegisters::generate):
* b3/air/AirAllocateRegistersAndStackAndGenerateCode.h:
* b3/air/AirAllocateRegistersByGraphColoring.cpp:
* b3/air/AirArg.cpp:
* b3/air/AirArg.h:
* b3/air/AirCode.h:
* b3/air/AirEmitShuffle.cpp:
(JSC::B3::Air::emitShuffle):
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createExecutable):
* bytecode/AccessCase.cpp:
* bytecode/AccessCase.h:
* bytecode/CallVariant.cpp:
(JSC::variantListWithVariant):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::ensureCatchLivenessIsComputedForBytecodeIndex):
* bytecode/CodeBlockHash.cpp:
(JSC::CodeBlockHash::dump const):
* bytecode/StructureStubInfo.cpp:
* bytecode/StructureStubInfo.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallResolveNode::emitBytecode):
* bytecompiler/RegisterID.h:
(JSC::RegisterID::RegisterID):
(JSC::RegisterID::setIndex):
* debugger/Debugger.cpp:
(JSC::Debugger::removeBreakpoint):
* debugger/DebuggerEvalEnabler.h:
(JSC::DebuggerEvalEnabler::DebuggerEvalEnabler):
(JSC::DebuggerEvalEnabler::~DebuggerEvalEnabler):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::observeTransitions):
* dfg/DFGAbstractValue.cpp:
* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::merge):
(JSC::DFG::AbstractValue::checkConsistency const):
(JSC::DFG::AbstractValue::assertIsRegistered const):
* dfg/DFGArithMode.h:
(JSC::DFG::doesOverflow):
* dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::BasicBlock):
* dfg/DFGBasicBlock.h:
(JSC::DFG::BasicBlock::didLink):
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGCommon.h:
(JSC::DFG::validationEnabled):
* dfg/DFGCommonData.cpp:
(JSC::DFG::CommonData::finalizeCatchEntrypoints):
* dfg/DFGDesiredWatchpoints.h:
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGEdge.h:
(JSC::DFG::Edge::makeWord):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGJITCode.cpp:
(JSC::DFG::JITCode::finalizeOSREntrypoints):
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGScoreBoard.h:
(JSC::DFG::ScoreBoard::assertClear):
* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::SlowPathGenerator::generate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::emitBinarySwitchStringRecurse):
(JSC::DFG::SpeculativeJIT::emitAllocateButterfly):
(JSC::DFG::SpeculativeJIT::compileAllocateNewArrayWithSize):
(JSC::DFG::SpeculativeJIT::compileMakeRope):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
* dfg/DFGStructureAbstractValue.cpp:
* dfg/DFGStructureAbstractValue.h:
(JSC::DFG::StructureAbstractValue::assertIsRegistered const):
* dfg/DFGVarargsForwardingPhase.cpp:
* dfg/DFGVirtualRegisterAllocationPhase.cpp:
(JSC::DFG::VirtualRegisterAllocationPhase::run):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::callPreflight):
(JSC::FTL::DFG::LowerDFGToB3::callCheck):
(JSC::FTL::DFG::LowerDFGToB3::crash):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationMaterializeObjectInOSR):
* heap/BlockDirectory.cpp:
(JSC::BlockDirectory::assertNoUnswept):
* heap/GCSegmentedArray.h:
(JSC::GCArraySegment::GCArraySegment):
* heap/GCSegmentedArrayInlines.h:
(JSC::GCSegmentedArray<T>::clear):
(JSC::GCSegmentedArray<T>::expand):
(JSC::GCSegmentedArray<T>::validatePrevious):
* heap/HandleSet.cpp:
* heap/HandleSet.h:
* heap/Heap.cpp:
(JSC::Heap::updateAllocationLimits):
* heap/Heap.h:
* heap/MarkedBlock.cpp:
* heap/MarkedBlock.h:
(JSC::MarkedBlock::assertValidCell const):
(JSC::MarkedBlock::assertMarksNotStale):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::beginMarking):
(JSC::MarkedSpace::endMarking):
(JSC::MarkedSpace::assertNoUnswept):
* heap/PreciseAllocation.cpp:
* heap/PreciseAllocation.h:
(JSC::PreciseAllocation::assertValidCell const):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::SlotVisitor):
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
* heap/SlotVisitor.h:
* inspector/InspectorProtocolTypes.h:
(Inspector::Protocol::BindingTraits<JSON::ArrayOf<T>>::assertValueHasExpectedType):
* inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py:
(CppProtocolTypesImplementationGenerator._generate_assertion_for_object_declaration):
(CppProtocolTypesImplementationGenerator):
(CppProtocolTypesImplementationGenerator._generate_assertion_for_enum):
* inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result:
* interpreter/FrameTracers.h:
(JSC::JITOperationPrologueCallFrameTracer::JITOperationPrologueCallFrameTracer):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::Interpreter):
* interpreter/Interpreter.h:
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::emitStoreStructureWithTypeInfo):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::prepareCallOperation):
* jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupStubArgs):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::emitDeltaCheck):
(JSC::CallFrameShuffler::prepareAny):
* jit/JIT.cpp:
(JSC::JIT::assertStackPointerOffset):
(JSC::JIT::compileWithoutLinking):
* jit/JITOpcodes.cpp:
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_get_from_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_get_from_scope):
* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::emitPointerValidation):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntOfflineAsmConfig.h:
* parser/Lexer.cpp:
* parser/Lexer.h:
(JSC::isSafeBuiltinIdentifier):
(JSC::Lexer<T>::lexExpectIdentifier):
* runtime/ArgList.h:
(JSC::MarkedArgumentBuffer::setNeedsOverflowCheck):
(JSC::MarkedArgumentBuffer::clearNeedsOverflowCheck):
* runtime/Butterfly.h:
(JSC::ContiguousData::ContiguousData):
(JSC::ContiguousData::Data::Data):
* runtime/HashMapImpl.h:
(JSC::HashMapImpl::checkConsistency const):
(JSC::HashMapImpl::assertBufferIsEmpty const):
* runtime/JSCellInlines.h:
(JSC::JSCell::methodTable const):
* runtime/JSFunction.cpp:
* runtime/JSFunction.h:
(JSC::JSFunction::assertTypeInfoFlagInvariants):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/JSGlobalObject.h:
* runtime/JSObject.cpp:
(JSC::JSObject::visitChildren):
(JSC::JSFinalObject::visitChildren):
* runtime/JSObjectInlines.h:
(JSC::JSObject::validatePutOwnDataProperty):
* runtime/JSSegmentedVariableObject.h:
(JSC::JSSegmentedVariableObject::assertVariableIsInThisObject):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::Lexer::lex):
* runtime/LiteralParser.h:
* runtime/Operations.h:
(JSC::scribbleFreeCells):
* runtime/OptionsList.h:
* runtime/VM.cpp:
(JSC::VM::computeCanUseJIT):
* runtime/VM.h:
(JSC::VM::canUseJIT):
* runtime/VarOffset.h:
(JSC::VarOffset::checkSanity const):
* runtime/WeakMapImpl.h:
(JSC::WeakMapImpl::checkConsistency const):
(JSC::WeakMapImpl::assertBufferIsEmpty const):
* wasm/WasmAirIRGenerator.cpp:
(JSC::Wasm::AirIRGenerator::validateInst):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::parseAndCompile):
* wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser::validationFail const):
* wasm/WasmLLIntGenerator.cpp:
(JSC::Wasm::LLIntGenerator::checkConsistency):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmSectionParser.h:
* wasm/WasmSections.h:
* wasm/WasmSignatureInlines.h:
(JSC::Wasm::SignatureInformation::get):
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::enqueue):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::previousInstanceOffset const):
Source/WebCore:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::close):
* Modules/fetch/FetchBodySource.h:
* Modules/webdatabase/DatabaseDetails.h:
(WebCore::DatabaseDetails::DatabaseDetails):
(WebCore::DatabaseDetails::operator=):
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::DatabaseTask::performTask):
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/DatabaseThread.cpp:
(WebCore::DatabaseThread::terminationRequested const):
* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h:
(WebCore::WHLSL::AST::TypeAnnotation::TypeAnnotation):
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp:
(WebCore::WHLSL::findHighZombies):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::matches):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp:
(WebCore::WHLSL::checkLiteralTypes):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::FindAllTypes::appendNamedType):
* bindings/js/JSCallbackData.h:
* bindings/js/JSLazyEventListener.cpp:
* bindings/js/JSLazyEventListener.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcOperationNode::primitiveType const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
* css/CSSPrimitiveValue.cpp:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSStyleSheet.cpp:
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::suspendIfNeeded):
(WebCore::ActiveDOMObject::assertSuspendIfNeededWasCalled const):
* dom/ActiveDOMObject.h:
* dom/ContainerNode.cpp:
* dom/ContainerNodeAlgorithms.cpp:
* dom/ContainerNodeAlgorithms.h:
* dom/CustomElementReactionQueue.cpp:
* dom/CustomElementReactionQueue.h:
(WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope):
(WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope):
* dom/Document.cpp:
(WebCore::Document::hitTest):
* dom/Document.h:
(WebCore::Document::decrementReferencingNodeCount):
* dom/Element.cpp:
(WebCore::Element::addShadowRoot):
(WebCore::Element::getURLAttribute const):
(WebCore::Element::getNonEmptyURLAttribute const):
* dom/Element.h:
* dom/ElementAndTextDescendantIterator.h:
(WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
(WebCore::ElementAndTextDescendantIterator::dropAssertions):
(WebCore::ElementAndTextDescendantIterator::popAncestorSiblingStack):
(WebCore::ElementAndTextDescendantIterator::traverseNextSibling):
(WebCore::ElementAndTextDescendantIterator::traversePreviousSibling):
* dom/ElementDescendantIterator.h:
(WebCore::ElementDescendantIterator::ElementDescendantIterator):
(WebCore::ElementDescendantIterator::dropAssertions):
(WebCore::ElementDescendantIterator::operator++):
(WebCore::ElementDescendantIterator::operator--):
(WebCore::ElementDescendantConstIterator::ElementDescendantConstIterator):
(WebCore::ElementDescendantConstIterator::dropAssertions):
(WebCore::ElementDescendantConstIterator::operator++):
* dom/ElementIterator.h:
(WebCore::ElementIterator<ElementType>::ElementIterator):
(WebCore::ElementIterator<ElementType>::traverseNext):
(WebCore::ElementIterator<ElementType>::traversePrevious):
(WebCore::ElementIterator<ElementType>::traverseNextSibling):
(WebCore::ElementIterator<ElementType>::traversePreviousSibling):
(WebCore::ElementIterator<ElementType>::traverseNextSkippingChildren):
(WebCore::ElementIterator<ElementType>::dropAssertions):
(WebCore::ElementIterator<ElementType>::traverseAncestor):
(WebCore::ElementConstIterator<ElementType>::ElementConstIterator):
(WebCore::ElementConstIterator<ElementType>::traverseNext):
(WebCore::ElementConstIterator<ElementType>::traversePrevious):
(WebCore::ElementConstIterator<ElementType>::traverseNextSibling):
(WebCore::ElementConstIterator<ElementType>::traversePreviousSibling):
(WebCore::ElementConstIterator<ElementType>::traverseNextSkippingChildren):
(WebCore::ElementConstIterator<ElementType>::traverseAncestor):
(WebCore::ElementConstIterator<ElementType>::dropAssertions):
* dom/EventContext.cpp:
* dom/EventContext.h:
* dom/EventListener.h:
* dom/EventPath.cpp:
* dom/EventSender.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
(WebCore::EventTarget::setAttributeEventListener):
(WebCore::EventTarget::innerInvokeEventListeners):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::moveNodeToNewDocument):
(WebCore::Node::removedLastRef):
* dom/Node.h:
(WebCore::Node::deref const):
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::~ScriptExecutionContext):
* dom/ScriptExecutionContext.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::execute const):
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::addSlotElementByName):
(WebCore::SlotAssignment::removeSlotElementByName):
(WebCore::SlotAssignment::resolveSlotsAfterSlotMutation):
(WebCore::SlotAssignment::findFirstSlotElement):
* dom/SlotAssignment.h:
* dom/TreeScopeOrderedMap.cpp:
(WebCore::TreeScopeOrderedMap::add):
(WebCore::TreeScopeOrderedMap::get const):
* dom/TreeScopeOrderedMap.h:
* fileapi/Blob.cpp:
* fileapi/Blob.h:
* history/BackForwardCache.cpp:
(WebCore::BackForwardCache::removeAllItemsForPage):
* history/BackForwardCache.h:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
* html/CanvasBase.h:
* html/HTMLCollection.h:
(WebCore::CollectionNamedElementCache::didPopulate):
* html/HTMLSelectElement.cpp:
(WebCore:: const):
* html/HTMLTableRowsCollection.cpp:
(WebCore::assertRowIsInTable):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::indexForPosition const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::~CanvasRenderingContext2DBase):
* html/parser/HTMLParserScheduler.cpp:
(WebCore::HTMLParserScheduler::HTMLParserScheduler):
(WebCore::HTMLParserScheduler::suspend):
(WebCore::HTMLParserScheduler::resume):
* html/parser/HTMLParserScheduler.h:
* html/parser/HTMLToken.h:
(WebCore::HTMLToken::beginStartTag):
(WebCore::HTMLToken::beginEndTag):
(WebCore::HTMLToken::endAttribute):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
(WebCore::HTMLTreeBuilder::constructTree):
* html/parser/HTMLTreeBuilder.h:
(WebCore::HTMLTreeBuilder::~HTMLTreeBuilder):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::geometryForBox const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition):
* layout/blockformatting/BlockFormattingContext.h:
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setTopLeft):
(WebCore::Display::Box::setTop):
(WebCore::Display::Box::setLeft):
(WebCore::Display::Box::setContentBoxHeight):
(WebCore::Display::Box::setContentBoxWidth):
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setHorizontalComputedMargin):
(WebCore::Display::Box::setBorder):
(WebCore::Display::Box::setPadding):
* layout/displaytree/DisplayInlineRect.h:
(WebCore::Display::InlineRect::InlineRect):
(WebCore::Display::InlineRect::setTopLeft):
(WebCore::Display::InlineRect::setTop):
(WebCore::Display::InlineRect::setBottom):
(WebCore::Display::InlineRect::setLeft):
(WebCore::Display::InlineRect::setWidth):
(WebCore::Display::InlineRect::setHeight):
* layout/displaytree/DisplayLineBox.h:
(WebCore::Display::LineBox::LineBox):
(WebCore::Display::LineBox::setBaselineOffsetIfGreater):
(WebCore::Display::LineBox::resetBaseline):
(WebCore::Display::LineBox::Baseline::Baseline):
(WebCore::Display::LineBox::Baseline::setAscent):
(WebCore::Display::LineBox::Baseline::setDescent):
(WebCore::Display::LineBox::Baseline::reset):
* layout/displaytree/DisplayRect.h:
(WebCore::Display::Rect::Rect):
(WebCore::Display::Rect::setTopLeft):
(WebCore::Display::Rect::setTop):
(WebCore::Display::Rect::setLeft):
(WebCore::Display::Rect::setWidth):
(WebCore::Display::Rect::setHeight):
(WebCore::Display::Rect::setSize):
(WebCore::Display::Rect::clone const):
* layout/floats/FloatingContext.cpp:
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::CollapsibleContent::collapse):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::setWidthConstraints):
(WebCore::Layout::TableGrid::Column::setLogicalWidth):
(WebCore::Layout::TableGrid::Column::setLogicalLeft):
* layout/tableformatting/TableGrid.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::attachToFrame):
(WebCore::DocumentLoader::detachFromFrame):
(WebCore::DocumentLoader::addSubresourceLoader):
* loader/DocumentLoader.h:
* loader/ImageLoader.cpp:
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::lruListFor):
(WebCore::MemoryCache::removeFromLRUList):
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
* page/FrameViewLayoutContext.cpp:
* page/FrameViewLayoutContext.h:
* page/Page.cpp:
* page/Page.h:
* page/ViewportConfiguration.cpp:
* page/ViewportConfiguration.h:
* page/mac/EventHandlerMac.mm:
(WebCore::CurrentEventScope::CurrentEventScope):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const):
* platform/ScrollableArea.cpp:
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::combineIntoOneSegment const):
* platform/SharedBuffer.h:
* platform/Supplementable.h:
* platform/Timer.cpp:
(WebCore::TimerBase::checkHeapIndex const):
(WebCore::TimerBase::updateHeapIfNeeded):
* platform/graphics/BitmapImage.cpp:
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::ScratchBuffer):
(WebCore::ScratchBuffer::getScratchBuffer):
(WebCore::ScratchBuffer::scheduleScratchBufferPurge):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::setWindow):
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::putData):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
(gstAllocatorFastMallocFree):
* platform/graphics/nicosia/cairo/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::ForPainting::ForPainting):
* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp:
(Nicosia::BackingStoreTextureMapperImpl::createTile):
* platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
(Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl):
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::fill):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::putData):
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::appendGeometry):
(WebCore::Path::Path):
(WebCore::Path::operator=):
(WebCore::Path::strokeContains const):
(WebCore::Path::transform):
* platform/graphics/win/PlatformContextDirect2D.cpp:
(WebCore::PlatformContextDirect2D::setTags):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
* platform/network/HTTPParsers.cpp:
(WebCore::isCrossOriginSafeHeader):
* platform/sql/SQLiteDatabase.cpp:
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::SQLiteStatement):
(WebCore::SQLiteStatement::prepare):
(WebCore::SQLiteStatement::finalize):
* platform/sql/SQLiteStatement.h:
* platform/win/COMPtr.h:
* rendering/ComplexLineLayout.cpp:
(WebCore::ComplexLineLayout::removeInlineBox const):
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::FloatingObject):
(WebCore::FloatingObjects::addPlacedObject):
(WebCore::FloatingObjects::removePlacedObject):
* rendering/FloatingObjects.h:
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/GridTrackSizingAlgorithm.h:
* rendering/LayoutDisallowedScope.cpp:
* rendering/LayoutDisallowedScope.h:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlockChild):
(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
* rendering/RenderElement.cpp:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::mapToContainer const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::baselinePosition const):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::willBeDestroyed):
* rendering/RenderLayer.cpp:
(WebCore::ClipRectsCache::ClipRectsCache):
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::traverseVisibleNonCompositedDescendantLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::addDescendantsToOverlapMapRecursive const):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
* rendering/RenderLayoutState.cpp:
(WebCore::RenderLayoutState::RenderLayoutState):
(WebCore::RenderLayoutState::computeOffsets):
(WebCore::RenderLayoutState::addLayoutDelta):
* rendering/RenderLayoutState.h:
(WebCore::RenderLayoutState::RenderLayoutState):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::RenderObject):
(WebCore::RenderObject::~RenderObject):
(WebCore::RenderObject::clearNeedsLayout):
* rendering/RenderObject.h:
* rendering/RenderQuote.cpp:
(WebCore::quotesForLanguage):
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::computeOverflowFromCells):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::checkConsistency const):
* rendering/RenderTextLineBoxes.h:
* rendering/line/BreakingContext.h:
(WebCore::tryHyphenating):
* rendering/style/GridArea.h:
(WebCore::GridSpan::GridSpan):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::~RenderStyle):
* rendering/style/RenderStyle.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::detach):
* rendering/updating/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::computeNextSibling):
* rendering/updating/RenderTreePosition.h:
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::Placeholder::Placeholder):
(WebCore::SVGToOTFFontConverter::Placeholder::populate):
(WebCore::SVGToOTFFontConverter::appendCFFTable):
(WebCore::SVGToOTFFontConverter::firstGlyph const):
(WebCore::SVGToOTFFontConverter::appendKERNTable):
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::SVGTransformDistance):
(WebCore::SVGTransformDistance::scaledDistance const):
(WebCore::SVGTransformDistance::addSVGTransforms):
(WebCore::SVGTransformDistance::addToSVGTransform const):
(WebCore::SVGTransformDistance::distance const):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::nativeImage):
* testing/InternalSettings.cpp:
* workers/service/ServiceWorkerJob.h:
* worklets/PaintWorkletGlobalScope.h:
(WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope):
* xml/XPathStep.cpp:
Source/WebKit:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* NetworkProcess/NetworkSession.cpp:
(WebKit::NetworkSession::invalidateAndCancel):
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::setCapacity):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionResponseDisposition):
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
* Platform/IPC/Connection.cpp:
(IPC::Connection::waitForMessage):
* Platform/IPC/MessageReceiver.h:
(IPC::MessageReceiver::willBeAddedToMessageReceiverMap):
(IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap):
* Platform/IPC/cocoa/ConnectionCocoa.mm:
(IPC::readFromMachPort):
* Platform/mac/MachUtilities.cpp:
(setMachExceptionPort):
* Shared/API/APIClient.h:
(API::Client::Client):
* Shared/API/Cocoa/WKRemoteObjectCoder.mm:
* Shared/Cocoa/ArgumentCodersCocoa.h:
* Shared/SharedStringHashTableReadOnly.cpp:
* UIProcess/BackingStore.cpp:
(WebKit::BackingStore::incorporateUpdate):
* UIProcess/GenericCallback.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/PageLoadState.h:
(WebKit::PageLoadState::Transaction::Token::Token):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::~WebPageProxy):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponse):
* WebProcess/Network/WebResourceLoader.h:
* WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
(WebKit::NetscapePluginStream::NetscapePluginStream):
(WebKit::NetscapePluginStream::notifyAndDestroyStream):
* WebProcess/Plugins/Netscape/NetscapePluginStream.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::runModal):
* WebProcess/WebProcess.cpp:
(WebKit::checkDocumentsCaptureStateConsistency):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateProcessName):
Source/WebKitLegacy:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* Storage/StorageAreaImpl.cpp:
(WebKit::StorageAreaImpl::StorageAreaImpl):
(WebKit::StorageAreaImpl::close):
* Storage/StorageAreaImpl.h:
Source/WebKitLegacy/mac:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* History/WebHistory.mm:
(-[WebHistoryPrivate removeItemForURLString:]):
* WebView/WebFrame.mm:
Source/WebKitLegacy/win:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
* WebKitQuartzCoreAdditions/CAD3DRenderer.cpp:
(WKQCA::CAD3DRenderer::swapChain):
(WKQCA::CAD3DRenderer::initialize):
* WebKitQuartzCoreAdditions/CAD3DRenderer.h:
* WebView.cpp:
(WebView::Release):
* WebView.h:
Source/WTF:
Convert ASSERT_DISABLED to ASSERT_ENABLED, and fix some tests of NDEBUG that should actually test for ASSERT_ENABLED.
https://bugs.webkit.org/show_bug.cgi?id=205776
Reviewed by Saam Barati.
This patch did the following changes:
1. Replaced ASSERT_DISABLED with ASSERT_ENABLED. This change does away
with the need for the double negative !ASSERT_DISABLED test that is commonly
used all over the code, thereby improving code readability.
In Assertions.h, there is also BACKTRACE_DISABLED, ASSERT_MSG_DISABLED,
ASSERT_ARG_DISABLED, FATAL_DISABLED, ERROR_DISABLED, LOG_DISABLED, and
RELEASE_LOG_DISABLED. We should replace those with ..._ENABLED equivalents
as well. We'll do that in another patch. For now, they are left as is to
minimize the size of this patch.
See https://bugs.webkit.org/show_bug.cgi?id=205780.
2. Fixed some code was guarded with "#ifndef NDEBUG" that should actually be
guarded by "#if ASSERT_ENABLED" instead.
3. In cases where the change is minimal, we move some code around so that we can
test for "#if ASSERT_ENABLED" instead of "#if !ASSERT_ENABLED".
* wtf/Assertions.h:
* wtf/AutomaticThread.cpp:
(WTF::AutomaticThread::start):
* wtf/BitVector.h:
* wtf/BlockObjCExceptions.mm:
(ReportBlockedObjCException):
* wtf/BloomFilter.h:
* wtf/CallbackAggregator.h:
(WTF::CallbackAggregator::CallbackAggregator):
* wtf/CheckedArithmetic.h:
(WTF::observesOverflow<AssertNoOverflow>):
* wtf/CheckedBoolean.h:
(CheckedBoolean::CheckedBoolean):
(CheckedBoolean::operator bool):
* wtf/CompletionHandler.h:
(WTF::CompletionHandler<Out):
* wtf/DateMath.cpp:
(WTF::initializeDates):
* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages):
* wtf/HashTable.h:
(WTF::KeyTraits>::checkKey):
(WTF::KeyTraits>::checkTableConsistencyExceptSize const):
* wtf/LoggerHelper.h:
* wtf/NaturalLoops.h:
(WTF::NaturalLoops::headerOf const):
* wtf/NeverDestroyed.h:
(WTF::LazyNeverDestroyed::construct):
* wtf/OptionSet.h:
(WTF::OptionSet::OptionSet):
* wtf/Platform.h:
* wtf/PtrTag.h:
* wtf/RefCounted.h:
(WTF::RefCountedBase::disableThreadingChecks):
(WTF::RefCountedBase::enableThreadingChecksGlobally):
(WTF::RefCountedBase::RefCountedBase):
(WTF::RefCountedBase::applyRefDerefThreadingCheck const):
* wtf/SingleRootGraph.h:
(WTF::SingleRootGraph::assertIsConsistent const):
* wtf/SizeLimits.cpp:
* wtf/StackBounds.h:
(WTF::StackBounds::checkConsistency const):
* wtf/URLParser.cpp:
(WTF::URLParser::URLParser):
(WTF::URLParser::domainToASCII):
* wtf/ValueCheck.h:
* wtf/Vector.h:
(WTF::Malloc>::checkConsistency):
* wtf/WeakHashSet.h:
* wtf/WeakPtr.h:
(WTF::WeakPtrImpl::WeakPtrImpl):
(WTF::WeakPtrFactory::WeakPtrFactory):
* wtf/text/AtomStringImpl.cpp:
* wtf/text/AtomStringImpl.h:
* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::reifyString const):
* wtf/text/StringBuilder.h:
* wtf/text/StringCommon.h:
(WTF::hasPrefixWithLettersIgnoringASCIICaseCommon):
* wtf/text/StringHasher.h:
(WTF::StringHasher::addCharacters):
* wtf/text/StringImpl.h:
* wtf/text/SymbolImpl.h:
* wtf/text/UniquedStringImpl.h:
Tools:
Remove WebsiteDataStore::setServiceWorkerRegistrationDirectory
https://bugs.webkit.org/show_bug.cgi?id=205754
Patch by Alex Christensen <achristensen@webkit.org> on 2020-01-06
Reviewed by Youenn Fablet.
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::websiteDataStore):
(WTR::TestController::platformAdjustContext):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@254087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/API/tests/testapi.c b/Source/JavaScriptCore/API/tests/testapi.c
index f2993ee..782162e 100644
--- a/Source/JavaScriptCore/API/tests/testapi.c
+++ b/Source/JavaScriptCore/API/tests/testapi.c
@@ -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)
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 412015f..b83cdb2 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -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
diff --git a/Source/JavaScriptCore/assembler/ARM64Assembler.h b/Source/JavaScriptCore/assembler/ARM64Assembler.h
index ee6f1a6..ced8059 100644
--- a/Source/JavaScriptCore/assembler/ARM64Assembler.h
+++ b/Source/JavaScriptCore/assembler/ARM64Assembler.h
@@ -2618,7 +2618,7 @@
performJITMemcpy(where, &insn, sizeof(int));
cacheFlush(where, sizeof(int));
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
else {
MemOpSize size;
bool V;
@@ -2632,7 +2632,7 @@
ASSERT(opc == MemOp_LOAD);
ASSERT(!(imm12 & ~0x1ff));
}
-#endif
+#endif // ASSERT_ENABLED
}
static void replaceWithAddressComputation(void* where)
@@ -2653,7 +2653,7 @@
performJITMemcpy(where, &insn, sizeof(int));
cacheFlush(where, sizeof(int));
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
else {
Datasize sf;
AddOp op;
@@ -2669,7 +2669,7 @@
ASSERT(!shift);
ASSERT(!(imm12 & ~0xff8));
}
-#endif
+#endif // ASSERT_ENABLED
}
static void repatchPointer(void* where, void* valuePtr)
diff --git a/Source/JavaScriptCore/assembler/AssemblerBuffer.h b/Source/JavaScriptCore/assembler/AssemblerBuffer.h
index 8ebc688..41ba792 100644
--- a/Source/JavaScriptCore/assembler/AssemblerBuffer.h
+++ b/Source/JavaScriptCore/assembler/AssemblerBuffer.h
@@ -247,7 +247,7 @@
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 @@
AssemblerBuffer& m_buffer;
char* m_storageBuffer;
unsigned m_index;
-#if !defined(NDEBUG)
+#if ASSERT_ENABLED
unsigned m_initialIndex;
unsigned m_requiredSpace;
#endif
diff --git a/Source/JavaScriptCore/assembler/LinkBuffer.cpp b/Source/JavaScriptCore/assembler/LinkBuffer.cpp
index 209fe88..2103fb7 100644
--- a/Source/JavaScriptCore/assembler/LinkBuffer.cpp
+++ b/Source/JavaScriptCore/assembler/LinkBuffer.cpp
@@ -210,7 +210,7 @@
jumpsToLink[i].setFrom(writePtr);
}
} else {
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
for (unsigned i = 0; i < jumpCount; ++i)
ASSERT(!MacroAssembler::canCompact(jumpsToLink[i].type()));
}
diff --git a/Source/JavaScriptCore/assembler/ProbeStack.cpp b/Source/JavaScriptCore/assembler/ProbeStack.cpp
index da47705..c412c58 100644
--- a/Source/JavaScriptCore/assembler/ProbeStack.cpp
+++ b/Source/JavaScriptCore/assembler/ProbeStack.cpp
@@ -104,7 +104,7 @@
, m_pages(WTFMove(other.m_pages))
{
m_savedStackPointer = other.m_savedStackPointer;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
other.m_isValid = false;
#endif
}
diff --git a/Source/JavaScriptCore/assembler/ProbeStack.h b/Source/JavaScriptCore/assembler/ProbeStack.h
index 3b138f0..f04bb63 100644
--- a/Source/JavaScriptCore/assembler/ProbeStack.h
+++ b/Source/JavaScriptCore/assembler/ProbeStack.h
@@ -190,7 +190,7 @@
bool hasWritesToFlush();
void flushWrites();
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
bool isValid() { return m_isValid; }
#endif
@@ -211,7 +211,7 @@
StackBounds m_stackBounds;
HashMap<void*, std::unique_ptr<Page>> m_pages;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
bool m_isValid { true };
#endif
};
diff --git a/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp b/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp
index e2c29af..e67f304 100644
--- a/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp
+++ b/Source/JavaScriptCore/b3/B3FoldPathConstants.cpp
@@ -77,7 +77,7 @@
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);
}
diff --git a/Source/JavaScriptCore/b3/B3LowerToAir.cpp b/Source/JavaScriptCore/b3/B3LowerToAir.cpp
index 19248a5..157409e9 100644
--- a/Source/JavaScriptCore/b3/B3LowerToAir.cpp
+++ b/Source/JavaScriptCore/b3/B3LowerToAir.cpp
@@ -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 @@
} } // namespace JSC::B3
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/B3MemoryValue.cpp b/Source/JavaScriptCore/b3/B3MemoryValue.cpp
index 3b8727f..0ac1cff 100644
--- a/Source/JavaScriptCore/b3/B3MemoryValue.cpp
+++ b/Source/JavaScriptCore/b3/B3MemoryValue.cpp
@@ -81,7 +81,7 @@
, 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::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:
diff --git a/Source/JavaScriptCore/b3/B3Opcode.cpp b/Source/JavaScriptCore/b3/B3Opcode.cpp
index 96c0b9a..360f045 100644
--- a/Source/JavaScriptCore/b3/B3Opcode.cpp
+++ b/Source/JavaScriptCore/b3/B3Opcode.cpp
@@ -30,7 +30,7 @@
#include <wtf/PrintStream.h>
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_BEGIN
#endif
@@ -375,7 +375,7 @@
} // namespace WTF
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/B3Type.h b/Source/JavaScriptCore/b3/B3Type.h
index 647f8da..9322f88 100644
--- a/Source/JavaScriptCore/b3/B3Type.h
+++ b/Source/JavaScriptCore/b3/B3Type.h
@@ -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 @@
} // namespace WTF
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/B3TypeMap.h b/Source/JavaScriptCore/b3/B3TypeMap.h
index d06e661..6acf1e6 100644
--- a/Source/JavaScriptCore/b3/B3TypeMap.h
+++ b/Source/JavaScriptCore/b3/B3TypeMap.h
@@ -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 @@
} } // namespace JSC::B3
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/B3Width.h b/Source/JavaScriptCore/b3/B3Width.h
index ca23dc4..a0202d0 100644
--- a/Source/JavaScriptCore/b3/B3Width.h
+++ b/Source/JavaScriptCore/b3/B3Width.h
@@ -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 @@
} // namespace WTF
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp b/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
index c1e1300..17bff7b 100644
--- a/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
+++ b/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
@@ -286,7 +286,7 @@
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 @@
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 @@
}
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.
diff --git a/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h b/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h
index ac3cebf..3d4f362 100644
--- a/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h
+++ b/Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.h
@@ -71,7 +71,7 @@
TmpMap<TmpData> m_map;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
Vector<Tmp> m_allTmps[numBanks];
#endif
diff --git a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
index 086068a..bcb19ff 100644
--- a/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
+++ b/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp
@@ -162,7 +162,7 @@
bool hasBeenSimplified(IndexType tmpIndex)
{
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
if (!!m_coalescedTmps[tmpIndex])
ASSERT(getAlias(tmpIndex) != tmpIndex);
}
@@ -648,7 +648,7 @@
// 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 @@
}
} 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 @@
// 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 @@
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);
diff --git a/Source/JavaScriptCore/b3/air/AirArg.cpp b/Source/JavaScriptCore/b3/air/AirArg.cpp
index 8fa0d50..3f9aaef 100644
--- a/Source/JavaScriptCore/b3/air/AirArg.cpp
+++ b/Source/JavaScriptCore/b3/air/AirArg.cpp
@@ -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 @@
} // namespace WTF
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/air/AirArg.h b/Source/JavaScriptCore/b3/air/AirArg.h
index 517e4be..bf9ae5e 100644
--- a/Source/JavaScriptCore/b3/air/AirArg.h
+++ b/Source/JavaScriptCore/b3/air/AirArg.h
@@ -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 @@
} // namespace WTF
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/air/AirCode.h b/Source/JavaScriptCore/b3/air/AirCode.h
index 3c44aff..fbeea99 100644
--- a/Source/JavaScriptCore/b3/air/AirCode.h
+++ b/Source/JavaScriptCore/b3/air/AirCode.h
@@ -44,7 +44,7 @@
class Procedure;
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_BEGIN
#endif
@@ -392,7 +392,7 @@
} } } // namespace JSC::B3::Air
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp b/Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp
index b9697ec..5c27b4e 100644
--- a/Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp
+++ b/Source/JavaScriptCore/b3/air/AirEmitShuffle.cpp
@@ -139,13 +139,13 @@
});
// 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:
//
diff --git a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
index 8d23748..c4b1ee3 100644
--- a/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
+++ b/Source/JavaScriptCore/builtins/BuiltinExecutables.cpp
@@ -205,7 +205,7 @@
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;
diff --git a/Source/JavaScriptCore/bytecode/AccessCase.cpp b/Source/JavaScriptCore/bytecode/AccessCase.cpp
index 9899362..823603a 100644
--- a/Source/JavaScriptCore/bytecode/AccessCase.cpp
+++ b/Source/JavaScriptCore/bytecode/AccessCase.cpp
@@ -1983,7 +1983,7 @@
}
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
void AccessCase::checkConsistency(StructureStubInfo& stubInfo)
{
RELEASE_ASSERT(!(requiresInt32PropertyCheck() && requiresIdentifierNameMatch()));
@@ -1993,7 +1993,7 @@
RELEASE_ASSERT(requiresIdentifierNameMatch());
}
}
-#endif
+#endif // ASSERT_ENABLED
} // namespace JSC
diff --git a/Source/JavaScriptCore/bytecode/AccessCase.h b/Source/JavaScriptCore/bytecode/AccessCase.h
index 3d2a74db..5fa2e0c 100644
--- a/Source/JavaScriptCore/bytecode/AccessCase.h
+++ b/Source/JavaScriptCore/bytecode/AccessCase.h
@@ -239,7 +239,7 @@
Box<Identifier> identifier() const { return m_identifier; }
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
void checkConsistency(StructureStubInfo&);
#else
ALWAYS_INLINE void checkConsistency(StructureStubInfo&) { }
diff --git a/Source/JavaScriptCore/bytecode/CallVariant.cpp b/Source/JavaScriptCore/bytecode/CallVariant.cpp
index 7169786..5272775 100644
--- a/Source/JavaScriptCore/bytecode/CallVariant.cpp
+++ b/Source/JavaScriptCore/bytecode/CallVariant.cpp
@@ -115,7 +115,7 @@
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])
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index c63dbdc..4e4790d 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1783,7 +1783,7 @@
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 @@
}
}
ASSERT(found);
-#endif
+#endif // ASSERT_ENABLED
return;
}
diff --git a/Source/JavaScriptCore/bytecode/CodeBlockHash.cpp b/Source/JavaScriptCore/bytecode/CodeBlockHash.cpp
index ee1b03d..b13c999 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlockHash.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlockHash.cpp
@@ -58,10 +58,10 @@
{
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());
}
diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp b/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
index a930996..f648b53 100644
--- a/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
+++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
@@ -374,7 +374,7 @@
m_cacheType = newCacheType;
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
void StructureStubInfo::checkConsistency()
{
if (thisValueIsInThisGPR()) {
@@ -383,7 +383,7 @@
RELEASE_ASSERT(hasConstantIdentifier);
}
}
-#endif
+#endif // ASSERT_ENABLED
#endif // ENABLE(JIT)
diff --git a/Source/JavaScriptCore/bytecode/StructureStubInfo.h b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
index 8025b9f..f4e51cf 100644
--- a/Source/JavaScriptCore/bytecode/StructureStubInfo.h
+++ b/Source/JavaScriptCore/bytecode/StructureStubInfo.h
@@ -263,7 +263,7 @@
bool thisValueIsInThisGPR() const { return accessType == AccessType::GetByIdWithThis; }
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
void checkConsistency();
#else
ALWAYS_INLINE void checkConsistency() { }
diff --git a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
index e4f2aea..f4a1efe 100644
--- a/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
+++ b/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp
@@ -941,8 +941,8 @@
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()));
}
diff --git a/Source/JavaScriptCore/bytecompiler/RegisterID.h b/Source/JavaScriptCore/bytecompiler/RegisterID.h
index f819b12..73b4320 100644
--- a/Source/JavaScriptCore/bytecompiler/RegisterID.h
+++ b/Source/JavaScriptCore/bytecompiler/RegisterID.h
@@ -43,7 +43,7 @@
RegisterID()
: m_refCount(0)
, m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
, m_didSetIndex(false)
#endif
{
@@ -53,7 +53,7 @@
: m_refCount(0)
, m_virtualRegister(virtualRegister)
, m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
, m_didSetIndex(true)
#endif
{
@@ -63,7 +63,7 @@
: m_refCount(0)
, m_virtualRegister(VirtualRegister(index))
, m_isTemporary(false)
-#ifndef NDEBUG
+#if ASSERT_ENABLED
, m_didSetIndex(true)
#endif
{
@@ -71,7 +71,7 @@
void setIndex(VirtualRegister index)
{
-#ifndef NDEBUG
+#if ASSERT_ENABLED
m_didSetIndex = true;
#endif
m_virtualRegister = index;
@@ -120,7 +120,7 @@
int m_refCount;
VirtualRegister m_virtualRegister;
bool m_isTemporary;
-#ifndef NDEBUG
+#if ASSERT_ENABLED
bool m_didSetIndex;
#endif
};
diff --git a/Source/JavaScriptCore/debugger/Debugger.cpp b/Source/JavaScriptCore/debugger/Debugger.cpp
index 409075d..9c7cfbc 100644
--- a/Source/JavaScriptCore/debugger/Debugger.cpp
+++ b/Source/JavaScriptCore/debugger/Debugger.cpp
@@ -451,14 +451,14 @@
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);
diff --git a/Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h b/Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h
index 461f0a6e..910d817 100644
--- a/Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h
+++ b/Source/JavaScriptCore/debugger/DebuggerEvalEnabler.h
@@ -39,7 +39,7 @@
DebuggerEvalEnabler(JSGlobalObject* globalObject, Mode mode = Mode::EvalOnCurrentCallFrame)
: m_globalObject(globalObject)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
, m_mode(mode)
#endif
@@ -49,7 +49,7 @@
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 @@
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 @@
private:
JSGlobalObject* m_globalObject;
bool m_evalWasDisabled { false };
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
DebuggerEvalEnabler::Mode m_mode;
#endif
};
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
index 71c4d06..b6f94d4 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
@@ -4378,7 +4378,7 @@
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());
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp b/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
index 19f93b7..ba019c9 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
+++ b/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp
@@ -441,7 +441,7 @@
return result;
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
void AbstractValue::checkConsistency() const
{
if (!(m_type & SpecCell)) {
@@ -465,7 +465,7 @@
{
m_structure.assertIsRegistered(graph);
}
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
ResultType AbstractValue::resultType() const
{
diff --git a/Source/JavaScriptCore/dfg/DFGAbstractValue.h b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
index edc194b..cf9fd08 100644
--- a/Source/JavaScriptCore/dfg/DFGAbstractValue.h
+++ b/Source/JavaScriptCore/dfg/DFGAbstractValue.h
@@ -283,7 +283,7 @@
if (other.isClear())
return false;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
AbstractValue oldMe = *this;
#endif
bool result = false;
@@ -431,12 +431,12 @@
|| !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;
diff --git a/Source/JavaScriptCore/dfg/DFGArithMode.h b/Source/JavaScriptCore/dfg/DFGArithMode.h
index 2b7a3c2..1cdf5f5 100644
--- a/Source/JavaScriptCore/dfg/DFGArithMode.h
+++ b/Source/JavaScriptCore/dfg/DFGArithMode.h
@@ -92,7 +92,7 @@
switch (mode) {
case Arith::NotSet:
ASSERT_NOT_REACHED();
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
FALLTHROUGH;
#endif
case Arith::Unchecked:
diff --git a/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp b/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
index 99fda62..e48e0c2 100644
--- a/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
+++ b/Source/JavaScriptCore/dfg/DFGBasicBlock.cpp
@@ -46,7 +46,7 @@
, intersectionOfCFAHasVisited(true)
, isOSRTarget(false)
, isCatchEntrypoint(false)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
, isLinked(false)
#endif
, isReachable(false)
diff --git a/Source/JavaScriptCore/dfg/DFGBasicBlock.h b/Source/JavaScriptCore/dfg/DFGBasicBlock.h
index 7f5b395..d2c5ae9 100644
--- a/Source/JavaScriptCore/dfg/DFGBasicBlock.h
+++ b/Source/JavaScriptCore/dfg/DFGBasicBlock.h
@@ -175,7 +175,7 @@
void didLink()
{
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
isLinked = true;
#endif
}
@@ -197,7 +197,7 @@
bool isOSRTarget;
bool isCatchEntrypoint;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
bool isLinked;
#endif
bool isReachable;
diff --git a/Source/JavaScriptCore/dfg/DFGCFAPhase.cpp b/Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
index 3dc7568..4bdb7ba 100644
--- a/Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCFAPhase.cpp
@@ -235,7 +235,7 @@
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());
}
diff --git a/Source/JavaScriptCore/dfg/DFGCommon.h b/Source/JavaScriptCore/dfg/DFGCommon.h
index f272670..eddeaba 100644
--- a/Source/JavaScriptCore/dfg/DFGCommon.h
+++ b/Source/JavaScriptCore/dfg/DFGCommon.h
@@ -83,7 +83,7 @@
inline bool validationEnabled()
{
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
return true;
#else
return Options::validateGraph() || Options::validateGraphAtEachPhase();
diff --git a/Source/JavaScriptCore/dfg/DFGCommonData.cpp b/Source/JavaScriptCore/dfg/DFGCommonData.cpp
index 7c80750..0712ccb 100644
--- a/Source/JavaScriptCore/dfg/DFGCommonData.cpp
+++ b/Source/JavaScriptCore/dfg/DFGCommonData.cpp
@@ -215,7 +215,7 @@
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
diff --git a/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h b/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h
index 9e13b62..5fbaebc 100644
--- a/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h
+++ b/Source/JavaScriptCore/dfg/DFGDesiredWatchpoints.h
@@ -113,7 +113,7 @@
template<typename WatchpointSetType, typename Adaptor = SetPointerAdaptor<WatchpointSetType>>
class GenericDesiredWatchpoints {
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
typedef HashMap<WatchpointSetType, bool> StateMap;
#endif
public:
diff --git a/Source/JavaScriptCore/dfg/DFGDoesGC.cpp b/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
index f5bd1f5..6eb8402 100644
--- a/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
+++ b/Source/JavaScriptCore/dfg/DFGDoesGC.cpp
@@ -249,7 +249,7 @@
case DataViewSet:
return false;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
case ArrayPush:
case ArrayPop:
case PushWithScope:
@@ -399,11 +399,11 @@
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:
diff --git a/Source/JavaScriptCore/dfg/DFGEdge.h b/Source/JavaScriptCore/dfg/DFGEdge.h
index 31aa2d5..b78e18b 100644
--- a/Source/JavaScriptCore/dfg/DFGEdge.h
+++ b/Source/JavaScriptCore/dfg/DFGEdge.h
@@ -198,7 +198,7 @@
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;
diff --git a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
index 7649242..dce8e3f 100644
--- a/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp
@@ -2438,9 +2438,7 @@
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 @@
case InvalidationPoint:
case CreateArgumentsButterfly:
break;
-#else
+#else // not ASSERT_ENABLED
default:
break;
-#endif
+#endif // not ASSERT_ENABLED
}
}
diff --git a/Source/JavaScriptCore/dfg/DFGJITCode.cpp b/Source/JavaScriptCore/dfg/DFGJITCode.cpp
index 7e2f9ea..9b21df3 100644
--- a/Source/JavaScriptCore/dfg/DFGJITCode.cpp
+++ b/Source/JavaScriptCore/dfg/DFGJITCode.cpp
@@ -253,7 +253,7 @@
};
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);
diff --git a/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp b/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
index 7da6afd..335034b 100644
--- a/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGObjectAllocationSinkingPhase.cpp
@@ -494,7 +494,7 @@
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 @@
void assertIsValid() const
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
// Pointers should point to an actual allocation
diff --git a/Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp b/Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp
index 04f2c0c..ca99026 100644
--- a/Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSSAConversionPhase.cpp
@@ -159,7 +159,7 @@
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);
}
diff --git a/Source/JavaScriptCore/dfg/DFGScoreBoard.h b/Source/JavaScriptCore/dfg/DFGScoreBoard.h
index d362a1b..c295d21 100644
--- a/Source/JavaScriptCore/dfg/DFGScoreBoard.h
+++ b/Source/JavaScriptCore/dfg/DFGScoreBoard.h
@@ -60,7 +60,7 @@
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.
diff --git a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
index cdcdaa6..8ffbd3c 100644
--- a/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
+++ b/Source/JavaScriptCore/dfg/DFGSlowPathGenerator.h
@@ -52,7 +52,7 @@
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; }
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
index 7ce376a..91f338f 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
@@ -1888,7 +1888,7 @@
}
// 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 @@
// 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 @@
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 @@
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 @@
}
}
- 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 @@
}
}
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
CCallHelpers::Jump ok = m_jit.branch32(
CCallHelpers::GreaterThanOrEqual, allocatorGPR, TrustedImm32(0));
m_jit.abortWithReason(DFGNegativeStringLength);
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index cd5e5da..adf6714 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -1208,7 +1208,7 @@
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);
diff --git a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.cpp b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.cpp
index d9d9c6c..1243321 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.cpp
+++ b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.cpp
@@ -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 @@
for (unsigned i = size(); i--;)
graph.assertIsRegistered(at(i).get());
}
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
void StructureAbstractValue::clobber()
{
diff --git a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
index 9107a8a..ddff717 100644
--- a/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
+++ b/Source/JavaScriptCore/dfg/DFGStructureAbstractValue.h
@@ -90,10 +90,10 @@
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();
diff --git a/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp b/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp
index 95cdc92..74ea618 100644
--- a/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGVarargsForwardingPhase.cpp
@@ -421,7 +421,7 @@
break;
default:
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
break;
m_graph.doToChildren(
node,
diff --git a/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp b/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp
index 7415acd..4e763ed 100644
--- a/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGVirtualRegisterAllocationPhase.cpp
@@ -55,7 +55,7 @@
continue;
if (!block->isReachable)
continue;
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
// Force usage of highest-numbered virtual registers.
scoreBoard.sortFree();
}
diff --git a/Source/JavaScriptCore/ftl/FTLLink.cpp b/Source/JavaScriptCore/ftl/FTLLink.cpp
index e307b09..3e0d58f 100644
--- a/Source/JavaScriptCore/ftl/FTLLink.cpp
+++ b/Source/JavaScriptCore/ftl/FTLLink.cpp
@@ -151,7 +151,7 @@
jit.jumpToExceptionHandler(vm);
noException.link(&jit);
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
jit.load64(vm.addressOfException(), GPRInfo::regT1);
jit.jitAssertIsNull(GPRInfo::regT1);
}
diff --git a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
index 47048da..eec481e 100644
--- a/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
+++ b/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
@@ -121,7 +121,7 @@
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 @@
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 @@
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 @@
{
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 @@
{
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 @@
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 @@
// 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();
}
diff --git a/Source/JavaScriptCore/ftl/FTLOperations.cpp b/Source/JavaScriptCore/ftl/FTLOperations.cpp
index 102c1e6..71f74dd 100644
--- a/Source/JavaScriptCore/ftl/FTLOperations.cpp
+++ b/Source/JavaScriptCore/ftl/FTLOperations.cpp
@@ -411,7 +411,7 @@
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 @@
}
ASSERT(found);
}
-#endif
+#endif // ASSERT_ENABLED
return array;
}
@@ -540,7 +540,7 @@
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 @@
}
ASSERT(found);
}
-#endif
+#endif // ASSERT_ENABLED
Vector<JSValue, 8> arguments;
arguments.grow(numProperties);
diff --git a/Source/JavaScriptCore/heap/BlockDirectory.cpp b/Source/JavaScriptCore/heap/BlockDirectory.cpp
index a8bd31f..12c9c6f 100644
--- a/Source/JavaScriptCore/heap/BlockDirectory.cpp
+++ b/Source/JavaScriptCore/heap/BlockDirectory.cpp
@@ -296,7 +296,7 @@
void BlockDirectory::assertNoUnswept()
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
if (m_bits.unswept().isEmpty())
diff --git a/Source/JavaScriptCore/heap/GCSegmentedArray.h b/Source/JavaScriptCore/heap/GCSegmentedArray.h
index b0c92af..d407d5a 100644
--- a/Source/JavaScriptCore/heap/GCSegmentedArray.h
+++ b/Source/JavaScriptCore/heap/GCSegmentedArray.h
@@ -40,7 +40,7 @@
public:
GCArraySegment()
: DoublyLinkedListNode<GCArraySegment<T>>()
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
, m_top(0)
#endif
{
@@ -58,7 +58,7 @@
GCArraySegment* m_prev;
GCArraySegment* m_next;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
size_t m_top;
#endif
};
diff --git a/Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h b/Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h
index 46858e6..3555de5 100644
--- a/Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h
+++ b/Source/JavaScriptCore/heap/GCSegmentedArrayInlines.h
@@ -62,7 +62,7 @@
}
m_top = 0;
m_numberOfSegments = 1;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
m_segments.head()->m_top = 0;
#endif
}
@@ -75,7 +75,7 @@
GCArraySegment<T>* nextSegment = GCArraySegment<T>::create();
m_numberOfSegments++;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
nextSegment->m_top = 0;
#endif
@@ -174,9 +174,7 @@
}
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 @@
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)
diff --git a/Source/JavaScriptCore/heap/HandleSet.cpp b/Source/JavaScriptCore/heap/HandleSet.cpp
index 7fa06ae..814070a 100644
--- a/Source/JavaScriptCore/heap/HandleSet.cpp
+++ b/Source/JavaScriptCore/heap/HandleSet.cpp
@@ -102,7 +102,7 @@
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 @@
return true;
}
-#endif
+#endif // ENABLE(GC_VALIDATION) || ASSERT_ENABLED
} // namespace JSC
diff --git a/Source/JavaScriptCore/heap/HandleSet.h b/Source/JavaScriptCore/heap/HandleSet.h
index 656f4c4..5d222d9 100644
--- a/Source/JavaScriptCore/heap/HandleSet.h
+++ b/Source/JavaScriptCore/heap/HandleSet.h
@@ -88,7 +88,7 @@
JS_EXPORT_PRIVATE void grow();
-#if ENABLE(GC_VALIDATION) || !ASSERT_DISABLED
+#if ENABLE(GC_VALIDATION) || ASSERT_ENABLED
bool isLiveNode(Node*);
#endif
diff --git a/Source/JavaScriptCore/heap/Heap.cpp b/Source/JavaScriptCore/heap/Heap.cpp
index 1adcb21..6be9171 100644
--- a/Source/JavaScriptCore/heap/Heap.cpp
+++ b/Source/JavaScriptCore/heap/Heap.cpp
@@ -2289,7 +2289,7 @@
// 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);
diff --git a/Source/JavaScriptCore/heap/Heap.h b/Source/JavaScriptCore/heap/Heap.h
index 1ce5d0c..237f18f 100644
--- a/Source/JavaScriptCore/heap/Heap.h
+++ b/Source/JavaScriptCore/heap/Heap.h
@@ -96,11 +96,7 @@
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;
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.cpp b/Source/JavaScriptCore/heap/MarkedBlock.cpp
index b4a9a96..d781126 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.cpp
+++ b/Source/JavaScriptCore/heap/MarkedBlock.cpp
@@ -265,12 +265,12 @@
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 @@
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)
{
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.h b/Source/JavaScriptCore/heap/MarkedBlock.h
index debcb55..e804e1b 100644
--- a/Source/JavaScriptCore/heap/MarkedBlock.h
+++ b/Source/JavaScriptCore/heap/MarkedBlock.h
@@ -352,10 +352,10 @@
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 @@
Dependency aboutToMark(HeapVersion markingVersion);
-#if ASSERT_DISABLED
- void assertMarksNotStale() { }
-#else
+#if ASSERT_ENABLED
JS_EXPORT_PRIVATE void assertMarksNotStale();
+#else
+ void assertMarksNotStale() { }
#endif
void resetMarks();
diff --git a/Source/JavaScriptCore/heap/MarkedSpace.cpp b/Source/JavaScriptCore/heap/MarkedSpace.cpp
index d408d6e..149ce8d 100644
--- a/Source/JavaScriptCore/heap/MarkedSpace.cpp
+++ b/Source/JavaScriptCore/heap/MarkedSpace.cpp
@@ -437,7 +437,7 @@
allocation->flip();
}
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
forEachBlock(
[&] (MarkedBlock::Handle* block) {
if (block->areMarksStale())
@@ -463,7 +463,7 @@
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::assertNoUnswept()
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
forEachDirectory(
[&] (BlockDirectory& directory) -> IterationStatus {
diff --git a/Source/JavaScriptCore/heap/PreciseAllocation.cpp b/Source/JavaScriptCore/heap/PreciseAllocation.cpp
index 5ddcc1b..6cbaec1 100644
--- a/Source/JavaScriptCore/heap/PreciseAllocation.cpp
+++ b/Source/JavaScriptCore/heap/PreciseAllocation.cpp
@@ -250,7 +250,7 @@
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());
diff --git a/Source/JavaScriptCore/heap/PreciseAllocation.h b/Source/JavaScriptCore/heap/PreciseAllocation.h
index 466459f..10eb67d 100644
--- a/Source/JavaScriptCore/heap/PreciseAllocation.h
+++ b/Source/JavaScriptCore/heap/PreciseAllocation.h
@@ -142,10 +142,10 @@
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();
diff --git a/Source/JavaScriptCore/heap/SlotVisitor.cpp b/Source/JavaScriptCore/heap/SlotVisitor.cpp
index 0c2eb41..1a7164e 100644
--- a/Source/JavaScriptCore/heap/SlotVisitor.cpp
+++ b/Source/JavaScriptCore/heap/SlotVisitor.cpp
@@ -89,7 +89,7 @@
, 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 @@
// 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))
diff --git a/Source/JavaScriptCore/heap/SlotVisitor.h b/Source/JavaScriptCore/heap/SlotVisitor.h
index 48c6403..306275b 100644
--- a/Source/JavaScriptCore/heap/SlotVisitor.h
+++ b/Source/JavaScriptCore/heap/SlotVisitor.h
@@ -266,7 +266,7 @@
// 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
diff --git a/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h b/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
index 5b1565b..d7010a5 100644
--- a/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
+++ b/Source/JavaScriptCore/inspector/InspectorProtocolTypes.h
@@ -57,16 +57,16 @@
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
}
};
diff --git a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
index 863553c..65cebf5 100755
--- a/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
+++ b/Source/JavaScriptCore/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py
@@ -213,9 +213,7 @@
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 @@
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 @@
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 @@
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)
diff --git a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
index c96a166..e84dacd 100644
--- a/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
+++ b/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
@@ -709,22 +709,20 @@
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 @@
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 @@
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 @@
}
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 @@
}
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
diff --git a/Source/JavaScriptCore/interpreter/FrameTracers.h b/Source/JavaScriptCore/interpreter/FrameTracers.h
index f8d35f7..56feb25 100644
--- a/Source/JavaScriptCore/interpreter/FrameTracers.h
+++ b/Source/JavaScriptCore/interpreter/FrameTracers.h
@@ -106,7 +106,7 @@
class JITOperationPrologueCallFrameTracer {
public:
ALWAYS_INLINE JITOperationPrologueCallFrameTracer(VM& vm, CallFrame* callFrame)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
: m_vm(vm)
#endif
{
@@ -116,7 +116,7 @@
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 @@
#endif
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
~JITOperationPrologueCallFrameTracer()
{
// Fill vm.topCallFrame with invalid value when leaving from JIT operation functions.
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.cpp b/Source/JavaScriptCore/interpreter/Interpreter.cpp
index 8ef1c3d..e7e0e44 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.cpp
+++ b/Source/JavaScriptCore/interpreter/Interpreter.cpp
@@ -335,7 +335,7 @@
, 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 @@
RELEASE_ASSERT(getOpcodeID(getOpcode(opcodeID)) == opcodeID);
}
});
-#endif // USE(LLINT_EMBEDDED_OPCODE_ID)
+#endif // ASSERT_ENABLED
}
Interpreter::~Interpreter()
@@ -351,7 +351,7 @@
}
#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 @@
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 @@
return opcode >= 0 && opcode <= op_end;
#endif
}
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
class GetStackTraceFunctor {
public:
diff --git a/Source/JavaScriptCore/interpreter/Interpreter.h b/Source/JavaScriptCore/interpreter/Interpreter.h
index ff1b4e8..e83f489 100644
--- a/Source/JavaScriptCore/interpreter/Interpreter.h
+++ b/Source/JavaScriptCore/interpreter/Interpreter.h
@@ -100,7 +100,7 @@
static inline OpcodeID getOpcodeID(Opcode);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
static bool isOpcode(Opcode);
#endif
@@ -144,9 +144,9 @@
#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)
};
diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.cpp b/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
index 9ee9163..eb8082e 100644
--- a/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.cpp
@@ -100,7 +100,7 @@
}
#endif
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
#if USE(JSVALUE64)
void AssemblyHelpers::jitAssertIsInt32(GPRReg gpr)
{
@@ -216,7 +216,7 @@
ok.link(this);
}
-#endif // !ASSERT_DISABLED
+#endif // ASSERT_ENABLED
void AssemblyHelpers::jitReleaseAssertNoException(VM& vm)
{
@@ -315,7 +315,7 @@
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);
diff --git a/Source/JavaScriptCore/jit/AssemblyHelpers.h b/Source/JavaScriptCore/jit/AssemblyHelpers.h
index 24277bd..a3afdc4 100644
--- a/Source/JavaScriptCore/jit/AssemblyHelpers.h
+++ b/Source/JavaScriptCore/jit/AssemblyHelpers.h
@@ -69,7 +69,7 @@
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 @@
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);
diff --git a/Source/JavaScriptCore/jit/BinarySwitch.cpp b/Source/JavaScriptCore/jit/BinarySwitch.cpp
index 7a2bd90..f38a65d 100644
--- a/Source/JavaScriptCore/jit/BinarySwitch.cpp
+++ b/Source/JavaScriptCore/jit/BinarySwitch.cpp
@@ -60,7 +60,7 @@
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
diff --git a/Source/JavaScriptCore/jit/CCallHelpers.h b/Source/JavaScriptCore/jit/CCallHelpers.h
index 11fe37a..35d509b 100644
--- a/Source/JavaScriptCore/jit/CCallHelpers.h
+++ b/Source/JavaScriptCore/jit/CCallHelpers.h
@@ -89,7 +89,7 @@
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 @@
pairs.append(std::make_pair(sources[i], destinations[i]));
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
auto numUniqueSources = [&] () -> unsigned {
RegisterSet set;
for (auto& pair : pairs) {
diff --git a/Source/JavaScriptCore/jit/CallFrameShuffler.cpp b/Source/JavaScriptCore/jit/CallFrameShuffler.cpp
index a2ea462..d8d06cf 100644
--- a/Source/JavaScriptCore/jit/CallFrameShuffler.cpp
+++ b/Source/JavaScriptCore/jit/CallFrameShuffler.cpp
@@ -292,7 +292,7 @@
void CallFrameShuffler::emitDeltaCheck()
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
GPRReg scratchGPR { getFreeGPR() };
@@ -725,7 +725,7 @@
// 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));
diff --git a/Source/JavaScriptCore/jit/JIT.cpp b/Source/JavaScriptCore/jit/JIT.cpp
index efa78bc..724578d 100644
--- a/Source/JavaScriptCore/jit/JIT.cpp
+++ b/Source/JavaScriptCore/jit/JIT.cpp
@@ -126,7 +126,7 @@
void JIT::assertStackPointerOffset()
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
addPtr(TrustedImm32(stackPointerOffsetFor(m_codeBlock) * sizeof(Register)), callFrameRegister, regT0);
@@ -770,7 +770,7 @@
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
diff --git a/Source/JavaScriptCore/jit/JITOpcodes.cpp b/Source/JavaScriptCore/jit/JITOpcodes.cpp
index 2795f97..9c82bb4 100644
--- a/Source/JavaScriptCore/jit/JITOpcodes.cpp
+++ b/Source/JavaScriptCore/jit/JITOpcodes.cpp
@@ -1059,7 +1059,7 @@
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);
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
index e729fc0..abf52f71 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
@@ -821,7 +821,7 @@
}));
load32(operandSlot, offset);
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));
abortWithReason(JITOffsetIsNotOutOfLine);
isOutOfLine.link(this);
diff --git a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
index 87d2699..b024b65 100644
--- a/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
+++ b/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
@@ -840,7 +840,7 @@
move(regT0, base);
load32(operandSlot, offset);
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
Jump isOutOfLine = branch32(GreaterThanOrEqual, offset, TrustedImm32(firstOutOfLineOffset));
abortWithReason(JITOffsetIsNotOutOfLine);
isOutOfLine.link(this);
diff --git a/Source/JavaScriptCore/jit/Repatch.cpp b/Source/JavaScriptCore/jit/Repatch.cpp
index de3ee23..0726f4e 100644
--- a/Source/JavaScriptCore/jit/Repatch.cpp
+++ b/Source/JavaScriptCore/jit/Repatch.cpp
@@ -1145,7 +1145,7 @@
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: ");
diff --git a/Source/JavaScriptCore/jit/ThunkGenerators.cpp b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
index f961f0e..71a4ac7 100644
--- a/Source/JavaScriptCore/jit/ThunkGenerators.cpp
+++ b/Source/JavaScriptCore/jit/ThunkGenerators.cpp
@@ -48,7 +48,7 @@
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);
diff --git a/Source/JavaScriptCore/llint/LLIntData.cpp b/Source/JavaScriptCore/llint/LLIntData.cpp
index f50a17b..39a5412 100644
--- a/Source/JavaScriptCore/llint/LLIntData.cpp
+++ b/Source/JavaScriptCore/llint/LLIntData.cpp
@@ -139,7 +139,7 @@
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);
diff --git a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
index aa3ec34..52435a6 100644
--- a/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
+++ b/Source/JavaScriptCore/llint/LLIntOfflineAsmConfig.h
@@ -142,7 +142,7 @@
#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
diff --git a/Source/JavaScriptCore/parser/Lexer.cpp b/Source/JavaScriptCore/parser/Lexer.cpp
index c691dac..c341f49 100644
--- a/Source/JavaScriptCore/parser/Lexer.cpp
+++ b/Source/JavaScriptCore/parser/Lexer.cpp
@@ -905,7 +905,7 @@
}
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
bool isSafeBuiltinIdentifier(VM& vm, const Identifier* ident)
{
if (!ident)
@@ -924,7 +924,7 @@
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)
diff --git a/Source/JavaScriptCore/parser/Lexer.h b/Source/JavaScriptCore/parser/Lexer.h
index c7a14db..fd82580 100644
--- a/Source/JavaScriptCore/parser/Lexer.h
+++ b/Source/JavaScriptCore/parser/Lexer.h
@@ -333,11 +333,11 @@
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 @@
// Create the identifier if needed
if (lexerFlags.contains(LexerFlags::DontBuildKeywords)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
&& !m_parsingBuiltinFunction
#endif
)
@@ -390,7 +390,7 @@
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;
diff --git a/Source/JavaScriptCore/runtime/ArgList.h b/Source/JavaScriptCore/runtime/ArgList.h
index 8f505cc..949b9b0 100644
--- a/Source/JavaScriptCore/runtime/ArgList.h
+++ b/Source/JavaScriptCore/runtime/ArgList.h
@@ -165,15 +165,15 @@
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];
diff --git a/Source/JavaScriptCore/runtime/Butterfly.h b/Source/JavaScriptCore/runtime/Butterfly.h
index c05456a..49351c7 100644
--- a/Source/JavaScriptCore/runtime/Butterfly.h
+++ b/Source/JavaScriptCore/runtime/Butterfly.h
@@ -43,7 +43,7 @@
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 Data {
Data(T& location, IndexingType indexingMode)
: m_data(location)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
, m_isWritable(!isCopyOnWrite(indexingMode))
#endif
{
@@ -103,7 +103,7 @@
T& m_data;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
bool m_isWritable;
#endif
};
@@ -114,13 +114,13 @@
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
};
diff --git a/Source/JavaScriptCore/runtime/HashMapImpl.h b/Source/JavaScriptCore/runtime/HashMapImpl.h
index d116d64..ec3feb6 100644
--- a/Source/JavaScriptCore/runtime/HashMapImpl.h
+++ b/Source/JavaScriptCore/runtime/HashMapImpl.h
@@ -703,7 +703,7 @@
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 @@
ALWAYS_INLINE void assertBufferIsEmpty() const
{
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
for (unsigned i = 0; i < m_capacity; i++)
ASSERT(isEmpty(buffer()[i]));
}
diff --git a/Source/JavaScriptCore/runtime/JSCellInlines.h b/Source/JavaScriptCore/runtime/JSCellInlines.h
index f6a32b2..2daf7bc 100644
--- a/Source/JavaScriptCore/runtime/JSCellInlines.h
+++ b/Source/JavaScriptCore/runtime/JSCellInlines.h
@@ -292,7 +292,7 @@
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
diff --git a/Source/JavaScriptCore/runtime/JSFunction.cpp b/Source/JavaScriptCore/runtime/JSFunction.cpp
index cb9345c..34e6585 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.cpp
+++ b/Source/JavaScriptCore/runtime/JSFunction.cpp
@@ -909,7 +909,7 @@
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 @@
else
RELEASE_ASSERT(info != JSBoundFunction::info());
}
-#endif
+#endif // ASSERT_ENABLED
} // namespace JSC
diff --git a/Source/JavaScriptCore/runtime/JSFunction.h b/Source/JavaScriptCore/runtime/JSFunction.h
index 4892352..addde2a 100644
--- a/Source/JavaScriptCore/runtime/JSFunction.h
+++ b/Source/JavaScriptCore/runtime/JSFunction.h
@@ -210,10 +210,10 @@
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;
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
index 247607c..58c1aee 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
@@ -299,7 +299,7 @@
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 @@
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 @@
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
};
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.h b/Source/JavaScriptCore/runtime/JSGlobalObject.h
index f30b93c..ce3df49 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalObject.h
+++ b/Source/JavaScriptCore/runtime/JSGlobalObject.h
@@ -511,7 +511,7 @@
ConsoleClient* m_consoleClient { nullptr };
Optional<unsigned> m_stackTraceLimit;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
const JSGlobalObject* m_globalObjectAtDebuggerEntry { nullptr };
#endif
@@ -963,7 +963,7 @@
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
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp
index b73b5d4..64f95e1 100644
--- a/Source/JavaScriptCore/runtime/JSObject.cpp
+++ b/Source/JavaScriptCore/runtime/JSObject.cpp
@@ -436,7 +436,7 @@
{
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 @@
thisObject->visitButterfly(visitor);
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
#endif
}
@@ -492,7 +492,7 @@
{
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 @@
visitor.appendValuesHidden(thisObject->inlineStorage(), storageSize);
}
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
visitor.m_isCheckingForDefaultMarkViolation = wasCheckingForDefaultMarkViolation;
#endif
}
diff --git a/Source/JavaScriptCore/runtime/JSObjectInlines.h b/Source/JavaScriptCore/runtime/JSObjectInlines.h
index 06a714f7..b241aea 100644
--- a/Source/JavaScriptCore/runtime/JSObjectInlines.h
+++ b/Source/JavaScriptCore/runtime/JSObjectInlines.h
@@ -477,7 +477,7 @@
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 @@
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)
diff --git a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
index 4dcfd07..31ee397 100644
--- a/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
+++ b/Source/JavaScriptCore/runtime/JSSegmentedVariableObject.h
@@ -77,7 +77,7 @@
WriteBarrier<Unknown>* assertVariableIsInThisObject(WriteBarrier<Unknown>* variablePointer)
{
- if (!ASSERT_DISABLED)
+ if (ASSERT_ENABLED)
findVariableIndex(variablePointer);
return variablePointer;
}
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.cpp b/Source/JavaScriptCore/runtime/LiteralParser.cpp
index 50f1eca..6976f70 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.cpp
+++ b/Source/JavaScriptCore/runtime/LiteralParser.cpp
@@ -438,7 +438,7 @@
template <typename CharType>
ALWAYS_INLINE TokenType LiteralParser<CharType>::Lexer::lex(LiteralParserToken<CharType>& token)
{
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
m_currentTokenID++;
#endif
diff --git a/Source/JavaScriptCore/runtime/LiteralParser.h b/Source/JavaScriptCore/runtime/LiteralParser.h
index 93da4ad..670c9ae 100644
--- a/Source/JavaScriptCore/runtime/LiteralParser.h
+++ b/Source/JavaScriptCore/runtime/LiteralParser.h
@@ -134,7 +134,7 @@
TokenType next();
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
typedef const LiteralParserToken<CharType>* LiteralParserTokenPtr;
LiteralParserTokenPtr currentToken()
@@ -167,7 +167,7 @@
{
return LiteralParserTokenPtr(*this);
}
-#endif
+#endif // ASSERT_ENABLED
String getErrorMessage() { return m_lexErrorMessage; }
@@ -183,7 +183,7 @@
const CharType* m_ptr;
const CharType* m_end;
StringBuilder m_builder;
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
unsigned m_currentTokenID { 0 };
#endif
};
diff --git a/Source/JavaScriptCore/runtime/Operations.h b/Source/JavaScriptCore/runtime/Operations.h
index 2c365c4..4bbe23c 100644
--- a/Source/JavaScriptCore/runtime/Operations.h
+++ b/Source/JavaScriptCore/runtime/Operations.h
@@ -501,7 +501,7 @@
inline bool scribbleFreeCells()
{
- return !ASSERT_DISABLED || Options::scribbleFreeCells();
+ return ASSERT_ENABLED || Options::scribbleFreeCells();
}
#define SCRIBBLE_WORD static_cast<intptr_t>(0xbadbeef0)
diff --git a/Source/JavaScriptCore/runtime/OptionsList.h b/Source/JavaScriptCore/runtime/OptionsList.h
index 03f2852..8acc27e 100644
--- a/Source/JavaScriptCore/runtime/OptionsList.h
+++ b/Source/JavaScriptCore/runtime/OptionsList.h
@@ -221,8 +221,8 @@
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) \
diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp
index 52b7bbd..9c6c00c 100644
--- a/Source/JavaScriptCore/runtime/VM.cpp
+++ b/Source/JavaScriptCore/runtime/VM.cpp
@@ -219,7 +219,7 @@
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 @@
void VM::computeCanUseJIT()
{
#if ENABLE(JIT)
-#if !ASSERT_DISABLED
+#if ASSERT_ENABLED
RELEASE_ASSERT(!s_canUseJITIsSet);
s_canUseJITIsSet = true;
#endif
diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h
index c9ad516..abec994 100644
--- a/Source/JavaScriptCore/runtime/VM.h
+++ b/Source/JavaScriptCore/runtime/VM.h
@@ -808,9 +808,7 @@
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 @@
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;
diff --git a/Source/JavaScriptCore/runtime/VarOffset.h b/Source/JavaScriptCore/runtime/VarOffset.h
index 5c894f1..2002f9d 100644
--- a/Source/JavaScriptCore/runtime/VarOffset.h
+++ b/Source/JavaScriptCore/runtime/VarOffset.h
@@ -169,7 +169,7 @@
void checkSanity() const
{
- if (ASSERT_DISABLED)
+ if (!ASSERT_ENABLED)
return;
switch (m_kind) {
diff --git a/Source/JavaScriptCore/runtime/WeakMapImpl.h b/Source/JavaScriptCore/runtime/WeakMapImpl.h
index 9946d5d..db816391 100644
--- a/Source/JavaScriptCore/runtime/WeakMapImpl.h
+++ b/Source/JavaScriptCore/runtime/WeakMapImpl.h
@@ -444,7 +444,7 @@
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 @@
ALWAYS_INLINE void assertBufferIsEmpty() const
{
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
for (unsigned i = 0; i < m_capacity; i++)
ASSERT((buffer() + i)->isEmpty());
}
diff --git a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
index 59b8bf2..27201e8 100644
--- a/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
+++ b/Source/JavaScriptCore/wasm/WasmAirIRGenerator.cpp
@@ -331,7 +331,7 @@
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");
diff --git a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
index a118fbf..c79f498 100644
--- a/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
+++ b/Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp
@@ -1993,7 +1993,7 @@
irGenerator.insertConstants();
procedure.resetReachability();
- if (!ASSERT_DISABLED)
+ if (ASSERT_ENABLED)
validate(procedure, "After parsing:\n");
dataLogIf(WasmB3IRGeneratorInternal::verbose, "Pre SSA: ", procedure);
diff --git a/Source/JavaScriptCore/wasm/WasmFunctionParser.h b/Source/JavaScriptCore/wasm/WasmFunctionParser.h
index 1f7e06a..723a033 100644
--- a/Source/JavaScriptCore/wasm/WasmFunctionParser.h
+++ b/Source/JavaScriptCore/wasm/WasmFunctionParser.h
@@ -133,7 +133,7 @@
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;
diff --git a/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp b/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
index ab80f6f..579d27b 100644
--- a/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
+++ b/Source/JavaScriptCore/wasm/WasmLLIntGenerator.cpp
@@ -341,7 +341,7 @@
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 @@
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)
diff --git a/Source/JavaScriptCore/wasm/WasmPlan.cpp b/Source/JavaScriptCore/wasm/WasmPlan.cpp
index 3565f76..fd45bad 100644
--- a/Source/JavaScriptCore/wasm/WasmPlan.cpp
+++ b/Source/JavaScriptCore/wasm/WasmPlan.cpp
@@ -89,7 +89,7 @@
{
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);
diff --git a/Source/JavaScriptCore/wasm/WasmSectionParser.h b/Source/JavaScriptCore/wasm/WasmSectionParser.h
index 48337142..5277a7a 100644
--- a/Source/JavaScriptCore/wasm/WasmSectionParser.h
+++ b/Source/JavaScriptCore/wasm/WasmSectionParser.h
@@ -54,7 +54,7 @@
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)...));
diff --git a/Source/JavaScriptCore/wasm/WasmSections.h b/Source/JavaScriptCore/wasm/WasmSections.h
index b097d14..b88ee74 100644
--- a/Source/JavaScriptCore/wasm/WasmSections.h
+++ b/Source/JavaScriptCore/wasm/WasmSections.h
@@ -27,7 +27,7 @@
#if ENABLE(WEBASSEMBLY)
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_BEGIN
#endif
@@ -106,7 +106,7 @@
} } // namespace JSC::Wasm
-#if ASSERT_DISABLED
+#if !ASSERT_ENABLED
IGNORE_RETURN_TYPE_WARNINGS_END
#endif
diff --git a/Source/JavaScriptCore/wasm/WasmSignatureInlines.h b/Source/JavaScriptCore/wasm/WasmSignatureInlines.h
index 510ac3e..dee6f7a 100644
--- a/Source/JavaScriptCore/wasm/WasmSignatureInlines.h
+++ b/Source/JavaScriptCore/wasm/WasmSignatureInlines.h
@@ -48,7 +48,7 @@
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)) }));
diff --git a/Source/JavaScriptCore/wasm/WasmWorklist.cpp b/Source/JavaScriptCore/wasm/WasmWorklist.cpp
index fa716e2..4b596d1 100644
--- a/Source/JavaScriptCore/wasm/WasmWorklist.cpp
+++ b/Source/JavaScriptCore/wasm/WasmWorklist.cpp
@@ -146,7 +146,7 @@
{
LockHolder locker(*m_lock);
- if (!ASSERT_DISABLED) {
+ if (ASSERT_ENABLED) {
for (const auto& element : m_queue)
ASSERT_UNUSED(element, element.plan.get() != &plan.get());
}
diff --git a/Source/JavaScriptCore/wasm/js/JSToWasm.cpp b/Source/JavaScriptCore/wasm/js/JSToWasm.cpp
index 2587740..016ae53 100644
--- a/Source/JavaScriptCore/wasm/js/JSToWasm.cpp
+++ b/Source/JavaScriptCore/wasm/js/JSToWasm.cpp
@@ -143,7 +143,7 @@
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());
diff --git a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
index c3949c8..44f99be 100644
--- a/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
+++ b/Source/JavaScriptCore/wasm/js/WebAssemblyFunction.cpp
@@ -173,7 +173,7 @@
{
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();