1. 18 Oct, 2013 1 commit
    • andersca@apple.com's avatar
      Remove spaces between template angle brackets · c3523f8d
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=123040
      
      Reviewed by Andreas Kling.
      
      Source/JavaScriptCore:
      
      * API/JSCallbackObject.cpp:
      (JSC::::create):
      * API/JSObjectRef.cpp:
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::constants):
      (JSC::CodeBlock::setConstantRegisters):
      * bytecode/DFGExitProfile.h:
      * bytecode/EvalCodeCache.h:
      * bytecode/Operands.h:
      * bytecode/UnlinkedCodeBlock.h:
      (JSC::UnlinkedCodeBlock::constantRegisters):
      * bytecode/Watchpoint.h:
      * bytecompiler/BytecodeGenerator.h:
      * bytecompiler/StaticPropertyAnalysis.h:
      * bytecompiler/StaticPropertyAnalyzer.h:
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      * dfg/DFGBlockInsertionSet.h:
      * dfg/DFGCSEPhase.cpp:
      (JSC::DFG::performCSE):
      (JSC::DFG::performStoreElimination):
      * dfg/DFGCommonData.h:
      * dfg/DFGDesiredStructureChains.h:
      * dfg/DFGDesiredWatchpoints.h:
      * dfg/DFGJITCompiler.h:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGWorklist.h:
      * heap/BlockAllocator.h:
      (JSC::CopiedBlock):
      (JSC::MarkedBlock):
      (JSC::WeakBlock):
      (JSC::MarkStackSegment):
      (JSC::CopyWorkListSegment):
      (JSC::HandleBlock):
      * heap/Heap.h:
      * heap/Local.h:
      * heap/MarkedBlock.h:
      * heap/Strong.h:
      * jit/AssemblyHelpers.cpp:
      (JSC::AssemblyHelpers::decodedCodeMapFor):
      * jit/AssemblyHelpers.h:
      * jit/SpecializedThunkJIT.h:
      * parser/Nodes.h:
      * parser/Parser.cpp:
      (JSC::::parseIfStatement):
      * parser/Parser.h:
      (JSC::Scope::copyCapturedVariablesToVector):
      (JSC::parse):
      * parser/ParserArena.h:
      * parser/SourceProviderCacheItem.h:
      * profiler/LegacyProfiler.cpp:
      (JSC::dispatchFunctionToProfiles):
      * profiler/LegacyProfiler.h:
      (JSC::LegacyProfiler::currentProfiles):
      * profiler/ProfileNode.h:
      (JSC::ProfileNode::children):
      * profiler/ProfilerDatabase.h:
      * runtime/Butterfly.h:
      (JSC::Butterfly::contiguousInt32):
      (JSC::Butterfly::contiguous):
      * runtime/GenericTypedArrayViewInlines.h:
      (JSC::::create):
      * runtime/Identifier.h:
      (JSC::Identifier::add):
      * runtime/JSPromise.h:
      * runtime/PropertyMapHashTable.h:
      * runtime/PropertyNameArray.h:
      * runtime/RegExpCache.h:
      * runtime/SparseArrayValueMap.h:
      * runtime/SymbolTable.h:
      * runtime/VM.h:
      * tools/CodeProfile.cpp:
      (JSC::truncateTrace):
      * tools/CodeProfile.h:
      * yarr/YarrInterpreter.cpp:
      * yarr/YarrInterpreter.h:
      (JSC::Yarr::BytecodePattern::BytecodePattern):
      * yarr/YarrJIT.cpp:
      (JSC::Yarr::YarrGenerator::opCompileParenthesesSubpattern):
      (JSC::Yarr::YarrGenerator::opCompileParentheticalAssertion):
      (JSC::Yarr::YarrGenerator::opCompileBody):
      * yarr/YarrPattern.cpp:
      (JSC::Yarr::YarrPatternConstructor::checkForTerminalParentheses):
      (JSC::Yarr::YarrPatternConstructor::optimizeDotStarWrappedExpressions):
      * yarr/YarrPattern.h:
      
      Source/WebCore:
      
      * Modules/encryptedmedia/MediaKeySession.h:
      * Modules/encryptedmedia/MediaKeys.h:
      * Modules/geolocation/Geolocation.h:
      * Modules/geolocation/GeolocationController.cpp:
      (WebCore::GeolocationController::positionChanged):
      (WebCore::GeolocationController::errorOccurred):
      * Modules/geolocation/GeolocationController.h:
      * Modules/indexeddb/IDBCallbacks.h:
      * Modules/indexeddb/IDBDatabase.h:
      * Modules/indexeddb/IDBDatabaseBackendInterface.h:
      * Modules/indexeddb/IDBEventDispatcher.cpp:
      (WebCore::IDBEventDispatcher::dispatch):
      * Modules/indexeddb/IDBEventDispatcher.h:
      * Modules/indexeddb/IDBKey.h:
      * Modules/indexeddb/IDBObjectStore.h:
      * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
      * Modules/indexeddb/IDBRequest.cpp:
      (WebCore::IDBRequest::dispatchEvent):
      * Modules/indexeddb/IDBRequest.h:
      (WebCore::IDBRequest::onSuccessWithPrefetch):
      * Modules/indexeddb/IDBTransaction.cpp:
      (WebCore::IDBTransaction::dispatchEvent):
      * Modules/indexeddb/IDBTransaction.h:
      * Modules/mediacontrols/MediaControlsHost.cpp:
      (WebCore::MediaControlsHost::sortedTrackListForMenu):
      * Modules/mediacontrols/MediaControlsHost.h:
      * Modules/mediasource/MediaSource.cpp:
      (WebCore::MediaSource::activeRanges):
      * Modules/mediasource/MediaSource.h:
      * Modules/mediasource/MediaSourceBase.cpp:
      (WebCore::MediaSourceBase::buffered):
      * Modules/mediasource/MediaSourceBase.h:
      * Modules/mediasource/MediaSourceRegistry.cpp:
      (WebCore::MediaSourceRegistry::unregisterURL):
      * Modules/mediasource/MediaSourceRegistry.h:
      * Modules/mediasource/SourceBufferList.h:
      * Modules/mediasource/WebKitMediaSource.cpp:
      (WebCore::WebKitMediaSource::activeRanges):
      * Modules/mediasource/WebKitMediaSource.h:
      * Modules/mediasource/WebKitSourceBufferList.h:
      * Modules/mediastream/MediaStream.cpp:
      (WebCore::MediaStream::scheduledEventTimerFired):
      * Modules/mediastream/MediaStream.h:
      * Modules/mediastream/MediaStreamRegistry.h:
      * Modules/mediastream/MediaStreamTrack.h:
      * Modules/mediastream/RTCDTMFSender.cpp:
      (WebCore::RTCDTMFSender::scheduledEventTimerFired):
      * Modules/mediastream/RTCDTMFSender.h:
      * Modules/mediastream/RTCDataChannel.cpp:
      (WebCore::RTCDataChannel::scheduledEventTimerFired):
      * Modules/mediastream/RTCDataChannel.h:
      * Modules/mediastream/RTCPeerConnection.cpp:
      (WebCore::RTCPeerConnection::stop):
      (WebCore::RTCPeerConnection::scheduledEventTimerFired):
      * Modules/mediastream/RTCPeerConnection.h:
      * Modules/mediastream/RTCStatsResponse.h:
      (WebCore::RTCStatsResponse::result):
      * Modules/notifications/Notification.h:
      * Modules/notifications/NotificationCenter.h:
      * Modules/speech/SpeechSynthesis.cpp:
      (WebCore::SpeechSynthesis::getVoices):
      * Modules/speech/SpeechSynthesis.h:
      * Modules/webaudio/AudioBuffer.h:
      * Modules/webaudio/AudioNode.h:
      * Modules/webaudio/AudioNodeOutput.h:
      * Modules/webaudio/MediaStreamAudioSource.cpp:
      (WebCore::MediaStreamAudioSource::setAudioFormat):
      (WebCore::MediaStreamAudioSource::consumeAudio):
      * Modules/webaudio/PeriodicWave.h:
      * Modules/webaudio/ScriptProcessorNode.h:
      * Modules/webdatabase/AbstractDatabaseServer.h:
      * Modules/webdatabase/DatabaseBackend.h:
      * Modules/webdatabase/DatabaseManager.cpp:
      (WebCore::DatabaseManager::origins):
      * Modules/webdatabase/DatabaseManager.h:
      * Modules/webdatabase/DatabaseServer.cpp:
      (WebCore::DatabaseServer::origins):
      * Modules/webdatabase/DatabaseServer.h:
      * Modules/webdatabase/DatabaseThread.h:
      * Modules/webdatabase/DatabaseTracker.cpp:
      (WebCore::DatabaseTracker::interruptAllDatabasesForContext):
      (WebCore::DatabaseTracker::origins):
      (WebCore::DatabaseTracker::getOpenDatabases):
      (WebCore::DatabaseTracker::deleteAllDatabases):
      (WebCore::DatabaseTracker::deleteDatabaseFile):
      * Modules/webdatabase/DatabaseTracker.h:
      * Modules/webdatabase/SQLStatementBackend.cpp:
      * Modules/webdatabase/SQLTransactionBackend.cpp:
      * Modules/webdatabase/SQLTransactionBackend.h:
      * Modules/webdatabase/SQLTransactionCoordinator.cpp:
      (WebCore::SQLTransactionCoordinator::shutdown):
      * Modules/webdatabase/SQLTransactionCoordinator.h:
      * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
      (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
      (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
      (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryDataCallback):
      * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
      * Modules/websockets/WebSocket.cpp:
      (WebCore::WebSocket::didReceiveBinaryData):
      * Modules/websockets/WebSocket.h:
      * Modules/websockets/WebSocketChannel.cpp:
      (WebCore::WebSocketChannel::processFrame):
      * Modules/websockets/WebSocketChannel.h:
      * Modules/websockets/WebSocketChannelClient.h:
      (WebCore::WebSocketChannelClient::didReceiveBinaryData):
      * Modules/websockets/WebSocketExtensionDispatcher.h:
      * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
      (WebCore::workerGlobalScopeDidReceiveBinaryData):
      (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
      (WebCore::WorkerThreadableWebSocketChannel::mainThreadSendArrayBuffer):
      (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
      * Modules/websockets/WorkerThreadableWebSocketChannel.h:
      * accessibility/AXObjectCache.cpp:
      (WebCore::AXObjectCache::~AXObjectCache):
      * accessibility/AXObjectCache.h:
      * accessibility/AccessibilityNodeObject.cpp:
      (WebCore::AccessibilityNodeObject::ariaLabeledByText):
      * accessibility/AccessibilityObject.h:
      (WebCore::AccessibilityText::AccessibilityText):
      * bindings/js/DOMWrapperWorld.h:
      * bindings/js/JSDOMBinding.h:
      (WebCore::toRefPtrNativeArray):
      * bindings/js/JSDOMGlobalObject.h:
      * bindings/js/JSMutationCallback.cpp:
      (WebCore::JSMutationCallback::call):
      * bindings/js/JSMutationCallback.h:
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::JSWebGLRenderingContext::getAttachedShaders):
      * bindings/js/PageScriptDebugServer.h:
      * bindings/js/ScheduledAction.h:
      * bindings/js/ScriptController.cpp:
      (WebCore::ScriptController::collectIsolatedContexts):
      * bindings/js/ScriptController.h:
      * bindings/js/ScriptDebugServer.h:
      * bindings/js/ScriptProfile.cpp:
      (WebCore::buildInspectorObjectFor):
      * bindings/objc/ObjCNodeFilterCondition.h:
      * bridge/objc/objc_class.h:
      * bridge/runtime_root.cpp:
      (JSC::Bindings::RootObject::invalidate):
      * bridge/runtime_root.h:
      * css/BasicShapeFunctions.cpp:
      (WebCore::basicShapeForValue):
      * css/CSSBasicShapes.h:
      (WebCore::CSSBasicShapePolygon::values):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::ComputedStyleExtractor::valueForFilter):
      * css/CSSFontFace.h:
      * css/CSSFontFaceSource.h:
      * css/CSSFontSelector.cpp:
      (WebCore::CSSFontSelector::addFontFaceRule):
      (WebCore::CSSFontSelector::getFontFace):
      (WebCore::CSSFontSelector::beginLoadTimerFired):
      * css/CSSFontSelector.h:
      * css/CSSGroupingRule.h:
      * css/CSSImageGeneratorValue.h:
      * css/CSSParserValues.cpp:
      (WebCore::CSSParserSelector::adoptSelectorVector):
      * css/CSSParserValues.h:
      * css/CSSPropertySourceData.h:
      * css/CSSRuleList.h:
      (WebCore::StaticCSSRuleList::rules):
      * css/CSSSegmentedFontFace.cpp:
      (WebCore::CSSSegmentedFontFace::fontLoaded):
      * css/CSSSegmentedFontFace.h:
      * css/CSSSelectorList.cpp:
      (WebCore::CSSSelectorList::adoptSelectorVector):
      * css/CSSSelectorList.h:
      * css/CSSStyleSheet.h:
      * css/CSSValue.h:
      (WebCore::compareCSSValueVector):
      * css/CSSValuePool.h:
      * css/DocumentRuleSets.cpp:
      (WebCore::DocumentRuleSets::collectRulesFromUserStyleSheets):
      (WebCore::DocumentRuleSets::appendAuthorStyleSheets):
      * css/DocumentRuleSets.h:
      * css/ElementRuleCollector.cpp:
      (WebCore::ElementRuleCollector::matchedRuleList):
      * css/ElementRuleCollector.h:
      * css/FontLoader.h:
      * css/InspectorCSSOMWrappers.cpp:
      (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
      (WebCore::InspectorCSSOMWrappers::collectFromStyleSheets):
      * css/InspectorCSSOMWrappers.h:
      * css/MediaList.cpp:
      (WebCore::MediaQuerySet::parse):
      (WebCore::MediaList::item):
      (WebCore::reportMediaQueryWarningIfNeeded):
      * css/MediaList.h:
      (WebCore::MediaQuerySet::queryVector):
      * css/MediaQueryEvaluator.cpp:
      (WebCore::MediaQueryEvaluator::eval):
      * css/MediaQueryMatcher.h:
      * css/PropertySetCSSStyleDeclaration.cpp:
      (WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM):
      * css/PropertySetCSSStyleDeclaration.h:
      * css/RuleSet.cpp:
      (WebCore::RuleSet::addToRuleSet):
      (WebCore::RuleSet::addRegionRule):
      (WebCore::RuleSet::addChildRules):
      (WebCore::RuleSet::addRulesFromSheet):
      * css/RuleSet.h:
      * css/SelectorFilter.h:
      * css/StyleInvalidationAnalysis.cpp:
      (WebCore::StyleInvalidationAnalysis::analyzeStyleSheet):
      * css/StylePropertySet.cpp:
      (WebCore::StylePropertySet::getLayeredShorthandValue):
      * css/StyleResolver.cpp:
      (WebCore::StyleResolver::appendAuthorStyleSheets):
      (WebCore::StyleResolver::keyframeStylesForAnimation):
      (WebCore::StyleResolver::styleRulesForElement):
      (WebCore::StyleResolver::pseudoStyleRulesForElement):
      (WebCore::StyleResolver::resolveVariables):
      (WebCore::StyleResolver::applyProperty):
      (WebCore::StyleResolver::loadPendingSVGDocuments):
      (WebCore::StyleResolver::loadPendingShaders):
      * css/StyleResolver.h:
      * css/StyleRule.cpp:
      (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
      (WebCore::StyleRuleGroup::StyleRuleGroup):
      (WebCore::StyleRuleMedia::StyleRuleMedia):
      (WebCore::StyleRuleSupports::StyleRuleSupports):
      (WebCore::StyleRuleRegion::StyleRuleRegion):
      * css/StyleRule.h:
      (WebCore::StyleRule::parserAdoptSelectorVector):
      (WebCore::StyleRulePage::parserAdoptSelectorVector):
      (WebCore::StyleRuleGroup::childRules):
      (WebCore::StyleRuleMedia::create):
      (WebCore::StyleRuleSupports::create):
      (WebCore::StyleRuleRegion::create):
      (WebCore::StyleRuleHost::create):
      (WebCore::StyleRuleHost::StyleRuleHost):
      * css/StyleScopeResolver.h:
      * css/StyleSheetContents.cpp:
      (WebCore::StyleSheetContents::parserAppendRule):
      (WebCore::childRulesHaveFailedOrCanceledSubresources):
      * css/StyleSheetContents.h:
      (WebCore::StyleSheetContents::childRules):
      (WebCore::StyleSheetContents::importRules):
      * css/StyleSheetList.cpp:
      (WebCore::StyleSheetList::styleSheets):
      (WebCore::StyleSheetList::item):
      * css/StyleSheetList.h:
      * css/WebKitCSSKeyframesRule.h:
      (WebCore::StyleRuleKeyframes::keyframes):
      * dom/CheckedRadioButtons.h:
      * dom/ClientRectList.h:
      * dom/ContainerNode.h:
      (WebCore::ChildNodesLazySnapshot::nextNode):
      (WebCore::ChildNodesLazySnapshot::takeSnapshot):
      * dom/CrossThreadTask.h:
      * dom/Document.cpp:
      (WebCore::Document::webkitCancelFullScreen):
      (WebCore::Document::webkitExitFullscreen):
      (WebCore::Document::fullScreenChangeDelayTimerFired):
      (WebCore::Document::didAssociateFormControlsTimerFired):
      * dom/Document.h:
      * dom/DocumentMarkerController.cpp:
      (WebCore::DocumentMarkerController::removeMarkers):
      * dom/DocumentMarkerController.h:
      * dom/DocumentStyleSheetCollection.cpp:
      (WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets):
      (WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets):
      (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
      (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange):
      (WebCore::styleSheetsUseRemUnits):
      (WebCore::filterEnabledNonemptyCSSStyleSheets):
      (WebCore::collectActiveCSSStyleSheetsFromSeamlessParents):
      (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
      * dom/DocumentStyleSheetCollection.h:
      * dom/Element.cpp:
      (WebCore::Element::attrNodeList):
      (WebCore::Element::webkitGetRegionFlowRanges):
      * dom/Element.h:
      * dom/EventListenerMap.h:
      * dom/EventSender.h:
      (WebCore::EventSender::timerFired):
      * dom/IdTargetObserverRegistry.h:
      * dom/MutationCallback.h:
      * dom/MutationObserver.cpp:
      (WebCore::MutationObserver::takeRecords):
      (WebCore::MutationObserver::deliver):
      (WebCore::MutationObserver::deliverAllMutations):
      * dom/MutationObserver.h:
      * dom/MutationObserverRegistration.h:
      * dom/NamedFlowCollection.cpp:
      (WebCore::NamedFlowCollection::namedFlows):
      * dom/NamedFlowCollection.h:
      * dom/Node.cpp:
      (WebCore::Node::didMoveToNewDocument):
      (WebCore::Node::mutationObserverRegistry):
      (WebCore::Node::registerMutationObserver):
      (WebCore::Node::unregisterMutationObserver):
      (WebCore::Node::notifyMutationObserversNodeWillDetach):
      * dom/Node.h:
      * dom/NodeRareData.h:
      * dom/Range.cpp:
      (WebCore::Range::processContents):
      (WebCore::Range::processNodes):
      (WebCore::Range::processAncestorsAndTheirSiblings):
      * dom/Range.h:
      * dom/ScopedEventQueue.h:
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::reportException):
      * dom/ScriptExecutionContext.h:
      * dom/ScriptedAnimationController.h:
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
      * editing/BreakBlockquoteCommand.cpp:
      (WebCore::BreakBlockquoteCommand::doApply):
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::removeChildrenInRange):
      (WebCore::CompositeEditCommand::deleteInsignificantText):
      (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
      * editing/CompositeEditCommand.h:
      * editing/EditingStyle.cpp:
      (WebCore::htmlElementEquivalents):
      (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement):
      (WebCore::htmlAttributeEquivalents):
      (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes):
      (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes):
      (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
      (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
      (WebCore::styleFromMatchedRulesForElement):
      * editing/Editor.cpp:
      (WebCore::Editor::countMatchesForText):
      * editing/Editor.h:
      * editing/InsertParagraphSeparatorCommand.cpp:
      (WebCore::InsertParagraphSeparatorCommand::getAncestorsInsideBlock):
      (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
      (WebCore::InsertParagraphSeparatorCommand::doApply):
      * editing/InsertParagraphSeparatorCommand.h:
      * editing/MergeIdenticalElementsCommand.cpp:
      (WebCore::MergeIdenticalElementsCommand::doApply):
      (WebCore::MergeIdenticalElementsCommand::doUnapply):
      * editing/RemoveNodePreservingChildrenCommand.cpp:
      (WebCore::RemoveNodePreservingChildrenCommand::doApply):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplacementFragment::removeUnrenderedNodes):
      * editing/SimplifyMarkupCommand.cpp:
      (WebCore::SimplifyMarkupCommand::doApply):
      (WebCore::SimplifyMarkupCommand::pruneSubsequentAncestorsToRemove):
      * editing/SimplifyMarkupCommand.h:
      * editing/SpellChecker.h:
      * editing/SplitElementCommand.cpp:
      (WebCore::SplitElementCommand::executeApply):
      (WebCore::SplitElementCommand::doUnapply):
      * editing/WrapContentsInDummySpanCommand.cpp:
      (WebCore::WrapContentsInDummySpanCommand::executeApply):
      (WebCore::WrapContentsInDummySpanCommand::doUnapply):
      * editing/mac/AlternativeTextUIController.h:
      * fileapi/FileList.h:
      * history/BackForwardList.h:
      * history/HistoryItem.cpp:
      (WebCore::HistoryItem::setRedirectURLs):
      * history/HistoryItem.h:
      * history/mac/HistoryItemMac.mm:
      (WebCore::HistoryItem::setTransientProperty):
      * html/FormController.h:
      * html/HTMLAnchorElement.cpp:
      * html/HTMLCollection.cpp:
      (WebCore::HTMLCollection::append):
      * html/HTMLCollection.h:
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLFormControlElement::checkValidity):
      * html/HTMLFormControlElement.h:
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::validateInteractively):
      (WebCore::HTMLFormElement::checkValidity):
      (WebCore::HTMLFormElement::checkInvalidControlsAndCollectUnhandled):
      * html/HTMLFormElement.h:
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
      (WebCore::HTMLMediaElement::platformTextTracks):
      (WebCore::HTMLMediaElement::configureTextTrackGroup):
      * html/HTMLMediaElement.h:
      * html/HTMLPlugInImageElement.cpp:
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::setLength):
      * html/MediaController.cpp:
      (MediaController::asyncEventTimerFired):
      * html/MediaController.h:
      * html/MediaFragmentURIParser.h:
      * html/ValidationMessage.h:
      * html/canvas/WebGLFramebuffer.h:
      * html/canvas/WebGLRenderingContext.cpp:
      (WebCore::WebGLRenderingContext::getAttachedShaders):
      * html/canvas/WebGLRenderingContext.h:
      * html/canvas/WebGLTexture.h:
      * html/parser/BackgroundHTMLParser.cpp:
      (WebCore::BackgroundHTMLParser::BackgroundHTMLParser):
      * html/parser/BackgroundHTMLParser.h:
      (WebCore::BackgroundHTMLParser::create):
      * html/parser/HTMLDocumentParser.cpp:
      (WebCore::HTMLDocumentParser::startBackgroundParser):
      * html/parser/HTMLDocumentParser.h:
      * html/parser/HTMLMetaCharsetParser.h:
      * html/parser/HTMLPreloadScanner.cpp:
      (WebCore::TokenPreloadScanner::scan):
      (WebCore::TokenPreloadScanner::scanCommon):
      * html/parser/HTMLResourcePreloader.h:
      * html/parser/XSSAuditor.h:
      * html/shadow/ContentDistributor.cpp:
      (WebCore::ContentDistributor::ensureInsertionPointList):
      (WebCore::ContentDistributor::distribute):
      (WebCore::ContentDistributor::invalidate):
      * html/shadow/ContentDistributor.h:
      * html/shadow/MediaControlElements.cpp:
      (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
      (WebCore::MediaControlTextTrackContainerElement::updateDisplay):
      * html/shadow/MediaControlElements.h:
      * html/track/InbandGenericTextTrack.h:
      * html/track/InbandWebVTTTextTrack.cpp:
      (WebCore::InbandWebVTTTextTrack::newCuesParsed):
      * html/track/LoadableTextTrack.cpp:
      (WebCore::LoadableTextTrack::newCuesAvailable):
      (WebCore::LoadableTextTrack::newRegionsAvailable):
      * html/track/TextTrackCueList.h:
      * html/track/TextTrackList.cpp:
      (TextTrackList::invalidateTrackIndexesAfterTrack):
      (TextTrackList::remove):
      (TextTrackList::contains):
      * html/track/TextTrackList.h:
      * html/track/TrackListBase.cpp:
      (TrackListBase::asyncEventTimerFired):
      * html/track/TrackListBase.h:
      * html/track/WebVTTParser.cpp:
      (WebCore::WebVTTParser::getNewCues):
      (WebCore::WebVTTParser::getNewRegions):
      * html/track/WebVTTParser.h:
      * inspector/ConsoleMessage.cpp:
      (WebCore::ConsoleMessage::addToFrontend):
      * inspector/ContentSearchUtils.cpp:
      (WebCore::ContentSearchUtils::getRegularExpressionMatchesByLines):
      (WebCore::ContentSearchUtils::lineEndings):
      (WebCore::ContentSearchUtils::searchInTextByLines):
      * inspector/ContentSearchUtils.h:
      * inspector/DOMPatchSupport.cpp:
      (WebCore::DOMPatchSupport::patchNode):
      (WebCore::DOMPatchSupport::diff):
      (WebCore::DOMPatchSupport::innerPatchChildren):
      * inspector/DOMPatchSupport.h:
      * inspector/InjectedScript.cpp:
      (WebCore::InjectedScript::getProperties):
      (WebCore::InjectedScript::getInternalProperties):
      (WebCore::InjectedScript::wrapCallFrames):
      * inspector/InjectedScript.h:
      * inspector/InjectedScriptHost.h:
      * inspector/InspectorAgent.cpp:
      (WebCore::InspectorAgent::enable):
      * inspector/InspectorApplicationCacheAgent.cpp:
      (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
      (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources):
      * inspector/InspectorApplicationCacheAgent.h:
      * inspector/InspectorBaseAgent.h:
      * inspector/InspectorCSSAgent.cpp:
      (WebCore::SelectorProfile::toInspectorObject):
      (WebCore::UpdateRegionLayoutTask::onTimer):
      (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
      (WebCore::InspectorCSSAgent::getComputedStyleForNode):
      (WebCore::InspectorCSSAgent::getAllStyleSheets):
      (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
      (WebCore::InspectorCSSAgent::getNamedFlowCollection):
      (WebCore::InspectorCSSAgent::buildArrayForRuleList):
      (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
      (WebCore::InspectorCSSAgent::buildArrayForRegions):
      (WebCore::InspectorCSSAgent::buildObjectForNamedFlow):
      * inspector/InspectorCSSAgent.h:
      * inspector/InspectorConsoleAgent.h:
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::RevalidateStyleAttributeTask::onTimer):
      (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
      (WebCore::InspectorDOMAgent::pushNodePathToFrontend):
      (WebCore::InspectorDOMAgent::getEventListenersForNode):
      (WebCore::InspectorDOMAgent::performSearch):
      (WebCore::InspectorDOMAgent::getSearchResults):
      (WebCore::InspectorDOMAgent::getAttributes):
      (WebCore::InspectorDOMAgent::buildObjectForNode):
      (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
      (WebCore::InspectorDOMAgent::buildArrayForContainerChildren):
      (WebCore::InspectorDOMAgent::styleAttributeInvalidated):
      * inspector/InspectorDOMAgent.h:
      * inspector/InspectorDOMStorageAgent.cpp:
      (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
      * inspector/InspectorDOMStorageAgent.h:
      * inspector/InspectorDatabaseAgent.cpp:
      (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
      * inspector/InspectorDatabaseAgent.h:
      * inspector/InspectorDebuggerAgent.cpp:
      (WebCore::InspectorDebuggerAgent::setBreakpointByUrl):
      (WebCore::InspectorDebuggerAgent::searchInContent):
      (WebCore::InspectorDebuggerAgent::setScriptSource):
      (WebCore::InspectorDebuggerAgent::currentCallFrames):
      * inspector/InspectorDebuggerAgent.h:
      * inspector/InspectorHeapProfilerAgent.cpp:
      (WebCore::InspectorHeapProfilerAgent::getProfileHeaders):
      * inspector/InspectorHeapProfilerAgent.h:
      * inspector/InspectorHistory.h:
      * inspector/InspectorIndexedDBAgent.cpp:
      * inspector/InspectorLayerTreeAgent.cpp:
      (WebCore::InspectorLayerTreeAgent::layersForNode):
      (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderObjectHierarchy):
      (WebCore::InspectorLayerTreeAgent::gatherLayersUsingRenderLayerHierarchy):
      * inspector/InspectorLayerTreeAgent.h:
      * inspector/InspectorMemoryAgent.h:
      * inspector/InspectorPageAgent.cpp:
      (WebCore::buildArrayForCookies):
      (WebCore::InspectorPageAgent::getCookies):
      (WebCore::InspectorPageAgent::searchInResource):
      (WebCore::InspectorPageAgent::searchInResources):
      (WebCore::InspectorPageAgent::buildObjectForFrameTree):
      * inspector/InspectorPageAgent.h:
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::getProfileHeaders):
      * inspector/InspectorProfilerAgent.h:
      * inspector/InspectorResourceAgent.h:
      * inspector/InspectorRuntimeAgent.cpp:
      (WebCore::InspectorRuntimeAgent::getProperties):
      * inspector/InspectorRuntimeAgent.h:
      * inspector/InspectorState.h:
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::asCSSRuleList):
      (WebCore::InspectorStyle::buildArrayForComputedStyle):
      (WebCore::InspectorStyle::styleWithProperties):
      (WebCore::selectorsFromSource):
      (WebCore::InspectorStyleSheet::buildObjectForSelectorList):
      (WebCore::InspectorStyleSheet::buildObjectForRule):
      (WebCore::InspectorStyleSheet::lineEndings):
      (WebCore::InspectorStyleSheet::buildArrayForRuleList):
      (WebCore::InspectorStyleSheetForInlineStyle::lineEndings):
      * inspector/InspectorStyleSheet.h:
      * inspector/InspectorValues.cpp:
      (WebCore::InspectorArrayBase::writeJSON):
      * inspector/InspectorValues.h:
      * inspector/PageRuntimeAgent.cpp:
      (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
      * inspector/ScriptCallStack.cpp:
      (WebCore::ScriptCallStack::buildInspectorArray):
      * inspector/ScriptCallStack.h:
      * loader/CrossOriginPreflightResultCache.h:
      * loader/DocumentLoader.cpp:
      (WebCore::cancelAll):
      (WebCore::setAllDefersLoading):
      (WebCore::DocumentLoader::getSubresources):
      * loader/DocumentLoader.h:
      * loader/FormState.h:
      * loader/FormSubmission.cpp:
      (WebCore::FormSubmission::create):
      * loader/ProgressTracker.h:
      * loader/ResourceLoadScheduler.h:
      * loader/TextTrackLoader.cpp:
      (WebCore::TextTrackLoader::getNewCues):
      (WebCore::TextTrackLoader::getNewRegions):
      * loader/TextTrackLoader.h:
      * loader/WorkerThreadableLoader.cpp:
      (WebCore::workerGlobalScopeDidReceiveData):
      (WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData):
      * loader/appcache/ApplicationCache.cpp:
      (WebCore::ApplicationCache::removeResource):
      (WebCore::ApplicationCache::dump):
      * loader/appcache/ApplicationCache.h:
      * loader/appcache/ApplicationCacheStorage.cpp:
      (WebCore::ApplicationCacheStorage::getOriginsWithCache):
      * loader/archive/Archive.cpp:
      (WebCore::Archive::clearAllSubframeArchives):
      (WebCore::Archive::clearAllSubframeArchivesImpl):
      * loader/archive/Archive.h:
      (WebCore::Archive::subresources):
      (WebCore::Archive::subframeArchives):
      * loader/archive/ArchiveResourceCollection.cpp:
      (WebCore::ArchiveResourceCollection::addAllResources):
      * loader/archive/ArchiveResourceCollection.h:
      * loader/archive/cf/LegacyWebArchive.cpp:
      (WebCore::LegacyWebArchive::createPropertyListRepresentation):
      (WebCore::LegacyWebArchive::create):
      (WebCore::LegacyWebArchive::createFromSelection):
      * loader/archive/cf/LegacyWebArchive.h:
      * loader/archive/mhtml/MHTMLParser.h:
      * loader/cache/CachedResource.h:
      * loader/cache/CachedResourceLoader.h:
      * loader/cache/MemoryCache.h:
      * loader/icon/IconDatabase.cpp:
      (WebCore::IconDatabase::notifyPendingLoadDecisions):
      * loader/icon/IconDatabase.h:
      * page/CaptionUserPreferencesMediaAF.cpp:
      (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu):
      * page/CaptionUserPreferencesMediaAF.h:
      * page/ChromeClient.h:
      (WebCore::ChromeClient::didAssociateFormControls):
      * page/Console.h:
      * page/ContentSecurityPolicy.h:
      * page/DOMWindow.cpp:
      (WebCore::DOMWindow::getMatchedCSSRules):
      * page/DeviceController.cpp:
      (WebCore::DeviceController::dispatchDeviceEvent):
      (WebCore::DeviceController::fireDeviceEvent):
      * page/DeviceController.h:
      * page/EditorClient.h:
      * page/EventHandler.cpp:
      (WebCore::EventHandler::handleTouchEvent):
      * page/EventHandler.h:
      * page/FrameView.cpp:
      (WebCore::FrameView::serviceScriptedAnimations):
      * page/Page.cpp:
      (WebCore::Page::findStringMatchingRanges):
      * page/Page.h:
      * page/PageGroup.h:
      * page/Performance.cpp:
      (WebCore::Performance::webkitGetEntriesByType):
      (WebCore::Performance::webkitGetEntriesByName):
      * page/Performance.h:
      * page/PerformanceEntryList.cpp:
      (WebCore::PerformanceEntryList::appendAll):
      * page/PerformanceEntryList.h:
      * page/SecurityOriginHash.h:
      * page/SecurityPolicy.cpp:
      * page/SpeechInputResult.h:
      * page/animation/AnimationController.cpp:
      (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
      * page/animation/AnimationControllerPrivate.h:
      * page/animation/CSSPropertyAnimation.cpp:
      (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
      * page/animation/CompositeAnimation.h:
      * page/scrolling/ScrollingStateNode.cpp:
      (WebCore::ScrollingStateNode::appendChild):
      * page/scrolling/ScrollingStateNode.h:
      (WebCore::ScrollingStateNode::children):
      * page/scrolling/ScrollingThread.cpp:
      (WebCore::ScrollingThread::dispatchFunctionsFromScrollingThread):
      * page/scrolling/ScrollingThread.h:
      * page/scrolling/ScrollingTree.cpp:
      (WebCore::ScrollingTree::updateTreeFromStateNode):
      * page/scrolling/ScrollingTreeNode.cpp:
      (WebCore::ScrollingTreeNode::appendChild):
      * page/scrolling/ScrollingTreeNode.h:
      * page/scrolling/mac/ScrollingCoordinatorMac.mm:
      (WebCore::ScrollingCoordinatorMac::syncChildPositions):
      * platform/CrossThreadCopier.cpp:
      * platform/CrossThreadCopier.h:
      * platform/DragData.h:
      * platform/MainThreadTask.h:
      * platform/PODFreeListArena.h:
      (WebCore::PODFreeListArena::freeObject):
      (WebCore::PODFreeListArena::allocate):
      * platform/PODIntervalTree.h:
      * platform/PODRedBlackTree.h:
      (WebCore::PODRedBlackTree::PODRedBlackTree):
      * platform/PlatformSpeechSynthesizer.cpp:
      (WebCore::PlatformSpeechSynthesizer::voiceList):
      * platform/PlatformSpeechSynthesizer.h:
      * platform/RunLoop.h:
      * platform/ScrollView.cpp:
      (WebCore::ScrollView::frameRectsChanged):
      (WebCore::ScrollView::clipRectChanged):
      (WebCore::ScrollView::setParentVisible):
      (WebCore::ScrollView::show):
      (WebCore::ScrollView::hide):
      * platform/ScrollView.h:
      * platform/SharedBuffer.h:
      * platform/Supplementable.h:
      (WebCore::Supplement::provideTo):
      (WebCore::Supplementable::provideSupplement):
      * platform/URL.cpp:
      (WebCore::findHostnamesInMailToURL):
      (WebCore::encodeHostnames):
      * platform/audio/AudioBus.h:
      * platform/audio/AudioDSPKernelProcessor.h:
      * platform/audio/AudioResampler.h:
      * platform/audio/DynamicsCompressor.h:
      * platform/audio/DynamicsCompressorKernel.h:
      * platform/audio/HRTFDatabase.h:
      * platform/audio/HRTFKernel.h:
      * platform/audio/MultiChannelResampler.h:
      * platform/audio/Reverb.h:
      * platform/audio/ReverbConvolver.h:
      * platform/cf/SharedBufferCF.cpp:
      (WebCore::SharedBuffer::copyBufferAndClear):
      (WebCore::SharedBuffer::copySomeDataFromDataArray):
      * platform/graphics/FloatPolygon.cpp:
      (WebCore::FloatPolygon::FloatPolygon):
      * platform/graphics/FloatPolygon.h:
      * platform/graphics/FontCache.cpp:
      (WebCore::FontCache::getCachedFontData):
      (WebCore::FontCache::purgeInactiveFontData):
      * platform/graphics/GlyphMetricsMap.h:
      (WebCore::::locatePageSlowCase):
      * platform/graphics/GlyphPageTreeNode.h:
      * platform/graphics/GraphicsContext3D.h:
      * platform/graphics/GraphicsLayer.cpp:
      * platform/graphics/GraphicsLayer.h:
      * platform/graphics/PlatformTextTrackMenu.h:
      * platform/graphics/SimpleFontData.h:
      * platform/graphics/WidthCache.h:
      * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
      (WebCore::MediaPlayerPrivateAVFoundation::processNewAndRemovedTextTracks):
      * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
      * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
      (WebCore::MediaPlayerPrivateAVFoundationObjC::processMediaSelectionOptions):
      * platform/graphics/ca/GraphicsLayerCA.cpp:
      (WebCore::GraphicsLayerCA::setFilterAnimationKeyframes):
      (WebCore::GraphicsLayerCA::fetchCloneLayers):
      * platform/graphics/ca/GraphicsLayerCA.h:
      * platform/graphics/ca/PlatformCAAnimation.h:
      * platform/graphics/ca/PlatformCALayer.h:
      * platform/graphics/ca/mac/LayerPool.h:
      * platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
      (PlatformCAAnimation::setValues):
      * platform/graphics/ca/mac/TileController.h:
      * platform/graphics/cg/SubimageCacheWithTimer.h:
      * platform/graphics/filters/CustomFilterParameterList.h:
      * platform/graphics/filters/FilterEffect.h:
      * platform/graphics/filters/FilterOperations.h:
      (WebCore::FilterOperations::operations):
      * platform/graphics/gpu/Texture.cpp:
      (WebCore::Texture::Texture):
      (WebCore::Texture::create):
      * platform/graphics/gpu/Texture.h:
      * platform/graphics/mac/ComplexTextController.h:
      * platform/graphics/mac/SimpleFontDataCoreText.cpp:
      (WebCore::SimpleFontData::getCFStringAttributes):
      * platform/graphics/transforms/TransformOperations.h:
      (WebCore::TransformOperations::operations):
      * platform/ios/PasteboardIOS.mm:
      (WebCore::documentFragmentWithRTF):
      * platform/mac/PlatformSpeechSynthesizerMac.mm:
      (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
      * platform/mediastream/MediaStreamDescriptor.h:
      * platform/mediastream/MediaStreamSource.h:
      * platform/mediastream/RTCConfiguration.h:
      * platform/network/BlobRegistryImpl.h:
      * platform/network/HTTPHeaderMap.h:
      * platform/network/ResourceResponseBase.cpp:
      (WebCore::ResourceResponseBase::parseCacheControlDirectives):
      (WebCore::parseCacheHeader):
      * platform/network/cf/ResourceHandleCFNet.cpp:
      (WebCore::clientCerts):
      (WebCore::ResourceHandle::createCFURLConnection):
      * platform/text/cf/HyphenationCF.cpp:
      (WebCore::::createValueForNullKey):
      (WebCore::::createValueForKey):
      (WebCore::cfLocaleCache):
      * plugins/PluginMainThreadScheduler.h:
      * rendering/HitTestResult.h:
      * rendering/InlineFlowBox.h:
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::paintContinuationOutlines):
      (WebCore::RenderBlock::removeFromTrackedRendererMaps):
      * rendering/RenderBlock.h:
      * rendering/RenderButton.h:
      * rendering/RenderCounter.cpp:
      * rendering/RenderGrid.cpp:
      (WebCore::RenderGrid::GridIterator::GridIterator):
      * rendering/RenderGrid.h:
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder):
      (WebCore::RenderLayer::rebuildZOrderLists):
      (WebCore::RenderLayer::collectLayers):
      * rendering/RenderLayer.h:
      * rendering/RenderNamedFlowThread.cpp:
      (WebCore::RenderNamedFlowThread::getRanges):
      * rendering/RenderNamedFlowThread.h:
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::getRanges):
      * rendering/RenderRegion.h:
      * rendering/RenderView.cpp:
      (WebCore::RenderView::selectionBounds):
      (WebCore::RenderView::setSelection):
      * rendering/RootInlineBox.h:
      * rendering/shapes/PolygonShape.cpp:
      (WebCore::computeShapePaddingBounds):
      (WebCore::computeShapeMarginBounds):
      * rendering/shapes/PolygonShape.h:
      (WebCore::PolygonShape::PolygonShape):
      * rendering/shapes/Shape.cpp:
      (WebCore::createPolygonShape):
      (WebCore::Shape::createShape):
      * rendering/shapes/ShapeInfo.h:
      * rendering/shapes/ShapeInterval.h:
      * rendering/style/QuotesData.cpp:
      (WebCore::QuotesData::create):
      (WebCore::QuotesData::QuotesData):
      * rendering/style/QuotesData.h:
      * rendering/style/RenderStyle.cpp:
      (WebCore::requireTransformOrigin):
      (WebCore::RenderStyle::applyTransform):
      * rendering/style/StyleGridData.h:
      * rendering/svg/RenderSVGResourceGradient.h:
      * rendering/svg/RenderSVGResourcePattern.h:
      * rendering/svg/SVGResourcesCache.h:
      * storage/StorageEventDispatcher.cpp:
      (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
      (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
      (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
      (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
      * storage/StorageEventDispatcher.h:
      * storage/StorageNamespaceImpl.h:
      * storage/StorageThread.h:
      * storage/StorageTracker.cpp:
      (WebCore::StorageTracker::origins):
      * storage/StorageTracker.h:
      * svg/SVGAnimatedPath.cpp:
      (WebCore::SVGAnimatedPathAnimator::startAnimValAnimation):
      * svg/SVGAnimatedTypeAnimator.cpp:
      (WebCore::SVGElementAnimatedProperties::SVGElementAnimatedProperties):
      (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
      * svg/SVGAnimatedTypeAnimator.h:
      * svg/SVGDocumentExtensions.cpp:
      (WebCore::SVGDocumentExtensions::startAnimations):
      (WebCore::SVGDocumentExtensions::dispatchSVGLoadEventToOutermostSVGElements):
      (WebCore::SVGDocumentExtensions::addPendingResource):
      (WebCore::SVGDocumentExtensions::isElementPendingResources):
      (WebCore::SVGDocumentExtensions::removeElementFromPendingResources):
      (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget):
      (WebCore::SVGDocumentExtensions::addElementReferencingTarget):
      (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
      * svg/SVGDocumentExtensions.h:
      * svg/SVGFontElement.h:
      * svg/SVGGlyphMap.h:
      * svg/SVGMarkerElement.cpp:
      (WebCore::SVGMarkerElement::orientTypeAnimated):
      * svg/SVGMarkerElement.h:
      * svg/SVGPathSegList.h:
      * svg/animation/SMILTimeContainer.h:
      * svg/graphics/SVGImageCache.h:
      * svg/graphics/filters/SVGFilterBuilder.h:
      (WebCore::SVGFilterBuilder::addBuiltinEffects):
      * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
      (WebCore::SVGAnimatedEnumerationPropertyTearOff::create):
      * svg/properties/SVGAnimatedListPropertyTearOff.h:
      (WebCore::SVGAnimatedListPropertyTearOff::create):
      * svg/properties/SVGAnimatedPropertyTearOff.h:
      (WebCore::SVGAnimatedPropertyTearOff::create):
      * svg/properties/SVGAnimatedStaticPropertyTearOff.h:
      (WebCore::SVGAnimatedStaticPropertyTearOff::create):
      * svg/properties/SVGAttributeToPropertyMap.cpp:
      (WebCore::SVGAttributeToPropertyMap::animatedPropertiesForAttribute):
      * svg/properties/SVGAttributeToPropertyMap.h:
      * svg/properties/SVGStaticListPropertyTearOff.h:
      (WebCore::SVGStaticListPropertyTearOff::create):
      * svg/properties/SVGTransformListPropertyTearOff.h:
      (WebCore::SVGTransformListPropertyTearOff::create):
      (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
      (WebCore::SVGTransformListPropertyTearOff::consolidate):
      * workers/DefaultSharedWorkerRepository.h:
      * workers/WorkerMessagingProxy.h:
      * xml/XMLHttpRequestProgressEventThrottle.cpp:
      (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
      * xml/XMLHttpRequestProgressEventThrottle.h:
      * xml/XPathNodeSet.cpp:
      (WebCore::XPath::NodeSet::sort):
      (WebCore::XPath::NodeSet::traversalSort):
      * xml/XSLStyleSheet.h:
      * xml/parser/XMLDocumentParserLibxml2.cpp:
      
      Source/WebKit/mac:
      
      * History/WebHistory.mm:
      (-[WebHistoryPrivate rebuildHistoryByDayIfNeeded:]):
      * History/WebHistoryItem.mm:
      (-[WebHistoryItem initFromDictionaryRepresentation:]):
      * Plugins/Hosted/NetscapePluginHostProxy.h:
      * Plugins/Hosted/NetscapePluginInstanceProxy.h:
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::idForObject):
      (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::retain):
      (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::release):
      (WebKit::NetscapePluginInstanceProxy::LocalObjectMap::forget):
      (WebKit::NetscapePluginInstanceProxy::stopAllStreams):
      * Plugins/WebNetscapePluginView.h:
      * Plugins/WebNetscapePluginView.mm:
      (-[WebNetscapePluginView destroyPlugin]):
      * Storage/WebDatabaseManager.mm:
      (-[WebDatabaseManager origins]):
      * Storage/WebStorageManager.mm:
      (-[WebStorageManager origins]):
      * WebCoreSupport/WebApplicationCache.mm:
      (+[WebApplicationCache originsWithCache]):
      * WebCoreSupport/WebEditorClient.h:
      * WebCoreSupport/WebEditorClient.mm:
      (WebEditorClient::getClientPasteboardDataForRange):
      (WebEditorClient::documentFragmentFromAttributedString):
      * WebCoreSupport/WebFrameLoaderClient.h:
      * WebCoreSupport/WebNotificationClient.h:
      * WebCoreSupport/WebNotificationClient.mm:
      (WebNotificationClient::show):
      (WebNotificationClient::clearNotifications):
      * WebView/WebArchive.mm:
      (-[WebArchive initWithMainResource:subresources:subframeArchives:]):
      (-[WebArchive subresources]):
      (-[WebArchive subframeArchives]):
      * WebView/WebDataSource.mm:
      (-[WebDataSource subresources]):
      * WebView/WebViewData.h:
      
      Source/WebKit2:
      
      * UIProcess/mac/WebColorPickerMac.h:
      * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugIn.mm:
      * WebProcess/WebProcess.cpp:
      (WebKit::WebProcess::setProcessSuppressionEnabled):
      
      Source/WTF:
      
      * wtf/AVLTree.h:
      * wtf/CheckedArithmetic.h:
      * wtf/Compression.h:
      * wtf/Functional.h:
      (WTF::R):
      * wtf/HashFunctions.h:
      * wtf/HashIterators.h:
      * wtf/HashSet.h:
      (WTF::::contains):
      * wtf/ListHashSet.h:
      (WTF::::contains):
      * wtf/RefCountedLeakCounter.cpp:
      * wtf/RetainPtr.h:
      * wtf/SentinelLinkedList.h:
      (WTF::::remove):
      * wtf/SizeLimits.cpp:
      * wtf/StreamBuffer.h:
      * wtf/Vector.h:
      * wtf/VectorTraits.h:
      * wtf/WeakPtr.h:
      (WTF::WeakReference::create):
      (WTF::WeakReference::createUnbound):
      (WTF::WeakPtr::WeakPtr):
      (WTF::WeakPtrFactory::WeakPtrFactory):
      * wtf/text/AtomicString.cpp:
      (WTF::AtomicString::add):
      (WTF::findString):
      * wtf/text/StringConcatenate.h:
      * wtf/text/StringImpl.h:
      * wtf/text/StringOperators.h:
      (WTF::operator+):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157653 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c3523f8d
  2. 06 Oct, 2013 1 commit
    • fpizlo@apple.com's avatar
      Compress DFG stack layout · a62d4829
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=122024
      
      Reviewed by Oliver Hunt.
              
      The DFG needs to be able to store things at a known offset from frame pointer so that
      the runtime can read those things. Prior to this patch, the DFG would use the exact
      offsets that the bytecode asked for, even in the case of inlining, where it would use
      the callsite stack offset to shift all of the inlined function's variables over just as
      they would have been if a bytecode interpreter had really made the call.
              
      But this won't work once WebKit-LLVM integration is complete. LLVM has no notion of
      storing things at a fixed offset from the frame pointer. We could try to hack LLVM to do
      that, but it would seriously complicate LLVM's stack layout. But what we might be able
      to do is have LLVM tell us (via an addressof intrinsic and a side-channel) where some
      alloca landed relative to the frame pointer. Hence if the DFG can put all of its flushed
      variables in a contiguous range that can be expressed to LLVM as a struct that we
      alloca, then all of this can still work just fine.
              
      Previously the flushed variables didn't fit in a contiguous range, but this patch makes
      them contiguous by allowing the stack layout to be compressed.
              
      What this really means is that there is now a distinction between where the DFG saw a
      variable stored in bytecode and where it will actually store it in the resulting machine
      code. Henceforth when the DFG says "local" or "virtual register" it means the variable
      according to bytecode (with the stack offsetting for inlined code as before), but when
      it says "machine local" or "machine virtual register" it means the actual place where it
      will store things in the resulting machine code. All of the OSR exit, inlined arguments,
      captured variables, and various stack unwinding machine now knows about all of this.
              
      Note that the DFG's abstract interpretation still uses bytecode variables rather than
      machine variables. Same for CSE and abstract heaps. This makes sense since it means that
      we don't have to decide on machine variable allocation just to do those optimizations.
              
      The decision of what a local's machine location becomes is deferred to very late in
      compilation. We only need to assign machine locations to variables that must be stored
      to the stack. It's now mandatory to run some kind of "stack layout phase" that makes the
      decision and updates all data structures.
              
      So far the way that this is being used is just to compress the DFG stack layout, which
      is something that we should have done anyway, a long time ago. And the compression isn't
      even that good - the current StackLayoutPhase just identifies local indices that are
      unused in machine code and slides all other variables towards zero. This doesn't achieve
      particularly good compression but it is better than nothing. Note that this phase makes
      it seem like the bytecode-machine mapping is based on bytecode local indices; for
      example if bytecode local 4 is mapped to machine local 3 then it always will be. That's
      true for the current StackLayoutPhase but it _will not_ be true for all possible stack
      layout phases and it would be incorrect to assume that it should be true. This is why
      the current data structures have each VariableAccessData hold its own copy of the
      machine virtual register, and also have each InlineCallFrame report their own machine
      virtual registers for the various things. The DFG backend is likely to always use the
      dumb StackLayoutPhase since it is very cheap to run, but the FTL backend is likely to
      eventually get a better one, where we do some kind of constraint-based coloring: we
      institute constraints where some VariableAccessData's must have the same indices as some
      other ones, and also must be right next to some other ones; then we process all
      VariableAccessData's and attempt to assign them machine locals while preserving those
      constraints. This could lead to two VariableAccessDatas for the same bytecode local
      ending up with different machine locals.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::CodeBlock):
      (JSC::CodeBlock::isCaptured):
      (JSC::CodeBlock::framePointerOffsetToGetActivationRegisters):
      (JSC::CodeBlock::machineSlowArguments):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::hasSlowArguments):
      * bytecode/CodeOrigin.cpp:
      (JSC::CodeOrigin::dump):
      (JSC::InlineCallFrame::calleeForCallFrame):
      (JSC::InlineCallFrame::dumpInContext):
      * bytecode/CodeOrigin.h:
      (JSC::InlineCallFrame::InlineCallFrame):
      (JSC::InlineCallFrame::calleeConstant):
      * bytecode/Operands.h:
      (JSC::Operands::indexForOperand):
      * dfg/DFGBasicBlock.cpp:
      (JSC::DFG::BasicBlock::SSAData::SSAData):
      * dfg/DFGBasicBlock.h:
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::ByteCodeParser):
      (JSC::DFG::ByteCodeParser::get):
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::flushDirect):
      (JSC::DFG::ByteCodeParser::flush):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCommon.h:
      * dfg/DFGCommonData.h:
      (JSC::DFG::CommonData::CommonData):
      * dfg/DFGDesiredWriteBarriers.cpp:
      (JSC::DFG::DesiredWriteBarrier::trigger):
      * dfg/DFGDesiredWriteBarriers.h:
      * dfg/DFGFlushLivenessAnalysisPhase.cpp:
      (JSC::DFG::FlushLivenessAnalysisPhase::run):
      (JSC::DFG::FlushLivenessAnalysisPhase::process):
      (JSC::DFG::FlushLivenessAnalysisPhase::reportError):
      * dfg/DFGFlushedAt.cpp: Added.
      (JSC::DFG::FlushedAt::dump):
      (JSC::DFG::FlushedAt::dumpInContext):
      * dfg/DFGFlushedAt.h: Added.
      (JSC::DFG::FlushedAt::FlushedAt):
      (JSC::DFG::FlushedAt::operator!):
      (JSC::DFG::FlushedAt::format):
      (JSC::DFG::FlushedAt::virtualRegister):
      (JSC::DFG::FlushedAt::operator==):
      (JSC::DFG::FlushedAt::operator!=):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::Graph):
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::bytecodeRegisterForArgument):
      (JSC::DFG::Graph::argumentsRegisterFor):
      (JSC::DFG::Graph::machineArgumentsRegisterFor):
      (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
      (JSC::DFG::Graph::activationRegister):
      (JSC::DFG::Graph::uncheckedActivationRegister):
      (JSC::DFG::Graph::machineActivationRegister):
      (JSC::DFG::Graph::uncheckedMachineActivationRegister):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::link):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::noticeOSREntry):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::convertToGetLocalUnlinked):
      (JSC::DFG::Node::convertToGetLocal):
      (JSC::DFG::Node::machineLocal):
      (JSC::DFG::Node::hasUnlinkedMachineLocal):
      (JSC::DFG::Node::setUnlinkedMachineLocal):
      (JSC::DFG::Node::unlinkedMachineLocal):
      (JSC::DFG::Node::hasInlineStartData):
      (JSC::DFG::Node::inlineStartData):
      * dfg/DFGNodeFlags.cpp:
      (JSC::DFG::dumpNodeFlags):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOSREntry.h:
      (JSC::DFG::OSREntryReshuffling::OSREntryReshuffling):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompilerCommon.cpp:
      (JSC::DFG::reifyInlinedCallFrames):
      * dfg/DFGOperations.cpp:
      * dfg/DFGOperations.h:
      * dfg/DFGPlan.cpp:
      (JSC::DFG::Plan::compileInThreadImpl):
      * dfg/DFGScoreBoard.h:
      (JSC::DFG::ScoreBoard::ScoreBoard):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileInlineStart):
      (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
      (JSC::DFG::SpeculativeJIT::createOSREntries):
      (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::calleeFrameOffset):
      (JSC::DFG::SpeculativeJIT::callFrameSlot):
      (JSC::DFG::SpeculativeJIT::argumentSlot):
      (JSC::DFG::SpeculativeJIT::callFrameTagSlot):
      (JSC::DFG::SpeculativeJIT::callFramePayloadSlot):
      (JSC::DFG::SpeculativeJIT::argumentTagSlot):
      (JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
      (JSC::DFG::SpeculativeJIT::framePointerOffsetToGetActivationRegisters):
      (JSC::DFG::SpeculativeJIT::callOperation):
      (JSC::DFG::SpeculativeJIT::recordSetLocal):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGStackLayoutPhase.cpp: Added.
      (JSC::DFG::StackLayoutPhase::StackLayoutPhase):
      (JSC::DFG::StackLayoutPhase::run):
      (JSC::DFG::performStackLayout):
      * dfg/DFGStackLayoutPhase.h: Added.
      * dfg/DFGValidate.cpp:
      (JSC::DFG::Validate::validate):
      * dfg/DFGVariableAccessData.h:
      (JSC::DFG::VariableAccessData::machineLocal):
      (JSC::DFG::VariableAccessData::flushedAt):
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      (JSC::DFG::VirtualRegisterAllocationPhase::run):
      * ftl/FTLExitValue.h:
      (JSC::FTL::ExitValue::inJSStack):
      (JSC::FTL::ExitValue::inJSStackAsInt32):
      (JSC::FTL::ExitValue::inJSStackAsInt52):
      (JSC::FTL::ExitValue::inJSStackAsDouble):
      (JSC::FTL::ExitValue::virtualRegister):
      * ftl/FTLLowerDFGToLLVM.cpp:
      (JSC::FTL::LowerDFGToLLVM::compileGetArgument):
      (JSC::FTL::LowerDFGToLLVM::compileGetLocal):
      (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
      (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
      (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
      * ftl/FTLOSRExitCompiler.cpp:
      (JSC::FTL::compileStub):
      * ftl/FTLValueSource.cpp:
      (JSC::FTL::ValueSource::dump):
      * ftl/FTLValueSource.h:
      (JSC::FTL::ValueSource::ValueSource):
      (JSC::FTL::ValueSource::kind):
      (JSC::FTL::ValueSource::operator!):
      (JSC::FTL::ValueSource::node):
      (JSC::FTL::ValueSource::virtualRegister):
      * interpreter/Interpreter.cpp:
      (JSC::unwindCallFrame):
      * interpreter/StackVisitor.cpp:
      (JSC::StackVisitor::readInlinedFrame):
      (JSC::StackVisitor::Frame::createArguments):
      (JSC::StackVisitor::Frame::existingArguments):
      * interpreter/StackVisitor.h:
      * jit/AssemblyHelpers.h:
      (JSC::AssemblyHelpers::addressFor):
      (JSC::AssemblyHelpers::tagFor):
      (JSC::AssemblyHelpers::payloadFor):
      (JSC::AssemblyHelpers::offsetOfArgumentsIncludingThis):
      * runtime/Arguments.cpp:
      (JSC::Arguments::tearOff):
      * runtime/Arguments.h:
      (JSC::Arguments::allocateSlowArguments):
      (JSC::Arguments::tryDeleteArgument):
      (JSC::Arguments::isDeletedArgument):
      (JSC::Arguments::isArgument):
      (JSC::Arguments::argument):
      (JSC::Arguments::finishCreation):
      * runtime/JSActivation.h:
      (JSC::JSActivation::create):
      (JSC::JSActivation::JSActivation):
      * runtime/JSFunction.cpp:
      (JSC::RetrieveArgumentsFunctor::operator()):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a62d4829
  3. 01 Oct, 2013 1 commit
    • fpizlo@apple.com's avatar
      Variable event stream (for DFG OSR exit) should be explicit about where on the... · ee4d8a7a
      fpizlo@apple.com authored
      Variable event stream (for DFG OSR exit) should be explicit about where on the stack a SetLocal put a value
      https://bugs.webkit.org/show_bug.cgi?id=122178
      
      Reviewed by Geoffrey Garen.
              
      Now if the DFG stores the value of a variable into the stack explicitly via a SetLocal,
      it will record where on the stack it stored the value in addition to recording where on
      the stack the bytecode would have done the SetLocal. Previously it just recorded the
      format and the bytecode variable. Recording just the bytecode variable is currently fine
      since the DFG always executes SetLocal's to the same stack location that the bytecode
      would have used. But that prevents stack compression (webkit.org/b/122024) so this patch
      allows the SetLocal to say both the bytecode variable that we're speaking of and the
      actual stack location to which the SetLocal stored the value.
              
      This had to touch a lot of code, so I took the opportunity to also resolve
      webkit.org/b/108019.
      
      * bytecode/Operands.h:
      (JSC::Operands::hasOperand):
      * dfg/DFGFlushFormat.h:
      (JSC::DFG::dataFormatFor):
      * dfg/DFGMinifiedID.h:
      (JSC::DFG::MinifiedID::bits):
      (JSC::DFG::MinifiedID::invalidID):
      (JSC::DFG::MinifiedID::otherInvalidID):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileMovHint):
      (JSC::DFG::SpeculativeJIT::compileInlineStart):
      (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::recordSetLocal):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValueSource.cpp:
      (JSC::DFG::ValueSource::dump):
      * dfg/DFGValueSource.h:
      (JSC::DFG::ValueSource::ValueSource):
      (JSC::DFG::ValueSource::forFlushFormat):
      (JSC::DFG::ValueSource::forDataFormat):
      (JSC::DFG::ValueSource::isSet):
      (JSC::DFG::ValueSource::kind):
      (JSC::DFG::ValueSource::valueRecovery):
      (JSC::DFG::ValueSource::id):
      (JSC::DFG::ValueSource::virtualRegister):
      * dfg/DFGVariableEvent.cpp:
      (JSC::DFG::VariableEvent::dump):
      (JSC::DFG::VariableEvent::dumpSpillInfo):
      * dfg/DFGVariableEvent.h:
      (JSC::DFG::VariableEvent::fillGPR):
      (JSC::DFG::VariableEvent::fillPair):
      (JSC::DFG::VariableEvent::fillFPR):
      (JSC::DFG::VariableEvent::spill):
      (JSC::DFG::VariableEvent::death):
      (JSC::DFG::VariableEvent::setLocal):
      (JSC::DFG::VariableEvent::movHint):
      (JSC::DFG::VariableEvent::id):
      (JSC::DFG::VariableEvent::gpr):
      (JSC::DFG::VariableEvent::tagGPR):
      (JSC::DFG::VariableEvent::payloadGPR):
      (JSC::DFG::VariableEvent::fpr):
      (JSC::DFG::VariableEvent::spillRegister):
      (JSC::DFG::VariableEvent::bytecodeRegister):
      (JSC::DFG::VariableEvent::machineRegister):
      (JSC::DFG::VariableEvent::variableRepresentation):
      * dfg/DFGVariableEventStream.cpp:
      (JSC::DFG::VariableEventStream::reconstruct):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156747 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ee4d8a7a
  4. 26 Sep, 2013 3 commits
    • msaboff@apple.com's avatar
      VirtualRegister should be a class · 62aa8b77
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121732
      
      Reviewed by Geoffrey Garen.
      
      This is a refactoring change.  Changed VirtualRegister from an enum to a class.
      Moved Operands::operandIsArgument(), operandToArgument(), argumentToOperand()
      and the similar functions for locals to VirtualRegister class.
      
      This is in preparation for changing the offset for the first local register from
      0 to -1.  This is needed since most native calling conventions have the architected
      frame pointer (e.g. %rbp for X86) point at the slot that stores the previous frame
      pointer.  Local values start below that address.
      
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/Instruction.h:
      * bytecode/LazyOperandValueProfile.h:
      * bytecode/MethodOfGettingAValueProfile.cpp:
      * bytecode/Operands.h:
      * bytecode/UnlinkedCodeBlock.cpp:
      * bytecode/UnlinkedCodeBlock.h:
      * bytecode/ValueRecovery.h:
      * bytecode/VirtualRegister.h:
      * bytecompiler/BytecodeGenerator.cpp:
      * bytecompiler/BytecodeGenerator.h:
      * bytecompiler/RegisterID.h:
      * debugger/DebuggerCallFrame.cpp:
      * dfg/DFGAbstractHeap.h:
      * dfg/DFGAbstractInterpreterInlines.h:
      * dfg/DFGArgumentPosition.h:
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      * dfg/DFGCapabilities.cpp:
      * dfg/DFGConstantFoldingPhase.cpp:
      * dfg/DFGFlushLivenessAnalysisPhase.cpp:
      * dfg/DFGGraph.cpp:
      * dfg/DFGGraph.h:
      * dfg/DFGJITCode.cpp:
      * dfg/DFGNode.h:
      * dfg/DFGOSREntry.cpp:
      * dfg/DFGOSREntrypointCreationPhase.cpp:
      * dfg/DFGOSRExit.h:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      * dfg/DFGOSRExitCompiler64.cpp:
      * dfg/DFGRegisterBank.h:
      * dfg/DFGScoreBoard.h:
      * dfg/DFGSpeculativeJIT.cpp:
      * dfg/DFGSpeculativeJIT.h:
      * dfg/DFGSpeculativeJIT32_64.cpp:
      * dfg/DFGSpeculativeJIT64.cpp:
      * dfg/DFGValidate.cpp:
      * dfg/DFGValueRecoveryOverride.h:
      * dfg/DFGVariableAccessData.h:
      * dfg/DFGVariableEvent.h:
      * dfg/DFGVariableEventStream.cpp:
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      * ftl/FTLExitArgumentForOperand.h:
      * ftl/FTLLink.cpp:
      * ftl/FTLLowerDFGToLLVM.cpp:
      * ftl/FTLOSREntry.cpp:
      * ftl/FTLOSRExit.cpp:
      * ftl/FTLOSRExit.h:
      * ftl/FTLOSRExitCompiler.cpp:
      * interpreter/CallFrame.h:
      * interpreter/Interpreter.cpp:
      * jit/AssemblyHelpers.h:
      * jit/JIT.h:
      * jit/JITCall.cpp:
      * jit/JITCall32_64.cpp:
      * jit/JITInlines.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITPropertyAccess32_64.cpp:
      * jit/JITStubs.cpp:
      * llint/LLIntSlowPaths.cpp:
      * profiler/ProfilerBytecodeSequence.cpp:
      * runtime/CommonSlowPaths.cpp:
      * runtime/JSActivation.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62aa8b77
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r156474. · bf43ed96
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/156474
      https://bugs.webkit.org/show_bug.cgi?id=121966
      
      Broke the builds. (Requested by xenon on #webkit).
      
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::registerName):
      (JSC::CodeBlock::dumpBytecode):
      (JSC::CodeBlock::CodeBlock):
      (JSC::CodeBlock::createActivation):
      (JSC::CodeBlock::nameForRegister):
      * bytecode/CodeBlock.h:
      (JSC::unmodifiedArgumentsRegister):
      (JSC::CodeBlock::isKnownNotImmediate):
      (JSC::CodeBlock::setThisRegister):
      (JSC::CodeBlock::thisRegister):
      (JSC::CodeBlock::setArgumentsRegister):
      (JSC::CodeBlock::argumentsRegister):
      (JSC::CodeBlock::uncheckedArgumentsRegister):
      (JSC::CodeBlock::setActivationRegister):
      (JSC::CodeBlock::activationRegister):
      (JSC::CodeBlock::uncheckedActivationRegister):
      (JSC::CodeBlock::usesArguments):
      (JSC::CodeBlock::isCaptured):
      * bytecode/Instruction.h:
      * bytecode/LazyOperandValueProfile.h:
      (JSC::LazyOperandValueProfileKey::LazyOperandValueProfileKey):
      (JSC::LazyOperandValueProfileKey::operator!):
      (JSC::LazyOperandValueProfileKey::hash):
      (JSC::LazyOperandValueProfileKey::operand):
      (JSC::LazyOperandValueProfileKey::isHashTableDeletedValue):
      (JSC::LazyOperandValueProfile::LazyOperandValueProfile):
      * bytecode/MethodOfGettingAValueProfile.cpp:
      (JSC::MethodOfGettingAValueProfile::fromLazyOperand):
      (JSC::MethodOfGettingAValueProfile::getSpecFailBucket):
      * bytecode/Operands.h:
      (JSC::localToOperand):
      (JSC::operandIsLocal):
      (JSC::operandToLocal):
      (JSC::operandIsArgument):
      (JSC::operandToArgument):
      (JSC::argumentToOperand):
      (JSC::Operands::operand):
      (JSC::Operands::hasOperand):
      (JSC::Operands::setOperand):
      (JSC::Operands::operandForIndex):
      (JSC::Operands::setOperandFirstTime):
      * bytecode/UnlinkedCodeBlock.cpp:
      (JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
      * bytecode/UnlinkedCodeBlock.h:
      (JSC::UnlinkedCodeBlock::setThisRegister):
      (JSC::UnlinkedCodeBlock::setActivationRegister):
      (JSC::UnlinkedCodeBlock::setArgumentsRegister):
      (JSC::UnlinkedCodeBlock::usesArguments):
      (JSC::UnlinkedCodeBlock::argumentsRegister):
      (JSC::UnlinkedCodeBlock::usesGlobalObject):
      (JSC::UnlinkedCodeBlock::setGlobalObjectRegister):
      (JSC::UnlinkedCodeBlock::globalObjectRegister):
      (JSC::UnlinkedCodeBlock::thisRegister):
      (JSC::UnlinkedCodeBlock::activationRegister):
      * bytecode/ValueRecovery.h:
      (JSC::ValueRecovery::displacedInJSStack):
      (JSC::ValueRecovery::virtualRegister):
      (JSC::ValueRecovery::dumpInContext):
      * bytecode/VirtualRegister.h:
      (WTF::printInternal):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
      (JSC::BytecodeGenerator::addVar):
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
      (JSC::BytecodeGenerator::newRegister):
      (JSC::BytecodeGenerator::emitLoadGlobalObject):
      (JSC::BytecodeGenerator::emitGetArgumentsLength):
      (JSC::BytecodeGenerator::emitGetArgumentByVal):
      (JSC::BytecodeGenerator::createArgumentsIfNecessary):
      (JSC::BytecodeGenerator::emitReturn):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::BytecodeGenerator::registerFor):
      * bytecompiler/RegisterID.h:
      (JSC::RegisterID::RegisterID):
      (JSC::RegisterID::setIndex):
      (JSC::RegisterID::index):
      * debugger/DebuggerCallFrame.cpp:
      (JSC::DebuggerCallFrame::thisObject):
      * dfg/DFGAbstractHeap.h:
      (JSC::DFG::AbstractHeap::Payload::Payload):
      * dfg/DFGAbstractInterpreterInlines.h:
      (JSC::DFG::::executeEffects):
      (JSC::DFG::::clobberCapturedVars):
      * dfg/DFGArgumentPosition.h:
      (JSC::DFG::ArgumentPosition::dump):
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      (JSC::DFG::ArgumentsSimplificationPhase::run):
      (JSC::DFG::ArgumentsSimplificationPhase::observeBadArgumentsUse):
      (JSC::DFG::ArgumentsSimplificationPhase::isOKToOptimize):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::newVariableAccessData):
      (JSC::DFG::ByteCodeParser::getDirect):
      (JSC::DFG::ByteCodeParser::get):
      (JSC::DFG::ByteCodeParser::setDirect):
      (JSC::DFG::ByteCodeParser::set):
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::setLocal):
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::setArgument):
      (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
      (JSC::DFG::ByteCodeParser::findArgumentPosition):
      (JSC::DFG::ByteCodeParser::flush):
      (JSC::DFG::ByteCodeParser::flushDirect):
      (JSC::DFG::ByteCodeParser::getToInt32):
      (JSC::DFG::ByteCodeParser::getThis):
      (JSC::DFG::ByteCodeParser::addCall):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
      (JSC::DFG::ByteCodeParser::handleCall):
      (JSC::DFG::ByteCodeParser::emitFunctionChecks):
      (JSC::DFG::ByteCodeParser::emitArgumentPhantoms):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::handleMinMax):
      (JSC::DFG::ByteCodeParser::handleIntrinsic):
      (JSC::DFG::ByteCodeParser::handleTypedArrayConstructor):
      (JSC::DFG::ByteCodeParser::handleConstantInternalFunction):
      (JSC::DFG::ByteCodeParser::handleGetByOffset):
      (JSC::DFG::ByteCodeParser::handleGetById):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocal):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocal):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeSetArgument):
      * dfg/DFGCapabilities.cpp:
      (JSC::DFG::capabilityLevel):
      * dfg/DFGConstantFoldingPhase.cpp:
      (JSC::DFG::ConstantFoldingPhase::isCapturedAtOrAfter):
      * dfg/DFGFlushLivenessAnalysisPhase.cpp:
      (JSC::DFG::FlushLivenessAnalysisPhase::setForNode):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::argumentsRegisterFor):
      (JSC::DFG::Graph::uncheckedArgumentsRegisterFor):
      (JSC::DFG::Graph::uncheckedActivationRegisterFor):
      (JSC::DFG::Graph::valueProfileFor):
      * dfg/DFGJITCode.cpp:
      (JSC::DFG::JITCode::reconstruct):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::Node):
      (JSC::DFG::Node::convertToGetLocalUnlinked):
      (JSC::DFG::Node::hasVirtualRegister):
      (JSC::DFG::Node::virtualRegister):
      (JSC::DFG::Node::setVirtualRegister):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOSREntrypointCreationPhase.cpp:
      (JSC::DFG::OSREntrypointCreationPhase::run):
      * dfg/DFGOSRExit.h:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGRegisterBank.h:
      (JSC::DFG::RegisterBank::tryAllocate):
      (JSC::DFG::RegisterBank::allocateSpecific):
      (JSC::DFG::RegisterBank::retain):
      (JSC::DFG::RegisterBank::isInUse):
      (JSC::DFG::RegisterBank::dump):
      (JSC::DFG::RegisterBank::releaseAtIndex):
      (JSC::DFG::RegisterBank::allocateInternal):
      (JSC::DFG::RegisterBank::MapEntry::MapEntry):
      * dfg/DFGScoreBoard.h:
      (JSC::DFG::ScoreBoard::allocate):
      (JSC::DFG::ScoreBoard::use):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      (JSC::DFG::SpeculativeJIT::checkConsistency):
      (JSC::DFG::SpeculativeJIT::compileMovHint):
      (JSC::DFG::SpeculativeJIT::compileInlineStart):
      (JSC::DFG::SpeculativeJIT::compileCurrentBlock):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::allocate):
      (JSC::DFG::SpeculativeJIT::fprAllocate):
      (JSC::DFG::SpeculativeJIT::silentSpillAllRegistersImpl):
      (JSC::DFG::SpeculativeJIT::flushRegisters):
      (JSC::DFG::SpeculativeJIT::isFlushed):
      (JSC::DFG::SpeculativeJIT::argumentSlot):
      (JSC::DFG::SpeculativeJIT::argumentTagSlot):
      (JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
      (JSC::DFG::SpeculativeJIT::valueSourceForOperand):
      (JSC::DFG::SpeculativeJIT::setNodeForOperand):
      (JSC::DFG::SpeculativeJIT::valueSourceReferenceForOperand):
      (JSC::DFG::SpeculativeJIT::recordSetLocal):
      (JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
      (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValidate.cpp:
      (JSC::DFG::Validate::validate):
      (JSC::DFG::Validate::validateCPS):
      (JSC::DFG::Validate::checkOperand):
      (JSC::DFG::Validate::reportValidationContext):
      * dfg/DFGValueRecoveryOverride.h:
      (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
      * dfg/DFGVariableAccessData.h:
      (JSC::DFG::VariableAccessData::operand):
      (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
      (JSC::DFG::VariableAccessData::tallyVotesForShouldUseDoubleFormat):
      (JSC::DFG::VariableAccessData::flushFormat):
      * dfg/DFGVariableEvent.h:
      (JSC::DFG::VariableEvent::spill):
      (JSC::DFG::VariableEvent::setLocal):
      * dfg/DFGVariableEventStream.cpp:
      (JSC::DFG::VariableEventStream::reconstruct):
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      (JSC::DFG::VirtualRegisterAllocationPhase::run):
      * ftl/FTLExitArgumentForOperand.h:
      (JSC::FTL::ExitArgumentForOperand::ExitArgumentForOperand):
      (JSC::FTL::ExitArgumentForOperand::operand):
      * ftl/FTLLink.cpp:
      (JSC::FTL::link):
      * ftl/FTLLowerDFGToLLVM.cpp:
      (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
      (JSC::FTL::LowerDFGToLLVM::compileGetArgument):
      (JSC::FTL::LowerDFGToLLVM::compileExtractOSREntryLocal):
      (JSC::FTL::LowerDFGToLLVM::compileCallOrConstruct):
      (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
      (JSC::FTL::LowerDFGToLLVM::observeMovHint):
      (JSC::FTL::LowerDFGToLLVM::addressFor):
      (JSC::FTL::LowerDFGToLLVM::payloadFor):
      (JSC::FTL::LowerDFGToLLVM::tagFor):
      * ftl/FTLOSREntry.cpp:
      (JSC::FTL::prepareOSREntry):
      * ftl/FTLOSRExit.cpp:
      (JSC::FTL::OSRExit::convertToForward):
      * ftl/FTLOSRExit.h:
      * ftl/FTLOSRExitCompiler.cpp:
      (JSC::FTL::compileStub):
      * interpreter/CallFrame.h:
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::dumpRegisters):
      (JSC::unwindCallFrame):
      (JSC::Interpreter::unwind):
      * jit/AssemblyHelpers.h:
      (JSC::AssemblyHelpers::addressFor):
      (JSC::AssemblyHelpers::tagFor):
      (JSC::AssemblyHelpers::payloadFor):
      (JSC::AssemblyHelpers::argumentsRegisterFor):
      * jit/JIT.h:
      * jit/JITCall.cpp:
      (JSC::JIT::compileLoadVarargs):
      * jit/JITInlines.h:
      (JSC::JIT::emitGetVirtualRegister):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_tear_off_arguments):
      (JSC::JIT::emit_op_get_pnames):
      (JSC::JIT::emit_op_enter):
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emitSlow_op_get_argument_by_val):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_enter):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * profiler/ProfilerBytecodeSequence.cpp:
      (JSC::Profiler::BytecodeSequence::BytecodeSequence):
      * runtime/CommonSlowPaths.cpp:
      (JSC::SLOW_PATH_DECL):
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::argumentsGetter):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156482 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bf43ed96
    • msaboff@apple.com's avatar
      VirtualRegister should be a class · 1796ad0f
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121732
      
      Reviewed by Geoffrey Garen.
      
      This is a refactoring change.  Changed VirtualRegister from an enum to a class.
      Moved Operands::operandIsArgument(), operandToArgument(), argumentToOperand()
      and the similar functions for locals to VirtualRegister class.
      
      This is in preparation for changing the offset for the first local register from
      0 to -1.  This is needed since most native calling conventions have the architected
      frame pointer (e.g. %rbp for X86) point at the slot that stores the previous frame
      pointer.  Local values start below that address.
      
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/Instruction.h:
      * bytecode/LazyOperandValueProfile.h:
      * bytecode/MethodOfGettingAValueProfile.cpp:
      * bytecode/Operands.h:
      * bytecode/UnlinkedCodeBlock.cpp:
      * bytecode/UnlinkedCodeBlock.h:
      * bytecode/ValueRecovery.h:
      * bytecode/VirtualRegister.h:
      * bytecompiler/BytecodeGenerator.cpp:
      * bytecompiler/BytecodeGenerator.h:
      * bytecompiler/RegisterID.h:
      * debugger/DebuggerCallFrame.cpp:
      * dfg/DFGAbstractHeap.h:
      * dfg/DFGAbstractInterpreterInlines.h:
      * dfg/DFGArgumentPosition.h:
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      * dfg/DFGCapabilities.cpp:
      * dfg/DFGConstantFoldingPhase.cpp:
      * dfg/DFGFlushLivenessAnalysisPhase.cpp:
      * dfg/DFGGraph.cpp:
      * dfg/DFGGraph.h:
      * dfg/DFGJITCode.cpp:
      * dfg/DFGNode.h:
      * dfg/DFGOSREntry.cpp:
      * dfg/DFGOSREntrypointCreationPhase.cpp:
      * dfg/DFGOSRExit.h:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      * dfg/DFGOSRExitCompiler64.cpp:
      * dfg/DFGRegisterBank.h:
      * dfg/DFGScoreBoard.h:
      * dfg/DFGSpeculativeJIT.cpp:
      * dfg/DFGSpeculativeJIT.h:
      * dfg/DFGSpeculativeJIT64.cpp:
      * dfg/DFGValidate.cpp:
      * dfg/DFGValueRecoveryOverride.h:
      * dfg/DFGVariableAccessData.h:
      * dfg/DFGVariableEvent.h:
      * dfg/DFGVariableEventStream.cpp:
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      * ftl/FTLExitArgumentForOperand.h:
      * ftl/FTLLink.cpp:
      * ftl/FTLLowerDFGToLLVM.cpp:
      * ftl/FTLOSREntry.cpp:
      * ftl/FTLOSRExit.cpp:
      * ftl/FTLOSRExit.h:
      * ftl/FTLOSRExitCompiler.cpp:
      * interpreter/CallFrame.h:
      * interpreter/Interpreter.cpp:
      * jit/AssemblyHelpers.h:
      * jit/JIT.h:
      * jit/JITCall.cpp:
      * jit/JITInlines.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      * jit/JITStubs.cpp:
      * llint/LLIntSlowPaths.cpp:
      * profiler/ProfilerBytecodeSequence.cpp:
      * runtime/CommonSlowPaths.cpp:
      * runtime/JSActivation.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1796ad0f
  5. 13 Sep, 2013 1 commit
    • msaboff@apple.com's avatar
      fourthTier: Change JSStack to grow from high to low addresses · b70e41bc
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118758
      
      Reviewed by Oliver Hunt.
      
      Changed the JSC stack to grow down.  Effectively the JSC stack frame is flipped from
      what it was.  See JSStack.h for the new offsets.  Changed JSStack begin() and end()
      to be getBaseOfStack() and getLimitOfStack().  Most of the changes are address or offset
      calculation changes.  Decoupled a local register ordinal (loop variable or array index)
      from the offset into the callFrame using localToOperand() and the inverse operandToLocal().
      
      * assembler/MacroAssembler.h:
      (JSC::MacroAssembler::trustedImm32ForShift):
      (JSC::MacroAssembler::lshiftPtr): Added to create scaled addresses with a negative index
      * assembler/MacroAssemblerX86_64.h:
      (JSC::MacroAssemblerX86_64::lshift64): Added to create scaled addresses with a negative index
      * assembler/X86Assembler.h:
      (JSC::X86Assembler::shlq_i8r): Added to create scaled addresses with a negative index
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::dumpBytecode):
      * bytecode/CodeBlock.h:
      (JSC::unmodifiedArgumentsRegister):
      (JSC::CodeBlock::isCaptured):
      * bytecode/CodeOrigin.h:
      (JSC::CodeOrigin::stackOffset):
      * bytecode/Operands.h:
      (JSC::localToOperand):
      (JSC::operandIsLocal):
      (JSC::operandToLocal):
      (JSC::operandIsArgument):
      (JSC::operandToArgument):
      (JSC::argumentToOperand):
      * bytecode/VirtualRegister.h: Made InvalidVirtualRegister a positive value that fits in
      31 bits since it can be placed into the 31 bit field "stackOffset" in struct InlineCallFrame.
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::addVar):
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::createLazyRegisterIfNecessary):
      (JSC::BytecodeGenerator::newRegister):
      (JSC::BytecodeGenerator::emitNewArray):
      * bytecompiler/BytecodeGenerator.h:
      (JSC::CallArguments::registerOffset):
      * bytecompiler/NodesCodegen.cpp:
      (JSC::CallArguments::CallArguments):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::findArgumentPositionForLocal):
      (JSC::DFG::ByteCodeParser::addCall):
      (JSC::DFG::ByteCodeParser::handleCall):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOperations.cpp:
      * dfg/DFGScoreBoard.h:
      (JSC::DFG::ScoreBoard::allocate):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compileGetByValOnArguments):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::callFrameSlot):
      (JSC::DFG::SpeculativeJIT::argumentSlot):
      (JSC::DFG::SpeculativeJIT::callFrameTagSlot):
      (JSC::DFG::SpeculativeJIT::callFramePayloadSlot):
      (JSC::DFG::SpeculativeJIT::argumentTagSlot):
      (JSC::DFG::SpeculativeJIT::argumentPayloadSlot):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValidate.cpp:
      (JSC::DFG::Validate::reportValidationContext):
      * ftl/FTLLink.cpp:
      (JSC::FTL::link):
      * heap/ConservativeRoots.cpp:
      (JSC::ConservativeRoots::genericAddSpan):
      * interpreter/CallFrame.cpp:
      (JSC::CallFrame::frameExtentInternal):
      * interpreter/CallFrame.h:
      (JSC::ExecState::init):
      (JSC::ExecState::argumentOffset):
      (JSC::ExecState::argumentOffsetIncludingThis):
      (JSC::ExecState::argIndexForRegister):
      * interpreter/Interpreter.cpp:
      (JSC::loadVarargs):
      (JSC::Interpreter::dumpRegisters):
      * interpreter/JSStack.cpp:
      (JSC::JSStack::JSStack):
      (JSC::JSStack::~JSStack):
      (JSC::JSStack::growSlowCase):
      (JSC::JSStack::gatherConservativeRoots):
      (JSC::JSStack::releaseExcessCapacity):
      (JSC::JSStack::disableErrorStackReserve):
      * interpreter/JSStack.h:
      (JSC::JSStack::getBaseOfStack):
      (JSC::JSStack::getLimitOfStack):
      (JSC::JSStack::size):
      (JSC::JSStack::end):
      (JSC::JSStack::containsAddress):
      (JSC::JSStack::lowAddress):
      (JSC::JSStack::highAddress):
      (JSC::JSStack::reservationEnd):
      (JSC::JSStack::shrink):
      (JSC::JSStack::grow):
      * interpreter/JSStackInlines.h:
      (JSC::JSStack::getTopOfFrame):
      (JSC::JSStack::pushFrame):
      (JSC::JSStack::popFrame):
      (JSC::JSStack::installTrapsAfterFrame):
      * interpreter/StackVisitor.cpp:
      (JSC::inlinedFrameOffset):
      (JSC::StackVisitor::readInlinedFrame):
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile):
      * jit/JITCall.cpp:
      (JSC::JIT::compileLoadVarargs):
      (JSC::JIT::compileOpCall):
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileLoadVarargs):
      (JSC::JIT::compileOpCall):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_create_activation):
      (JSC::JIT::emit_op_get_argument_by_val):
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_get_argument_by_val):
      * jit/JITStubs.cpp:
      (JSC::throwExceptionFromOpCall):
      (JSC::DEFINE_STUB_FUNCTION):
      * jit/ThunkGenerators.cpp:
      (JSC::arityFixup):
      * llint/LLIntData.cpp:
      (JSC::LLInt::Data::performAssertions):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      (JSC::LLInt::genericCall):
      * llint/LowLevelInterpreter.asm:
      * llint/LowLevelInterpreter32_64.asm:
      * llint/LowLevelInterpreter64.asm:
      * runtime/ArgList.cpp:
      (JSC::ArgList::getSlice):
      (JSC::MarkedArgumentBuffer::slowAppend):
      * runtime/ArgList.h:
      (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
      (JSC::MarkedArgumentBuffer::slotFor):
      (JSC::MarkedArgumentBuffer::mallocBase):
      (JSC::ArgList::at):
      * runtime/Arguments.cpp:
      (JSC::Arguments::tearOff):
      * runtime/ArrayConstructor.cpp:
      (JSC::constructArrayWithSizeQuirk):
      * runtime/CommonSlowPaths.cpp:
      (JSC::SLOW_PATH_DECL):
      * runtime/JSActivation.h:
      (JSC::JSActivation::registersOffset):
      (JSC::JSActivation::tearOff):
      (JSC::JSActivation::isValidIndex):
      * runtime/JSArray.h:
      (JSC::constructArrayNegativeIndexed): New method to create an array from registers that grow down.
      * runtime/JSGlobalObject.cpp:
      (JSC::JSGlobalObject::globalExec):
      * runtime/JSGlobalObject.h:
      (JSC::constructArrayNegativeIndexed):
      * runtime/JSString.h:
      * runtime/Operations.h:
      (JSC::jsStringFromRegisterArray):
      * runtime/SymbolTable.h:
      (JSC::SharedSymbolTable::captureCount):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b70e41bc
  6. 10 Sep, 2013 1 commit
    • msaboff@apple.com's avatar
      Add local to/from operand helpers similar to argument to/from operand2 · 1a5f13c8
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=121056
      
      Reviewed by Geoffrey Garen.
      
      Added localToOperand(), operandToLocal() and operandIsLocal() to Operands.h, very similar to
      argumentToOperand(), et al.  Used the new helpers everywhere where an index into a data
      structure is intended instead of the actual virtual register offset.  When the stack is
      changed to grow down, local register offsets can be negative.  Also added the helper
      DFG::SpeculativeJIT::generationInfoFromVirtualRegister() for the common case accessing 
      m_generationInfo[operandToLocal(val)].
      
      * bytecode/CodeBlock.cpp:
      * bytecode/CodeBlock.h:
      * bytecode/Operands.h:
      (JSC::localToOperand):
      (JSC::operandIsLocal):
      (JSC::operandToLocal):
      * bytecompiler/BytecodeGenerator.h:
      * dfg/DFGAbstractInterpreterInlines.h:
      * dfg/DFGByteCodeParser.cpp:
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      * dfg/DFGOSREntry.cpp:
      * dfg/DFGOSRExitCompiler32_64.cpp:
      * dfg/DFGOSRExitCompiler64.cpp:
      * dfg/DFGScoreBoard.h:
      * dfg/DFGSpeculativeJIT.cpp:
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      * dfg/DFGSpeculativeJIT64.cpp:
      * dfg/DFGValidate.cpp:
      * dfg/DFGVariableEventStream.cpp:
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      * jit/JITInlines.h:
      * jit/JITOpcodes.cpp:
      * jit/JITOpcodes32_64.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1a5f13c8
  7. 25 Jul, 2013 3 commits
    • oliver@apple.com's avatar
      fourthTier: DFG IR dumps should be easier to read · 237b1464
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=119050
      
      Source/JavaScriptCore:
      
      Reviewed by Mark Hahnenberg.
      
      Added a DumpContext that includes support for printing an endnote
      that describes all structures in full, while the main flow of the
      dump just uses made-up names for the structures. This is helpful
      since Structure::dump() may print a lot. The stuff it prints is
      useful, but if it's all inline with the surrounding thing you're
      dumping (often, a node in the DFG), then you get a ridiculously
      long print-out. All classes that dump structures (including
      Structure itself) now have dumpInContext() methods that use
      inContext() for dumping anything that might transitively print a
      structure. If Structure::dumpInContext() is called with a NULL
      context, it just uses dump() like before. Hence you don't have to
      know anything about DumpContext unless you want to.
      
      inContext(*structure, context) dumps something like %B4:Array,
      and the endnote will have something like:
      
          %B4:Array    = 0x10e91a180:[Array, {Edge:100, Normal:101, Line:102, NumPx:103, LastPx:104}, ArrayWithContiguous, Proto:0x10e99ffe0]
      
      where B4 is the inferred name that StringHashDumpContext came up
      with.
      
      Also shortened a bunch of other dumps, removing information that
      isn't so important.
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/ArrayProfile.cpp:
      (JSC::dumpArrayModes):
      * bytecode/CodeBlockHash.cpp:
      (JSC):
      (JSC::CodeBlockHash::CodeBlockHash):
      (JSC::CodeBlockHash::dump):
      * bytecode/CodeOrigin.cpp:
      (JSC::CodeOrigin::dumpInContext):
      (JSC):
      (JSC::InlineCallFrame::dumpInContext):
      (JSC::InlineCallFrame::dump):
      * bytecode/CodeOrigin.h:
      (CodeOrigin):
      (InlineCallFrame):
      * bytecode/Operands.h:
      (JSC::OperandValueTraits::isEmptyForDump):
      (Operands):
      (JSC::Operands::dump):
      (JSC):
      * bytecode/OperandsInlines.h: Added.
      (JSC):
      (JSC::::dumpInContext):
      * bytecode/StructureSet.h:
      (JSC::StructureSet::dumpInContext):
      (JSC::StructureSet::dump):
      (StructureSet):
      * dfg/DFGAbstractValue.cpp:
      (JSC::DFG::AbstractValue::dump):
      (DFG):
      (JSC::DFG::AbstractValue::dumpInContext):
      * dfg/DFGAbstractValue.h:
      (JSC::DFG::AbstractValue::operator!):
      (AbstractValue):
      * dfg/DFGCFAPhase.cpp:
      (JSC::DFG::CFAPhase::performBlockCFA):
      * dfg/DFGCommon.cpp:
      * dfg/DFGCommon.h:
      (JSC::DFG::NodePointerTraits::isEmptyForDump):
      * dfg/DFGDisassembler.cpp:
      (JSC::DFG::Disassembler::createDumpList):
      * dfg/DFGDisassembler.h:
      (Disassembler):
      * dfg/DFGFlushFormat.h:
      (WTF::inContext):
      (WTF):
      * dfg/DFGFlushLivenessAnalysisPhase.cpp:
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dumpCodeOrigin):
      (JSC::DFG::Graph::dump):
      (JSC::DFG::Graph::dumpBlockHeader):
      * dfg/DFGGraph.h:
      (Graph):
      * dfg/DFGLazyJSValue.cpp:
      (JSC::DFG::LazyJSValue::dumpInContext):
      (JSC::DFG::LazyJSValue::dump):
      (DFG):
      * dfg/DFGLazyJSValue.h:
      (LazyJSValue):
      * dfg/DFGNode.h:
      (JSC::DFG::nodeMapDump):
      (WTF::inContext):
      (WTF):
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGStructureAbstractValue.h:
      (JSC::DFG::StructureAbstractValue::dumpInContext):
      (JSC::DFG::StructureAbstractValue::dump):
      (StructureAbstractValue):
      * ftl/FTLExitValue.cpp:
      (JSC::FTL::ExitValue::dumpInContext):
      (JSC::FTL::ExitValue::dump):
      (FTL):
      * ftl/FTLExitValue.h:
      (ExitValue):
      * ftl/FTLLowerDFGToLLVM.cpp:
      * ftl/FTLValueSource.cpp:
      (JSC::FTL::ValueSource::dumpInContext):
      (FTL):
      * ftl/FTLValueSource.h:
      (ValueSource):
      * runtime/DumpContext.cpp: Added.
      (JSC):
      (JSC::DumpContext::DumpContext):
      (JSC::DumpContext::~DumpContext):
      (JSC::DumpContext::isEmpty):
      (JSC::DumpContext::dump):
      * runtime/DumpContext.h: Added.
      (JSC):
      (DumpContext):
      * runtime/JSCJSValue.cpp:
      (JSC::JSValue::dump):
      (JSC):
      (JSC::JSValue::dumpInContext):
      * runtime/JSCJSValue.h:
      (JSC):
      (JSValue):
      * runtime/Structure.cpp:
      (JSC::Structure::dumpInContext):
      (JSC):
      (JSC::Structure::dumpBrief):
      (JSC::Structure::dumpContextHeader):
      * runtime/Structure.h:
      (JSC):
      (Structure):
      
      Source/WTF:
      
      Reviewed by Mark Hahnenberg.
      
      Added support for dumping values within a context. By default, if you say
      print(inContext(value, context)) it calls value.dumpInContext(out, context)
      instead of value.dump(out).
      
      Hoisted the support for six-character hashes out of JSC::CodeBlockHash into
      WTF, in the form of SixCharacterHash.h.
      
      Added a helper for creating dump contexts where the inContext() dump will
      just use a short string hash to "name" the object being dumped, and then
      will print out the full dumps in an endnote to your dump.
      
      Added support for using CString as a hashtable key.
      
      * WTF.xcodeproj/project.pbxproj:
      * wtf/PrintStream.h:
      (WTF):
      (ValueInContext):
      (WTF::ValueInContext::ValueInContext):
      (WTF::ValueInContext::dump):
      (WTF::inContext):
      * wtf/SixCharacterHash.cpp: Added.
      (WTF):
      (WTF::sixCharacterHashStringToInteger):
      (WTF::integerToSixCharacterHashString):
      * wtf/SixCharacterHash.h: Added.
      (WTF):
      * wtf/StringHashDumpContext.h: Added.
      (WTF):
      (StringHashDumpContext):
      (WTF::StringHashDumpContext::StringHashDumpContext):
      (WTF::StringHashDumpContext::getID):
      (WTF::StringHashDumpContext::dumpBrief):
      (WTF::StringHashDumpContext::brief):
      (WTF::StringHashDumpContext::isEmpty):
      (WTF::StringHashDumpContext::dump):
      * wtf/text/CString.cpp:
      (WTF::CString::hash):
      (WTF):
      (WTF::operator<):
      (WTF::CStringHash::equal):
      * wtf/text/CString.h:
      (WTF::CString::CString):
      (CString):
      (WTF::CString::isHashTableDeletedValue):
      (WTF):
      (WTF::CStringHash::hash):
      (CStringHash):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      237b1464
    • oliver@apple.com's avatar
      fourthTier: DFG should have an SSA form for use by FTL · 827d2cf7
      oliver@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=118338
      
      Source/JavaScriptCore:
      
      Reviewed by Mark Hahnenberg.
      
      Adds an SSA form to the DFG. We can convert ThreadedCPS form into SSA form
      after breaking critical edges. The conversion algorithm follows Aycock and
      Horspool, and the SSA form itself follows something I've done before, where
      instead of having Phi functions specify input nodes corresponding to block
      predecessors, we instead have Upsilon functions in the predecessors that
      specify which value in that block goes into which subsequent Phi. Upsilons
      don't have to dominate Phis (usually they don't) and they correspond to a
      non-SSA "mov" into the Phi's "variable". This gives all of the good
      properties of SSA, while ensuring that a bunch of CFG transformations don't
      have to be SSA-aware.
      
      So far the only DFG phases that are SSA-aware are DCE and CFA. CFG
      simplification is probably SSA-aware by default, though I haven't tried it.
      Constant folding probably needs a few tweaks, but is likely ready. Ditto
      for CSE, though it's not clear that we'd want to use block-local CSE when
      we could be doing GVN.
      
      Currently only the FTL can generate code from the SSA form, and there is no
      way to convert from SSA to ThreadedCPS or LoadStore. There probably will
      never be such a capability.
      
      In order to handle OSR exit state in the SSA, we place MovHints at Phi
      points. Other than that, you can reconstruct state-at-exit by forward
      propagating MovHints. Note that MovHint is the new SetLocal in SSA.
      SetLocal and GetLocal only survive into SSA if they are on captured
      variables, or in the case of flushes. A "live SetLocal" will be
      NodeMustGenerate and will always correspond to a flush. Computing the
      state-at-exit requires running SSA liveness analysis, OSR availability
      analysis, and flush liveness analysis. The FTL runs all of these prior to
      generating code. While OSR exit continues to be tricky, much of the logic
      is now factored into separate phases and the backend has to do less work
      to reason about what happened outside of the basic block that is being
      lowered.
      
      Conversion from DFG SSA to LLVM SSA is done by ensuring that we generate
      code in depth-first order, thus guaranteeing that a node will always be
      lowered (and hence have a LValue) before any of the blocks dominated by
      that node's block have code generated. For Upsilon/Phi, we just use
      alloca's. We could do something more clever there, but it's probably not
      worth it, at least not now.
      
      Finally, while the SSA form is currently only being converted to LLVM IR,
      there is nothing that prevents us from considering other backends in the
      future - with the caveat that this form is designed to be first lowered to
      a lower-level SSA before actual machine code generation commences. So we
      ought to either use LLVM (the intended path) or we will have to write our
      own SSA low-level backend.
      
      This runs all of the code that the FTL was known to run previously. No
      change in performance for now. But it does open some exciting
      possibilities!
      
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/Operands.h:
      (JSC::OperandValueTraits::dump):
      (JSC::Operands::fill):
      (Operands):
      (JSC::Operands::clear):
      (JSC::Operands::operator==):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::beginBasicBlock):
      (JSC::DFG::setLiveValues):
      (DFG):
      (JSC::DFG::AbstractState::initialize):
      (JSC::DFG::AbstractState::endBasicBlock):
      (JSC::DFG::AbstractState::executeEffects):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      (JSC::DFG::AbstractState::merge):
      * dfg/DFGAbstractState.h:
      (AbstractState):
      * dfg/DFGAdjacencyList.h:
      (JSC::DFG::AdjacencyList::justOneChild):
      (AdjacencyList):
      * dfg/DFGBasicBlock.cpp: Added.
      (DFG):
      (JSC::DFG::BasicBlock::BasicBlock):
      (JSC::DFG::BasicBlock::~BasicBlock):
      (JSC::DFG::BasicBlock::ensureLocals):
      (JSC::DFG::BasicBlock::isInPhis):
      (JSC::DFG::BasicBlock::isInBlock):
      (JSC::DFG::BasicBlock::removePredecessor):
      (JSC::DFG::BasicBlock::replacePredecessor):
      (JSC::DFG::BasicBlock::dump):
      (JSC::DFG::BasicBlock::SSAData::SSAData):
      (JSC::DFG::BasicBlock::SSAData::~SSAData):
      * dfg/DFGBasicBlock.h:
      (BasicBlock):
      (JSC::DFG::BasicBlock::operator[]):
      (JSC::DFG::BasicBlock::successor):
      (JSC::DFG::BasicBlock::successorForCondition):
      (SSAData):
      * dfg/DFGBasicBlockInlines.h:
      (DFG):
      * dfg/DFGBlockInsertionSet.cpp: Added.
      (DFG):
      (JSC::DFG::BlockInsertionSet::BlockInsertionSet):
      (JSC::DFG::BlockInsertionSet::~BlockInsertionSet):
      (JSC::DFG::BlockInsertionSet::insert):
      (JSC::DFG::BlockInsertionSet::insertBefore):
      (JSC::DFG::BlockInsertionSet::execute):
      * dfg/DFGBlockInsertionSet.h: Added.
      (DFG):
      (BlockInsertionSet):
      * dfg/DFGCFAPhase.cpp:
      (JSC::DFG::CFAPhase::run):
      * dfg/DFGCFGSimplificationPhase.cpp:
      * dfg/DFGCPSRethreadingPhase.cpp:
      (JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
      * dfg/DFGCommon.cpp:
      (WTF::printInternal):
      * dfg/DFGCommon.h:
      (JSC::DFG::doesKill):
      (DFG):
      (JSC::DFG::killStatusForDoesKill):
      * dfg/DFGConstantFoldingPhase.cpp:
      (JSC::DFG::ConstantFoldingPhase::foldConstants):
      (JSC::DFG::ConstantFoldingPhase::isCapturedAtOrAfter):
      * dfg/DFGCriticalEdgeBreakingPhase.cpp: Added.
      (DFG):
      (CriticalEdgeBreakingPhase):
      (JSC::DFG::CriticalEdgeBreakingPhase::CriticalEdgeBreakingPhase):
      (JSC::DFG::CriticalEdgeBreakingPhase::run):
      (JSC::DFG::CriticalEdgeBreakingPhase::breakCriticalEdge):
      (JSC::DFG::performCriticalEdgeBreaking):
      * dfg/DFGCriticalEdgeBreakingPhase.h: Added.
      (DFG):
      * dfg/DFGDCEPhase.cpp:
      (JSC::DFG::DCEPhase::run):
      (JSC::DFG::DCEPhase::findTypeCheckRoot):
      (JSC::DFG::DCEPhase::countNode):
      (DCEPhase):
      (JSC::DFG::DCEPhase::countEdge):
      (JSC::DFG::DCEPhase::eliminateIrrelevantPhantomChildren):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * dfg/DFGEdge.cpp:
      (JSC::DFG::Edge::dump):
      * dfg/DFGEdge.h:
      (JSC::DFG::Edge::Edge):
      (JSC::DFG::Edge::setNode):
      (JSC::DFG::Edge::useKindUnchecked):
      (JSC::DFG::Edge::setUseKind):
      (JSC::DFG::Edge::setProofStatus):
      (JSC::DFG::Edge::willNotHaveCheck):
      (JSC::DFG::Edge::willHaveCheck):
      (Edge):
      (JSC::DFG::Edge::killStatusUnchecked):
      (JSC::DFG::Edge::killStatus):
      (JSC::DFG::Edge::setKillStatus):
      (JSC::DFG::Edge::doesKill):
      (JSC::DFG::Edge::doesNotKill):
      (JSC::DFG::Edge::shift):
      (JSC::DFG::Edge::makeWord):
      * dfg/DFGFixupPhase.cpp:
      (JSC::DFG::FixupPhase::fixupNode):
      * dfg/DFGFlushFormat.cpp: Added.
      (WTF):
      (WTF::printInternal):
      * dfg/DFGFlushFormat.h: Added.
      (DFG):
      (JSC::DFG::resultFor):
      (JSC::DFG::useKindFor):
      (WTF):
      * dfg/DFGFlushLivenessAnalysisPhase.cpp: Added.
      (DFG):
      (FlushLivenessAnalysisPhase):
      (JSC::DFG::FlushLivenessAnalysisPhase::FlushLivenessAnalysisPhase):
      (JSC::DFG::FlushLivenessAnalysisPhase::run):
      (JSC::DFG::FlushLivenessAnalysisPhase::process):
      (JSC::DFG::FlushLivenessAnalysisPhase::setForNode):
      (JSC::DFG::FlushLivenessAnalysisPhase::flushFormat):
      (JSC::DFG::performFlushLivenessAnalysis):
      * dfg/DFGFlushLivenessAnalysisPhase.h: Added.
      (DFG):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      (JSC::DFG::Graph::dumpBlockHeader):
      (DFG):
      (JSC::DFG::Graph::addForDepthFirstSort):
      (JSC::DFG::Graph::getBlocksInDepthFirstOrder):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::convertToConstant):
      (JSC::DFG::Graph::valueProfileFor):
      (Graph):
      * dfg/DFGInsertionSet.h:
      (DFG):
      (JSC::DFG::InsertionSet::execute):
      * dfg/DFGLivenessAnalysisPhase.cpp: Added.
      (DFG):
      (LivenessAnalysisPhase):
      (JSC::DFG::LivenessAnalysisPhase::LivenessAnalysisPhase):
      (JSC::DFG::LivenessAnalysisPhase::run):
      (JSC::DFG::LivenessAnalysisPhase::process):
      (JSC::DFG::LivenessAnalysisPhase::addChildUse):
      (JSC::DFG::performLivenessAnalysis):
      * dfg/DFGLivenessAnalysisPhase.h: Added.
      (DFG):
      * dfg/DFGNode.cpp:
      (JSC::DFG::Node::hasVariableAccessData):
      (DFG):
      * dfg/DFGNode.h:
      (DFG):
      (Node):
      (JSC::DFG::Node::hasLocal):
      (JSC::DFG::Node::variableAccessData):
      (JSC::DFG::Node::hasPhi):
      (JSC::DFG::Node::phi):
      (JSC::DFG::Node::takenBlock):
      (JSC::DFG::Node::notTakenBlock):
      (JSC::DFG::Node::successor):
      (JSC::DFG::Node::successorForCondition):
      (JSC::DFG::nodeComparator):
      (JSC::DFG::nodeListDump):
      (JSC::DFG::nodeMapDump):
      * dfg/DFGNodeFlags.cpp:
      (JSC::DFG::dumpNodeFlags):
      * dfg/DFGNodeType.h:
      (DFG):
      * dfg/DFGOSRAvailabilityAnalysisPhase.cpp: Added.
      (DFG):
      (OSRAvailabilityAnalysisPhase):
      (JSC::DFG::OSRAvailabilityAnalysisPhase::OSRAvailabilityAnalysisPhase):
      (JSC::DFG::OSRAvailabilityAnalysisPhase::run):
      (JSC::DFG::performOSRAvailabilityAnalysis):
      * dfg/DFGOSRAvailabilityAnalysisPhase.h: Added.
      (DFG):
      * dfg/DFGPlan.cpp:
      (JSC::DFG::Plan::compileInThreadImpl):
      * dfg/DFGPredictionInjectionPhase.cpp:
      (JSC::DFG::PredictionInjectionPhase::run):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::propagate):
      * dfg/DFGSSAConversionPhase.cpp: Added.
      (DFG):
      (SSAConversionPhase):
      (JSC::DFG::SSAConversionPhase::SSAConversionPhase):
      (JSC::DFG::SSAConversionPhase::run):
      (JSC::DFG::SSAConversionPhase::forwardPhiChildren):
      (JSC::DFG::SSAConversionPhase::forwardPhi):
      (JSC::DFG::SSAConversionPhase::forwardPhiEdge):
      (JSC::DFG::SSAConversionPhase::deduplicateChildren):
      (JSC::DFG::SSAConversionPhase::addFlushedLocalOp):
      (JSC::DFG::SSAConversionPhase::addFlushedLocalEdge):
      (JSC::DFG::performSSAConversion):
      * dfg/DFGSSAConversionPhase.h: Added.
      (DFG):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValidate.cpp:
      (JSC::DFG::Validate::validate):
      (Validate):
      (JSC::DFG::Validate::validateCPS):
      * dfg/DFGVariableAccessData.h:
      (JSC::DFG::VariableAccessData::flushFormat):
      (VariableAccessData):
      * ftl/FTLCapabilities.cpp:
      (JSC::FTL::canCompile):
      * ftl/FTLLowerDFGToLLVM.cpp:
      (JSC::FTL::LowerDFGToLLVM::LowerDFGToLLVM):
      (JSC::FTL::LowerDFGToLLVM::lower):
      (JSC::FTL::LowerDFGToLLVM::createPhiVariables):
      (JSC::FTL::LowerDFGToLLVM::compileBlock):
      (JSC::FTL::LowerDFGToLLVM::compileNode):
      (JSC::FTL::LowerDFGToLLVM::compileUpsilon):
      (LowerDFGToLLVM):
      (JSC::FTL::LowerDFGToLLVM::compilePhi):
      (JSC::FTL::LowerDFGToLLVM::compileJSConstant):
      (JSC::FTL::LowerDFGToLLVM::compileWeakJSConstant):
      (JSC::FTL::LowerDFGToLLVM::compileGetArgument):
      (JSC::FTL::LowerDFGToLLVM::compileGetLocal):
      (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
      (JSC::FTL::LowerDFGToLLVM::compileAdd):
      (JSC::FTL::LowerDFGToLLVM::compileArithSub):
      (JSC::FTL::LowerDFGToLLVM::compileArithMul):
      (JSC::FTL::LowerDFGToLLVM::compileArithDiv):
      (JSC::FTL::LowerDFGToLLVM::compileArithMod):
      (JSC::FTL::LowerDFGToLLVM::compileArithMinOrMax):
      (JSC::FTL::LowerDFGToLLVM::compileArithAbs):
      (JSC::FTL::LowerDFGToLLVM::compileArithNegate):
      (JSC::FTL::LowerDFGToLLVM::compileBitAnd):
      (JSC::FTL::LowerDFGToLLVM::compileBitOr):
      (JSC::FTL::LowerDFGToLLVM::compileBitXor):
      (JSC::FTL::LowerDFGToLLVM::compileBitRShift):
      (JSC::FTL::LowerDFGToLLVM::compileBitLShift):
      (JSC::FTL::LowerDFGToLLVM::compileBitURShift):
      (JSC::FTL::LowerDFGToLLVM::compileUInt32ToNumber):
      (JSC::FTL::LowerDFGToLLVM::compileInt32ToDouble):
      (JSC::FTL::LowerDFGToLLVM::compileGetButterfly):
      (JSC::FTL::LowerDFGToLLVM::compileGetArrayLength):
      (JSC::FTL::LowerDFGToLLVM::compileGetByVal):
      (JSC::FTL::LowerDFGToLLVM::compileGetByOffset):
      (JSC::FTL::LowerDFGToLLVM::compileGetGlobalVar):
      (JSC::FTL::LowerDFGToLLVM::compileCompareEqConstant):
      (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq):
      (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEqConstant):
      (JSC::FTL::LowerDFGToLLVM::compileCompareLess):
      (JSC::FTL::LowerDFGToLLVM::compileCompareLessEq):
      (JSC::FTL::LowerDFGToLLVM::compileCompareGreater):
      (JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq):
      (JSC::FTL::LowerDFGToLLVM::compileLogicalNot):
      (JSC::FTL::LowerDFGToLLVM::speculateBackward):
      (JSC::FTL::LowerDFGToLLVM::lowInt32):
      (JSC::FTL::LowerDFGToLLVM::lowCell):
      (JSC::FTL::LowerDFGToLLVM::lowBoolean):
      (JSC::FTL::LowerDFGToLLVM::lowDouble):
      (JSC::FTL::LowerDFGToLLVM::lowJSValue):
      (JSC::FTL::LowerDFGToLLVM::lowStorage):
      (JSC::FTL::LowerDFGToLLVM::speculate):
      (JSC::FTL::LowerDFGToLLVM::speculateBoolean):
      (JSC::FTL::LowerDFGToLLVM::isLive):
      (JSC::FTL::LowerDFGToLLVM::use):
      (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
      (JSC::FTL::LowerDFGToLLVM::appendOSRExit):
      (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
      (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
      (JSC::FTL::LowerDFGToLLVM::linkOSRExitsAndCompleteInitializationBlocks):
      (JSC::FTL::LowerDFGToLLVM::setInt32):
      (JSC::FTL::LowerDFGToLLVM::setJSValue):
      (JSC::FTL::LowerDFGToLLVM::setBoolean):
      (JSC::FTL::LowerDFGToLLVM::setStorage):
      (JSC::FTL::LowerDFGToLLVM::setDouble):
      (JSC::FTL::LowerDFGToLLVM::isValid):
      * ftl/FTLLoweredNodeValue.h: Added.
      (FTL):
      (LoweredNodeValue):
      (JSC::FTL::LoweredNodeValue::LoweredNodeValue):
      (JSC::FTL::LoweredNodeValue::isSet):
      (JSC::FTL::LoweredNodeValue::operator!):
      (JSC::FTL::LoweredNodeValue::value):
      (JSC::FTL::LoweredNodeValue::block):
      * ftl/FTLValueFromBlock.h:
      (JSC::FTL::ValueFromBlock::ValueFromBlock):
      (ValueFromBlock):
      * ftl/FTLValueSource.cpp:
      (JSC::FTL::ValueSource::dump):
      * ftl/FTLValueSource.h:
      
      Source/WTF:
      
      Reviewed by Mark Hahnenberg.
      
      - Extend variadicity of PrintStream and dataLog.
      
      - Give HashSet the ability to add a span of things.
      
      - Give HashSet the ability to == another HashSet.
      
      - Note FIXME's in HashTable concerning copying performance, that affects
        the way that the DFG now uses HashSets and HashMaps.
      
      - Factor out the bulk-insertion logic of JSC::DFG::InsertionSet into
        WTF::Insertion, so that it can be used in more places.
      
      - Create a dumper for lists and maps.
      
      * WTF.xcodeproj/project.pbxproj:
      * wtf/DataLog.h:
      (WTF):
      (WTF::dataLog):
      * wtf/HashSet.h:
      (HashSet):
      (WTF):
      (WTF::::add):
      (WTF::=):
      * wtf/HashTable.h:
      (WTF::::HashTable):
      (WTF::=):
      * wtf/Insertion.h: Added.
      (WTF):
      (Insertion):
      (WTF::Insertion::Insertion):
      (WTF::Insertion::index):
      (WTF::Insertion::element):
      (WTF::Insertion::operator<):
      (WTF::executeInsertions):
      * wtf/ListDump.h: Added.
      (WTF):
      (ListDump):
      (WTF::ListDump::ListDump):
      (WTF::ListDump::dump):
      (MapDump):
      (WTF::MapDump::MapDump):
      (WTF::MapDump::dump):
      (WTF::listDump):
      (WTF::sortedListDump):
      (WTF::lessThan):
      (WTF::mapDump):
      (WTF::sortedMapDump):
      * wtf/PrintStream.h:
      (PrintStream):
      (WTF::PrintStream::print):
      
      Conflicts:
      	Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153274 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      827d2cf7
    • oliver@apple.com's avatar
      fourthTier: Landing the initial FTL logic in a single commit to avoid spurious · ea77149c
      oliver@apple.com authored
      broken builds.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ea77149c
  8. 09 Feb, 2013 1 commit
    • fpizlo@apple.com's avatar
      DFG should allow phases to break Phi's and then have one phase to rebuild them · 3fa6f5d3
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=108414
      
      Reviewed by Mark Hahnenberg.
              
      Introduces two new DFG forms: LoadStore and ThreadedCPS. These are described in
      detail in DFGCommon.h.
              
      Consequently, DFG phases no longer have to worry about preserving data flow
      links between basic blocks. It is generally always safe to request that the
      graph be dethreaded (Graph::dethread), which brings it into LoadStore form, where
      the data flow is implicit. In this form, only liveness-at-head needs to be
      preserved.
              
      All of the machinery for "threading" the graph to introduce data flow between
      blocks is now moved out of the bytecode parser and into the CPSRethreadingPhase.
      All phases that previously did this maintenance themselves now just rely on
      being able to dethread the graph. The one exception is the structure check
      hoising phase, which operates over a threaded graph and preserves it, for the
      sake of performance.
              
      Also moved two other things into their own phases: unification (previously found
      in the parser) and prediction injection (previously found in various places).
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/Operands.h:
      (Operands):
      (JSC::Operands::sizeFor):
      (JSC::Operands::atFor):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::execute):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      * dfg/DFGAllocator.h:
      (JSC::DFG::::allocateSlow):
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      (JSC::DFG::ArgumentsSimplificationPhase::run):
      * dfg/DFGBasicBlockInlines.h:
      (DFG):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::flushDirect):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (DFG):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCFGSimplificationPhase.cpp:
      (JSC::DFG::CFGSimplificationPhase::run):
      (JSC::DFG::CFGSimplificationPhase::killUnreachable):
      (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
      (CFGSimplificationPhase):
      (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors):
      (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
      * dfg/DFGCPSRethreadingPhase.cpp: Added.
      (DFG):
      (CPSRethreadingPhase):
      (JSC::DFG::CPSRethreadingPhase::CPSRethreadingPhase):
      (JSC::DFG::CPSRethreadingPhase::run):
      (JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
      (JSC::DFG::CPSRethreadingPhase::clearVariablesAtHeadAndTail):
      (JSC::DFG::CPSRethreadingPhase::addPhiSilently):
      (JSC::DFG::CPSRethreadingPhase::addPhi):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocal):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeSetLocal):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocal):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeSetArgument):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
      (JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlocks):
      (JSC::DFG::CPSRethreadingPhase::propagatePhis):
      (JSC::DFG::CPSRethreadingPhase::PhiStackEntry::PhiStackEntry):
      (PhiStackEntry):
      (JSC::DFG::CPSRethreadingPhase::phiStackFor):
      (JSC::DFG::performCPSRethreading):
      * dfg/DFGCPSRethreadingPhase.h: Added.
      (DFG):
      * dfg/DFGCSEPhase.cpp:
      (CSEPhase):
      (JSC::DFG::CSEPhase::performNodeCSE):
      * dfg/DFGCommon.cpp:
      (WTF):
      (WTF::printInternal):
      * dfg/DFGCommon.h:
      (JSC::DFG::logCompilationChanges):
      (DFG):
      (WTF):
      * dfg/DFGConstantFoldingPhase.cpp:
      (JSC::DFG::ConstantFoldingPhase::foldConstants):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::Graph):
      (JSC::DFG::Graph::dump):
      (JSC::DFG::Graph::dethread):
      (JSC::DFG::Graph::collectGarbage):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::performSubstitution):
      (Graph):
      (JSC::DFG::Graph::performSubstitutionForEdge):
      (JSC::DFG::Graph::convertToConstant):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::convertToPhantomLocal):
      (Node):
      (JSC::DFG::Node::convertToGetLocal):
      (JSC::DFG::Node::hasVariableAccessData):
      * dfg/DFGNodeType.h:
      (DFG):
      * dfg/DFGPhase.cpp:
      (JSC::DFG::Phase::beginPhase):
      * dfg/DFGPhase.h:
      (JSC::DFG::runAndLog):
      * dfg/DFGPredictionInjectionPhase.cpp: Added.
      (DFG):
      (PredictionInjectionPhase):
      (JSC::DFG::PredictionInjectionPhase::PredictionInjectionPhase):
      (JSC::DFG::PredictionInjectionPhase::run):
      (JSC::DFG::performPredictionInjection):
      * dfg/DFGPredictionInjectionPhase.h: Added.
      (DFG):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::run):
      (JSC::DFG::PredictionPropagationPhase::propagate):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGStructureCheckHoistingPhase.cpp:
      (JSC::DFG::StructureCheckHoistingPhase::run):
      * dfg/DFGUnificationPhase.cpp: Added.
      (DFG):
      (UnificationPhase):
      (JSC::DFG::UnificationPhase::UnificationPhase):
      (JSC::DFG::UnificationPhase::run):
      (JSC::DFG::performUnification):
      * dfg/DFGUnificationPhase.h: Added.
      (DFG):
      * dfg/DFGValidate.cpp:
      (JSC::DFG::Validate::validate):
      (JSC::DFG::Validate::dumpGraphIfAppropriate):
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      (JSC::DFG::VirtualRegisterAllocationPhase::run):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::setUpCall):
      * runtime/JSCJSValue.cpp:
      (JSC::JSValue::dump):
      * runtime/JSString.h:
      (JSString):
      * runtime/Options.h:
      (JSC):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@142377 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3fa6f5d3
  9. 20 Jan, 2013 1 commit
    • fpizlo@apple.com's avatar
      Inserting a node into the DFG graph should not require five lines of code · f45e88b5
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=107381
      
      Reviewed by Sam Weinig.
              
      This adds fairly comprehensive support for inserting a node into a DFG graph in one
      method call. A common example of this is:
              
      m_insertionSet.insertNode(indexInBlock, DontRefChildren, DontRefNode, SpecNone, ForceOSRExit, codeOrigin);
              
      The arguments to insert() specify what reference counting you need to have happen
      (RefChildren => recursively refs all children, RefNode => non-recursively refs the node
      that was created), the prediction to set (SpecNone is a common default), followed by
      the arguments to the Node() constructor. InsertionSet::insertNode() and similar methods
      (Graph::addNode() and BasicBlock::appendNode()) all use a common variadic template
      function macro from DFGVariadicFunction.h. Also, all of these methods will automatically
      non-recursively ref() the node being created if the flags say NodeMustGenerate.
              
      In all, this new mechanism retains the flexibility of the old approach (you get to
      manage ref counts yourself, albeit in less code) while ensuring that most code that adds
      nodes to the graph now needs less code to do it.
              
      In the future, we should revisit the reference counting methodology in the DFG: we could
      do like most compilers and get rid of it entirely, or we could make it automatic. This
      patch doesn't attempt to make any such major changes, and only seeks to simplify the
      technique we were already using (manual ref counting).
      
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/Operands.h:
      (JSC::dumpOperands):
      * dfg/DFGAdjacencyList.h:
      (AdjacencyList):
      (JSC::DFG::AdjacencyList::kind):
      * dfg/DFGArgumentsSimplificationPhase.cpp:
      (JSC::DFG::ArgumentsSimplificationPhase::run):
      * dfg/DFGBasicBlock.h:
      (DFG):
      (BasicBlock):
      * dfg/DFGBasicBlockInlines.h: Added.
      (DFG):
      * dfg/DFGCFGSimplificationPhase.cpp:
      (JSC::DFG::CFGSimplificationPhase::run):
      (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
      * dfg/DFGCommon.h:
      * dfg/DFGConstantFoldingPhase.cpp:
      (JSC::DFG::ConstantFoldingPhase::ConstantFoldingPhase):
      (JSC::DFG::ConstantFoldingPhase::foldConstants):
      (JSC::DFG::ConstantFoldingPhase::addStructureTransitionCheck):
      (JSC::DFG::ConstantFoldingPhase::paintUnreachableCode):
      (ConstantFoldingPhase):
      * dfg/DFGFixupPhase.cpp:
      (JSC::DFG::FixupPhase::FixupPhase):
      (JSC::DFG::FixupPhase::fixupBlock):
      (JSC::DFG::FixupPhase::fixupNode):
      (FixupPhase):
      (JSC::DFG::FixupPhase::checkArray):
      (JSC::DFG::FixupPhase::blessArrayOperation):
      (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::ref):
      (Graph):
      * dfg/DFGInsertionSet.h:
      (DFG):
      (JSC::DFG::Insertion::Insertion):
      (JSC::DFG::Insertion::element):
      (Insertion):
      (JSC::DFG::InsertionSet::InsertionSet):
      (JSC::DFG::InsertionSet::insert):
      (InsertionSet):
      (JSC::DFG::InsertionSet::execute):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::Node):
      (Node):
      * dfg/DFGStructureCheckHoistingPhase.cpp:
      (JSC::DFG::StructureCheckHoistingPhase::run):
      * dfg/DFGVariadicFunction.h: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140275 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f45e88b5
  10. 15 Jan, 2013 1 commit
    • fpizlo@apple.com's avatar
      Python implementation reports "MemoryError" instead of doing things · 359475a2
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=106690
      
      Source/JavaScriptCore: 
      
      Reviewed by Oliver Hunt.
              
      The bug was that the CFA was assuming that a variable is dead at the end of a basic block and hence doesn't need to
      be merged to the next block if the last mention of the variable was dead. This is almost correct, except that it
      doesn't work if the last mention is a GetLocal - the GetLocal itself may be dead, but that doesn't mean that the
      variable is dead - it may still be live. The appropriate thing to do is to look at the GetLocal's Phi. If the
      variable is used in the next block then the next block will have a reference to the last mention in our block unless
      that last mention is a GetLocal, in which case it will link to the Phi. Doing it this way captures everything that
      the CFA wants: if the last use is a live GetLocal then the CFA needs to consider the GetLocal itself for possible
      refinements to the proof of the value in the variable, but if the GetLocal is dead, then this must mean that the
      variable is not mentioned in the block but may still be "passed through" it, which is what the Phi will tell us.
      Note that it is not possible for the GetLocal to refer to anything other than a Phi, and it is also not possible
      for the last mention of a variable to be a dead GetLocal while there are other mentions that aren't dead - if
      there had been SetLocals or GetLocals prior to the dead one then the dead one wouldn't have been emitted by the
      parser.
              
      This also fixes a similar bug in the handling of captured variables. If a variable is captured, then it doesn't
      matter if the last mention is dead, or not. Either way, we already know that a captured variable will be live in
      the next block, so we must merge it no matter what.
              
      Finally, this change makes the output of Operands dumping a bit more verbose: it now prints the variable name next
      to each variable's dump. I've often found the lack of this information confusing particularly for operand dumps
      that involve a lot of variables.
      
      * bytecode/Operands.h:
      (JSC::dumpOperands):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::mergeStateAtTail):
      
      LayoutTests: 
      
      Reviewed by Oliver Hunt.
      
      * fast/js/dfg-cfa-merge-with-dead-use-at-tail-expected.txt: Added.
      * fast/js/dfg-cfa-merge-with-dead-use-at-tail.html: Added.
      * fast/js/jsc-test-list:
      * fast/js/script-tests/dfg-cfa-merge-with-dead-use-at-tail.js: Added.
      (foo):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139687 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      359475a2
  11. 24 Nov, 2012 1 commit
    • fpizlo@apple.com's avatar
      Any function that can log things should be able to easily log them to a memory buffer as well · 2ee99366
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=103000
      
      Reviewed by Sam Weinig.
      
      Source/JavaScriptCore: 
      
      Change all users of WTF::dataFile() to expect a PrintStream& rather than a FILE*.
      
      * bytecode/Operands.h:
      (JSC::OperandValueTraits::dump):
      (JSC::dumpOperands):
      (JSC):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::dump):
      * dfg/DFGAbstractState.h:
      (AbstractState):
      * dfg/DFGAbstractValue.h:
      (JSC::DFG::AbstractValue::dump):
      * dfg/DFGCommon.h:
      (JSC::DFG::NodeIndexTraits::dump):
      * dfg/DFGStructureAbstractValue.h:
      (JSC::DFG::StructureAbstractValue::dump):
      * dfg/DFGVariableEvent.cpp:
      (JSC::DFG::VariableEvent::dump):
      (JSC::DFG::VariableEvent::dumpFillInfo):
      (JSC::DFG::VariableEvent::dumpSpillInfo):
      * dfg/DFGVariableEvent.h:
      (VariableEvent):
      * disassembler/Disassembler.h:
      (JSC):
      (JSC::tryToDisassemble):
      * disassembler/UDis86Disassembler.cpp:
      (JSC::tryToDisassemble):
      
      Source/WTF: 
      
      We have a number of places where we pass around a FILE* as a target to which to print
      some logging information. But the purpose of passing FILE* instead of always assuming
      that we should dump to stderr is that it may be sometimes useful to send the logging
      information elsewhere. Unfortunately, FILE* isn't quite powerful enough: it's combersome
      to use it to send logging to a string, for example.
              
      We could get around this by using <iostream> and <sstream>, but so far this aspect of
      C++ has not been part of the WebKit coding conventions. Personally I find <iostream>
      awkward due to its abuse of operator overloading.
              
      So this patch introduces the PrintStream abstract class, which offers printf-like
      functionality while completely abstracting the destination and mechanism of the printing
      output. It would be trivial to implement a StringPrintStream, for example. This will feed
      into work on https://bugs.webkit.org/show_bug.cgi?id=102999.
              
      This also sets us up for creating templatized print() and println() methods that will
      allow us to say things like out.print("count = ", count, "\n"), but that is the topic
      of https://bugs.webkit.org/show_bug.cgi?id=103009.
              
      This patch also changes dataLog() to use FilePrintStream internally, and WTF::dataFile()
      now returns a FilePrintStream&. Any previous users of WTF::dataFile() have been changed
      to expect a PrintStream&.
      
      * GNUmakefile.list.am:
      * WTF.pro:
      * WTF.vcproj/WTF.vcproj:
      * WTF.xcodeproj/project.pbxproj:
      * wtf/CMakeLists.txt:
      * wtf/DataLog.cpp:
      (WTF):
      (WTF::initializeLogFileOnce):
      (WTF::initializeLogFile):
      (WTF::dataFile):
      (WTF::dataLogV):
      (WTF::dataLogString):
      * wtf/DataLog.h:
      (WTF):
      * wtf/FilePrintStream.cpp: Added.
      (WTF):
      (WTF::FilePrintStream::FilePrintStream):
      (WTF::FilePrintStream::~FilePrintStream):
      (WTF::FilePrintStream::vprintf):
      (WTF::FilePrintStream::flush):
      * wtf/FilePrintStream.h: Added.
      (WTF):
      (FilePrintStream):
      (WTF::FilePrintStream::file):
      * wtf/PrintStream.cpp: Added.
      (WTF):
      (WTF::PrintStream::PrintStream):
      (WTF::PrintStream::~PrintStream):
      (WTF::PrintStream::printf):
      (WTF::PrintStream::print):
      (WTF::PrintStream::println):
      (WTF::PrintStream::flush):
      (WTF::print):
      * wtf/PrintStream.h: Added.
      (WTF):
      (PrintStream):
      (WTF::print):
      (WTF::println):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@135640 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2ee99366
  12. 22 Nov, 2012 1 commit
  13. 30 Aug, 2012 1 commit
    • ggaren@apple.com's avatar
      Use one object instead of two for closures, eliminating ScopeChainNode · b11e7874
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=95501
      
      Reviewed by Filip Pizlo.
      
      ../JavaScriptCore: 
      
      This patch removes ScopeChainNode, and moves all the data and related
      functions that used to be in ScopeChainNode into JSScope.
      
      Most of this patch is mechanical changes to use a JSScope* where we used
      to use a ScopeChainNode*. I've only specifically commented about items
      that were non-mechanical.
      
      * runtime/Completion.cpp:
      (JSC::evaluate):
      * runtime/Completion.h: Don't require an explicit scope chain argument
      when evaluating code. Clients never wanted anything other than the
      global scope, and other arbitrary scopes probably wouldn't work
      correctly, anyway.
      
      * runtime/JSScope.cpp:
      * runtime/JSScope.h:
      (JSC::JSScope::JSScope): JSScope now requires the data we used to pass to
      ScopeChainNode, so it can link itself into the scope chain correctly.
      
      * runtime/JSWithScope.h:
      (JSC::JSWithScope::create):
      (JSC::JSWithScope::JSWithScope): JSWithScope gets an extra constructor
      for specifically supplying your own scope chain. The DOM needs this
      interface for setting up the scope chain for certain event handlers.
      Other clients always just push the JSWithScope to the head of the current
      scope chain.
      
      ../WebCore: 
      
      Mechanical changes to update for JSC interface changes.
      
      ../WebKit/mac: 
      
      Mechanical change to update for JSC interface change.
      
      ../WebKit/qt: 
      
      Mechanical change to update for JSC interface change.
      
      * Api/qwebelement.cpp:
      (QWebElement::evaluateJavaScript):
      
      ../WebKit2: 
      
      Mechanical changes to update for JSC interface change.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b11e7874
  14. 03 Jul, 2012 1 commit
    • fpizlo@apple.com's avatar
      DFG OSR exit value recoveries should be computed lazily · 8618e4ba
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=82155
      
      Reviewed by Gavin Barraclough.
              
      This change aims to reduce one aspect of DFG compile times: the fact
      that we currently compute the value recoveries for each local and
      argument on every speculation check. We compile many speculation checks,
      so this can add up quick. The strategy that this change takes is to
      have the DFG save just enough information about how the compiler is
      choosing to represent state, that the DFG::OSRExitCompiler can reify
      the value recoveries lazily.
              
      This appears to be an 0.3% SunSpider speed-up and is neutral elsewhere.
              
      I also took the opportunity to fix the sampling regions profiler (it
      was missing an export macro) and to put in more sampling regions in
      the DFG (which are disabled so long as ENABLE(SAMPLING_REGIONS) is
      false).
              
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CodeBlock.cpp:
      (JSC):
      (JSC::CodeBlock::shrinkDFGDataToFit):
      * bytecode/CodeBlock.h:
      (CodeBlock):
      (JSC::CodeBlock::minifiedDFG):
      (JSC::CodeBlock::variableEventStream):
      (DFGData):
      * bytecode/Operands.h:
      (JSC::Operands::hasOperand):
      (Operands):
      (JSC::Operands::size):
      (JSC::Operands::at):
      (JSC::Operands::operator[]):
      (JSC::Operands::isArgument):
      (JSC::Operands::isVariable):
      (JSC::Operands::argumentForIndex):
      (JSC::Operands::variableForIndex):
      (JSC::Operands::operandForIndex):
      (JSC):
      (JSC::dumpOperands):
      * bytecode/SamplingTool.h:
      (SamplingRegion):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::parse):
      * dfg/DFGCFAPhase.cpp:
      (JSC::DFG::performCFA):
      * dfg/DFGCSEPhase.cpp:
      (JSC::DFG::performCSE):
      * dfg/DFGFixupPhase.cpp:
      (JSC::DFG::performFixup):
      * dfg/DFGGenerationInfo.h:
      (JSC::DFG::GenerationInfo::GenerationInfo):
      (JSC::DFG::GenerationInfo::initConstant):
      (JSC::DFG::GenerationInfo::initInteger):
      (JSC::DFG::GenerationInfo::initJSValue):
      (JSC::DFG::GenerationInfo::initCell):
      (JSC::DFG::GenerationInfo::initBoolean):
      (JSC::DFG::GenerationInfo::initDouble):
      (JSC::DFG::GenerationInfo::initStorage):
      (GenerationInfo):
      (JSC::DFG::GenerationInfo::noticeOSRBirth):
      (JSC::DFG::GenerationInfo::use):
      (JSC::DFG::GenerationInfo::spill):
      (JSC::DFG::GenerationInfo::setSpilled):
      (JSC::DFG::GenerationInfo::fillJSValue):
      (JSC::DFG::GenerationInfo::fillCell):
      (JSC::DFG::GenerationInfo::fillInteger):
      (JSC::DFG::GenerationInfo::fillBoolean):
      (JSC::DFG::GenerationInfo::fillDouble):
      (JSC::DFG::GenerationInfo::fillStorage):
      (JSC::DFG::GenerationInfo::appendFill):
      (JSC::DFG::GenerationInfo::appendSpill):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::link):
      (JSC::DFG::JITCompiler::compile):
      (JSC::DFG::JITCompiler::compileFunction):
      * dfg/DFGMinifiedGraph.h: Added.
      (DFG):
      (MinifiedGraph):
      (JSC::DFG::MinifiedGraph::MinifiedGraph):
      (JSC::DFG::MinifiedGraph::at):
      (JSC::DFG::MinifiedGraph::append):
      (JSC::DFG::MinifiedGraph::prepareAndShrink):
      (JSC::DFG::MinifiedGraph::setOriginalGraphSize):
      (JSC::DFG::MinifiedGraph::originalGraphSize):
      * dfg/DFGMinifiedNode.cpp: Added.
      (DFG):
      (JSC::DFG::MinifiedNode::fromNode):
      * dfg/DFGMinifiedNode.h: Added.
      (DFG):
      (JSC::DFG::belongsInMinifiedGraph):
      (MinifiedNode):
      (JSC::DFG::MinifiedNode::MinifiedNode):
      (JSC::DFG::MinifiedNode::index):
      (JSC::DFG::MinifiedNode::op):
      (JSC::DFG::MinifiedNode::hasChild1):
      (JSC::DFG::MinifiedNode::child1):
      (JSC::DFG::MinifiedNode::hasConstant):
      (JSC::DFG::MinifiedNode::hasConstantNumber):
      (JSC::DFG::MinifiedNode::constantNumber):
      (JSC::DFG::MinifiedNode::hasWeakConstant):
      (JSC::DFG::MinifiedNode::weakConstant):
      (JSC::DFG::MinifiedNode::getIndex):
      (JSC::DFG::MinifiedNode::compareByNodeIndex):
      (JSC::DFG::MinifiedNode::hasChild):
      * dfg/DFGNode.h:
      (Node):
      * dfg/DFGOSRExit.cpp:
      (JSC::DFG::OSRExit::OSRExit):
      * dfg/DFGOSRExit.h:
      (OSRExit):
      * dfg/DFGOSRExitCompiler.cpp:
      * dfg/DFGOSRExitCompiler.h:
      (OSRExitCompiler):
      * dfg/DFGOSRExitCompiler32_64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGOSRExitCompiler64.cpp:
      (JSC::DFG::OSRExitCompiler::compileExit):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::performPredictionPropagation):
      * dfg/DFGRedundantPhiEliminationPhase.cpp:
      (JSC::DFG::performRedundantPhiElimination):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      (DFG):
      (JSC::DFG::SpeculativeJIT::fillStorage):
      (JSC::DFG::SpeculativeJIT::noticeOSRBirth):
      (JSC::DFG::SpeculativeJIT::compileMovHint):
      (JSC::DFG::SpeculativeJIT::compile):
      (JSC::DFG::SpeculativeJIT::computeValueRecoveryFor):
      * dfg/DFGSpeculativeJIT.h:
      (DFG):
      (JSC::DFG::SpeculativeJIT::use):
      (SpeculativeJIT):
      (JSC::DFG::SpeculativeJIT::spill):
      (JSC::DFG::SpeculativeJIT::speculationCheck):
      (JSC::DFG::SpeculativeJIT::forwardSpeculationCheck):
      (JSC::DFG::SpeculativeJIT::recordSetLocal):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::fillInteger):
      (JSC::DFG::SpeculativeJIT::fillDouble):
      (JSC::DFG::SpeculativeJIT::fillJSValue):
      (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
      (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
      (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
      (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::fillInteger):
      (JSC::DFG::SpeculativeJIT::fillDouble):
      (JSC::DFG::SpeculativeJIT::fillJSValue):
      (JSC::DFG::SpeculativeJIT::fillSpeculateIntInternal):
      (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
      (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
      (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValueRecoveryOverride.h: Added.
      (DFG):
      (ValueRecoveryOverride):
      (JSC::DFG::ValueRecoveryOverride::ValueRecoveryOverride):
      * dfg/DFGValueSource.cpp: Added.
      (DFG):
      (JSC::DFG::ValueSource::dump):
      * dfg/DFGValueSource.h: Added.
      (DFG):
      (JSC::DFG::dataFormatToValueSourceKind):
      (JSC::DFG::valueSourceKindToDataFormat):
      (JSC::DFG::isInRegisterFile):
      (ValueSource):
      (JSC::DFG::ValueSource::ValueSource):
      (JSC::DFG::ValueSource::forPrediction):
      (JSC::DFG::ValueSource::forDataFormat):
      (JSC::DFG::ValueSource::isSet):
      (JSC::DFG::ValueSource::kind):
      (JSC::DFG::ValueSource::isInRegisterFile):
      (JSC::DFG::ValueSource::dataFormat):
      (JSC::DFG::ValueSource::valueRecovery):
      (JSC::DFG::ValueSource::nodeIndex):
      (JSC::DFG::ValueSource::nodeIndexFromKind):
      (JSC::DFG::ValueSource::kindFromNodeIndex):
      * dfg/DFGVariableEvent.cpp: Added.
      (DFG):
      (JSC::DFG::VariableEvent::dump):
      (JSC::DFG::VariableEvent::dumpFillInfo):
      (JSC::DFG::VariableEvent::dumpSpillInfo):
      * dfg/DFGVariableEvent.h: Added.
      (DFG):
      (VariableEvent):
      (JSC::DFG::VariableEvent::VariableEvent):
      (JSC::DFG::VariableEvent::reset):
      (JSC::DFG::VariableEvent::fillGPR):
      (JSC::DFG::VariableEvent::fillPair):
      (JSC::DFG::VariableEvent::fillFPR):
      (JSC::DFG::VariableEvent::spill):
      (JSC::DFG::VariableEvent::death):
      (JSC::DFG::VariableEvent::setLocal):
      (JSC::DFG::VariableEvent::movHint):
      (JSC::DFG::VariableEvent::kind):
      (JSC::DFG::VariableEvent::nodeIndex):
      (JSC::DFG::VariableEvent::dataFormat):
      (JSC::DFG::VariableEvent::gpr):
      (JSC::DFG::VariableEvent::tagGPR):
      (JSC::DFG::VariableEvent::payloadGPR):
      (JSC::DFG::VariableEvent::fpr):
      (JSC::DFG::VariableEvent::virtualRegister):
      (JSC::DFG::VariableEvent::operand):
      (JSC::DFG::VariableEvent::variableRepresentation):
      * dfg/DFGVariableEventStream.cpp: Added.
      (DFG):
      (JSC::DFG::VariableEventStream::logEvent):
      (MinifiedGenerationInfo):
      (JSC::DFG::MinifiedGenerationInfo::MinifiedGenerationInfo):
      (JSC::DFG::MinifiedGenerationInfo::update):
      (JSC::DFG::VariableEventStream::reconstruct):
      * dfg/DFGVariableEventStream.h: Added.
      (DFG):
      (VariableEventStream):
      (JSC::DFG::VariableEventStream::appendAndLog):
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      (JSC::DFG::performVirtualRegisterAllocation):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8618e4ba
  15. 18 May, 2012 1 commit
    • fpizlo@apple.com's avatar
      DFG should have control flow graph simplification · 79c51ee1
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=84553
      
      Source/JavaScriptCore: 
      
      Reviewed by Oliver Hunt.
              
      Merged r115512 from dfgopt.
      
      This change gives the DFG the ability to simplify the control flow graph
      as part of an optimization fixpoint that includes CSE, CFA, and constant
      folding. This required a number of interesting changes including:
              
      - Solidifying the set of invariants that the DFG obeys. For example, the
        head and tail of each basic block must advertise the set of live locals
        and the set of available locals, respectively. It must do so by
        referring to the first access to the local in the block (for head) and
        the last one (for tail). This patch introduces the start of a
        validation step that may be turned on even with asserts disabled. To
        ensure that these invariants are preserved, I had to remove the
        redundant phi elimination phase. For now I just remove the call, but in
        the future we will probably remove it entirely unless we find a use for
        it.
              
      - Making it easier to get the boolean version of a JSValue. This is a
        pure operation, but we previously did not treat it as such.
              
      - Fixing the merging and filtering of AbstractValues that correspond to
        concrete JSValues. This was previously broken and was limiting the
        effect of running constant folding. Fixing this meant that I had to
        change how constant folding eliminates GetLocal nodes, so as to ensure
        that the resulting graph still obeys DFG rules.
              
      - Introducing simplified getters for some of the things that DFG phases
        want to know about, like the Nth child of a node (now just
        graph.child(...) if you don't care about performance too much) or
        getting successors of a basic block.
              
      The current CFG simplifier can handle almost all of the cases that it
      ought to handle; the noteworthy one that is not yet handled is removing
      basic blocks that just have jumps. To do this right we need to be able
      to remove jump-only blocks that also perform keep-alive on some values.
      To make this work, we need to be able to hoist the keep-alive into (or
      just above) a Branch. This is not fundamentally difficult but I opted to
      let this patch omit this optimization. We can handle this later.
              
      This is a big win on programs that include inline functions that are
      often called with constant arguments. Of course, SunSpider, V8, and
      Kraken don't count. Those benchmarks are completely neutral with this
      change.
      
      * API/JSValueRef.cpp:
      (JSValueToBoolean):
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * Target.pri:
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::dfgOSREntryDataForBytecodeIndex):
      * bytecode/Operands.h:
      (JSC::Operands::setOperandFirstTime):
      (Operands):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::initialize):
      (JSC::DFG::AbstractState::execute):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      (JSC::DFG::AbstractState::mergeToSuccessors):
      * dfg/DFGAbstractValue.h:
      (JSC::DFG::AbstractValue::isClear):
      (JSC::DFG::AbstractValue::operator!=):
      (JSC::DFG::AbstractValue::merge):
      (JSC::DFG::AbstractValue::filter):
      (JSC::DFG::AbstractValue::validateIgnoringValue):
      (AbstractValue):
      * dfg/DFGAdjacencyList.h:
      (JSC::DFG::AdjacencyList::child):
      (JSC::DFG::AdjacencyList::setChild):
      (AdjacencyList):
      * dfg/DFGBasicBlock.h:
      (JSC::DFG::BasicBlock::~BasicBlock):
      (BasicBlock):
      (JSC::DFG::BasicBlock::numNodes):
      (JSC::DFG::BasicBlock::nodeIndex):
      (JSC::DFG::BasicBlock::isPhiIndex):
      (JSC::DFG::BasicBlock::isInPhis):
      (JSC::DFG::BasicBlock::isInBlock):
      * dfg/DFGByteCodeParser.cpp:
      (ByteCodeParser):
      (DFG):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCFAPhase.cpp:
      (JSC::DFG::CFAPhase::run):
      (JSC::DFG::CFAPhase::performBlockCFA):
      (JSC::DFG::performCFA):
      * dfg/DFGCFAPhase.h:
      (DFG):
      * dfg/DFGCFGSimplificationPhase.cpp: Added.
      (DFG):
      (CFGSimplificationPhase):
      (JSC::DFG::CFGSimplificationPhase::CFGSimplificationPhase):
      (JSC::DFG::CFGSimplificationPhase::run):
      (JSC::DFG::CFGSimplificationPhase::killUnreachable):
      (JSC::DFG::CFGSimplificationPhase::findOperandSource):
      (JSC::DFG::CFGSimplificationPhase::keepOperandAlive):
      (JSC::DFG::CFGSimplificationPhase::fixPossibleGetLocal):
      (JSC::DFG::CFGSimplificationPhase::jettisonBlock):
      (JSC::DFG::CFGSimplificationPhase::fixPhis):
      (JSC::DFG::CFGSimplificationPhase::fixJettisonedPredecessors):
      (JSC::DFG::CFGSimplificationPhase::removePotentiallyDeadPhiReference):
      (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::OperandSubstitution):
      (OperandSubstitution):
      (JSC::DFG::CFGSimplificationPhase::OperandSubstitution::dump):
      (JSC::DFG::CFGSimplificationPhase::skipGetLocal):
      (JSC::DFG::CFGSimplificationPhase::fixTailOperand):
      (JSC::DFG::CFGSimplificationPhase::mergeBlocks):
      (JSC::DFG::performCFGSimplification):
      * dfg/DFGCFGSimplificationPhase.h: Added.
      (DFG):
      * dfg/DFGCSEPhase.cpp:
      (JSC::DFG::CSEPhase::run):
      (CSEPhase):
      (JSC::DFG::CSEPhase::impureCSE):
      (JSC::DFG::CSEPhase::globalVarLoadElimination):
      (JSC::DFG::CSEPhase::getByValLoadElimination):
      (JSC::DFG::CSEPhase::checkStructureLoadElimination):
      (JSC::DFG::CSEPhase::getByOffsetLoadElimination):
      (JSC::DFG::CSEPhase::getPropertyStorageLoadElimination):
      (JSC::DFG::CSEPhase::getIndexedPropertyStorageLoadElimination):
      (JSC::DFG::CSEPhase::performNodeCSE):
      (JSC::DFG::CSEPhase::performBlockCSE):
      (JSC::DFG::performCSE):
      * dfg/DFGCSEPhase.h:
      (DFG):
      * dfg/DFGCommon.h:
      * dfg/DFGConstantFoldingPhase.cpp:
      (JSC::DFG::ConstantFoldingPhase::run):
      (JSC::DFG::performConstantFolding):
      * dfg/DFGConstantFoldingPhase.h:
      (DFG):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * dfg/DFGEdge.h:
      (Edge):
      (JSC::DFG::Edge::operator UnspecifiedBoolType*):
      * dfg/DFGFixupPhase.cpp:
      (JSC::DFG::FixupPhase::run):
      (JSC::DFG::FixupPhase::fixupBlock):
      (JSC::DFG::performFixup):
      * dfg/DFGFixupPhase.h:
      (DFG):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      (JSC::DFG::Graph::handleSuccessor):
      (DFG):
      (JSC::DFG::Graph::determineReachability):
      (JSC::DFG::Graph::resetReachability):
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::deref):
      (JSC::DFG::Graph::changeIndex):
      (Graph):
      (JSC::DFG::Graph::changeEdge):
      (JSC::DFG::Graph::numSuccessors):
      (JSC::DFG::Graph::successor):
      (JSC::DFG::Graph::successorForCondition):
      (JSC::DFG::Graph::isPredictedNumerical):
      (JSC::DFG::Graph::byValIsPure):
      (JSC::DFG::Graph::clobbersWorld):
      (JSC::DFG::Graph::numChildren):
      (JSC::DFG::Graph::child):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::convertToConstant):
      (JSC::DFG::Node::numSuccessors):
      (Node):
      (JSC::DFG::Node::successor):
      (JSC::DFG::Node::successorForCondition):
      * dfg/DFGNodeType.h:
      (DFG):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOperations.cpp:
      * dfg/DFGPhase.cpp:
      (JSC::DFG::Phase::endPhase):
      * dfg/DFGPhase.h:
      (JSC::DFG::runPhase):
      * dfg/DFGPredictionPropagationPhase.cpp:
      (JSC::DFG::PredictionPropagationPhase::run):
      (JSC::DFG::performPredictionPropagation):
      * dfg/DFGPredictionPropagationPhase.h:
      (DFG):
      * dfg/DFGRedundantPhiEliminationPhase.cpp:
      (JSC::DFG::RedundantPhiEliminationPhase::run):
      (JSC::DFG::performRedundantPhiElimination):
      * dfg/DFGRedundantPhiEliminationPhase.h:
      (DFG):
      * dfg/DFGScoreBoard.h:
      (JSC::DFG::ScoreBoard::use):
      (ScoreBoard):
      (JSC::DFG::ScoreBoard::useIfHasResult):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      (JSC::DFG::SpeculativeJIT::createOSREntries):
      (JSC::DFG::SpeculativeJIT::linkOSREntries):
      (JSC::DFG::SpeculativeJIT::compileStrictEqForConstant):
      (JSC::DFG::SpeculativeJIT::compileRegExpExec):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::nextBlock):
      (SpeculativeJIT):
      (JSC::DFG::SpeculativeJIT::use):
      (JSC::DFG::SpeculativeJIT::jump):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranchNull):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
      (JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGValidate.cpp: Added.
      (DFG):
      (Validate):
      (JSC::DFG::Validate::Validate):
      (JSC::DFG::Validate::validate):
      (JSC::DFG::Validate::reportValidationContext):
      (JSC::DFG::Validate::dumpData):
      (JSC::DFG::Validate::dumpGraphIfAppropriate):
      (JSC::DFG::validate):
      * dfg/DFGValidate.h: Added.
      (DFG):
      (JSC::DFG::validate):
      * dfg/DFGVirtualRegisterAllocationPhase.cpp:
      (JSC::DFG::VirtualRegisterAllocationPhase::run):
      (JSC::DFG::performVirtualRegisterAllocation):
      * dfg/DFGVirtualRegisterAllocationPhase.h:
      (DFG):
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::privateExecute):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * llint/LLIntSlowPaths.cpp:
      (JSC::LLInt::LLINT_SLOW_PATH_DECL):
      * runtime/ArrayPrototype.cpp:
      (JSC::arrayProtoFuncFilter):
      (JSC::arrayProtoFuncEvery):
      (JSC::arrayProtoFuncSome):
      * runtime/BooleanConstructor.cpp:
      (JSC::constructBoolean):
      (JSC::callBooleanConstructor):
      * runtime/JSCell.h:
      (JSCell):
      * runtime/JSObject.cpp:
      (JSC):
      * runtime/JSObject.h:
      * runtime/JSString.cpp:
      (JSC::JSString::toBoolean):
      * runtime/JSString.h:
      (JSString):
      (JSC::JSCell::toBoolean):
      (JSC::JSValue::toBoolean):
      * runtime/JSValue.h:
      * runtime/ObjectConstructor.cpp:
      (JSC::toPropertyDescriptor):
      * runtime/RegExpConstructor.cpp:
      (JSC::setRegExpConstructorMultiline):
      * runtime/RegExpPrototype.cpp:
      (JSC::regExpProtoFuncToString):
      
      Source/WebCore: 
      
      Reviewed by Oliver Hunt.
      
      Merged r115512 from dfgopt.
      
      JSValue::toBoolean(ExecState*) -> JSValue::toBoolean()
              
      No new tests, because no new behavior.
      
      * bindings/js/JSCustomSQLStatementErrorCallback.cpp:
      (WebCore::JSSQLStatementErrorCallback::handleEvent):
      * bindings/js/JSDOMWindowCustom.cpp:
      (WebCore::JSDOMWindow::addEventListener):
      (WebCore::JSDOMWindow::removeEventListener):
      * bindings/js/JSDataViewCustom.cpp:
      (WebCore::getDataViewMember):
      * bindings/js/JSDeviceMotionEventCustom.cpp:
      (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
      * bindings/js/JSDeviceOrientationEventCustom.cpp:
      (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
      * bindings/js/JSDictionary.cpp:
      (WebCore::JSDictionary::convertValue):
      * bindings/js/JSDirectoryEntryCustom.cpp:
      (WebCore::JSDirectoryEntry::getFile):
      (WebCore::JSDirectoryEntry::getDirectory):
      * bindings/js/JSDirectoryEntrySyncCustom.cpp:
      (WebCore::getFlags):
      * bindings/js/JSHTMLCanvasElementCustom.cpp:
      (WebCore::JSHTMLCanvasElement::getContext):
      * bindings/js/JSInspectorFrontendHostCustom.cpp:
      (WebCore::JSInspectorFrontendHost::showContextMenu):
      * bindings/js/JSMessageEventCustom.cpp:
      (WebCore::handleInitMessageEvent):
      * bindings/js/JSWebGLRenderingContextCustom.cpp:
      (WebCore::dataFunctionMatrix):
      * bindings/js/JSXMLHttpRequestCustom.cpp:
      (WebCore::JSXMLHttpRequest::open):
      * bindings/js/ScriptDebugServer.cpp:
      (WebCore::ScriptDebugServer::hasBreakpoint):
      * bindings/scripts/CodeGeneratorJS.pm:
      (GenerateEventListenerCall):
      (GenerateImplementation):
      (JSValueToNative):
      * bridge/c/c_utility.cpp:
      (JSC::Bindings::convertValueToNPVariant):
      * bridge/jni/jni_jsobject.mm:
      (JavaJSObject::convertValueToJObject):
      
      Source/WebKit/mac: 
      
      Reviewed by Oliver Hunt.
              
      Merged r115512 from dfgopt.
      
      JSValue::toBoolean(ExecState*) -> JSValue::toBoolean()
              
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      (WebKit::NetscapePluginInstanceProxy::addValueToArray):
      
      Source/WebKit2: 
      
      Reviewed by Oliver Hunt.
      
      Merged r115512 from dfgopt.
      
      JSValue::toBoolean(ExecState*) -> JSValue::toBoolean()
              
      * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
      (WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117646 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      79c51ee1
  16. 04 May, 2012 1 commit
  17. 25 Mar, 2012 1 commit
  18. 12 Dec, 2011 1 commit
    • ggaren@apple.com's avatar
      v8 benchmark takes 12-13 million function call slow paths due to extra arguments · 0af1468f
      ggaren@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=74244
      
      Reviewed by Filip Pizlo.
              
      .arguments function of order the Reversed
              
      10% speedup on v8-raytrace, 1.7% speedup on v8 overall, neutral on Kraken
      and SunSpider.
      
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::valueProfileForArgument): Clarified that the interface
      to this function is an argument number.
      
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::BytecodeGenerator):
      (JSC::BytecodeGenerator::emitCall):
      (JSC::BytecodeGenerator::emitConstruct):
      (JSC::BytecodeGenerator::isArgumentNumber): Switched to using CallFrame
      helper functions for computing offsets for arguments, rather than doing
      the math by hand.
              
      Switched to iterating argument offsets backwards (--) instead of forwards (++).
      
      * bytecompiler/BytecodeGenerator.h:
      (JSC::CallArguments::thisRegister):
      (JSC::CallArguments::argumentRegister):
      (JSC::CallArguments::registerOffset): Updated for arguments being reversed.
      
      * bytecompiler/NodesCodegen.cpp: Allocate arguments in reverse order.
      
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::setArgument):
      (JSC::DFG::ByteCodeParser::flush):
      (JSC::DFG::ByteCodeParser::addCall):
      (JSC::DFG::ByteCodeParser::handleCall):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::handleMinMax):
      (JSC::DFG::ByteCodeParser::handleIntrinsic):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::processPhiStack): Use abstract argument indices
      that just-in-time convert to bytecode operands (i.e., indexes in the register
      file) through helper functions. This means only one piece of code needs
      to know how arguments are laid out in the register file.
      
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump): Ditto.
      
      * dfg/DFGGraph.h:
      (JSC::DFG::Graph::valueProfileFor): Ditto.
      
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::compileFunction): The whole point of this patch:
      Treat too many arguments as an arity match.
      
      * dfg/DFGOSRExit.h:
      (JSC::DFG::OSRExit::variableForIndex):
      (JSC::DFG::OSRExit::operandForIndex): Use helper functions, as above.
      
      * dfg/DFGOperands.h:
      (JSC::DFG::operandToArgument):
      (JSC::DFG::argumentToOperand): These are now the only two lines of code in
      the DFG compiler that know how arguments are laid out in memory.
      
      (JSC::DFG::Operands::operand):
      (JSC::DFG::Operands::setOperand): Use helper functions, as above.
      
      * dfg/DFGOperations.cpp: The whole point of this patch:
      Treat too many arguments as an arity match.
      
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall): Use helper functions, as above.
              
      Also, don't tag the caller frame slot as a cell, because it's not a cell.
      
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::emitCall): Use helper functions, as above.
      
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compile): Use helper functions, as above.
      
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes): Use already-computed
      argument virtual register instead of recomputing by hand.
      
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::callFrameSlot):
      (JSC::DFG::SpeculativeJIT::argumentSlot):
      (JSC::DFG::SpeculativeJIT::callFrameTagSlot):
      (JSC::DFG::SpeculativeJIT::callFramePayloadSlot):
      (JSC::DFG::SpeculativeJIT::argumentTagSlot):
      (JSC::DFG::SpeculativeJIT::argumentPayloadSlot): Added a few helper
      functions for dealing with callee arguments specifically. These still
      build on top of our other helper functions, and have no direct knowledge
      of how arguments are laid out in the register file.
      
      (JSC::DFG::SpeculativeJIT::resetCallArguments):
      (JSC::DFG::SpeculativeJIT::addCallArgument): Renamed argumentIndex to
      argumentOffset to match CallFrame naming.
      
      (JSC::DFG::SpeculativeJIT::valueSourceReferenceForOperand): Use helper
      functions, as above.
      
      * interpreter/CallFrame.h:
      (JSC::ExecState::argumentOffset):
      (JSC::ExecState::argumentOffsetIncludingThis):
      (JSC::ExecState::argument):
      (JSC::ExecState::setArgument):
      (JSC::ExecState::thisArgumentOffset):
      (JSC::ExecState::thisValue):
      (JSC::ExecState::setThisValue):
      (JSC::ExecState::offsetFor):
      (JSC::ExecState::hostThisRegister):
      (JSC::ExecState::hostThisValue): Added a bunch of helper functions for
      computing where an argument is in the register file. Anything in the
      runtime that needs to access arguments should use these helpers.
      
      * interpreter/CallFrameClosure.h:
      (JSC::CallFrameClosure::setThis):
      (JSC::CallFrameClosure::setArgument):
      (JSC::CallFrameClosure::resetCallFrame): This stuff is a lot simpler, now
      that too many arguments counts as an arity match and doesn't require
      preserving two copies of our arguments.
      
      * interpreter/Interpreter.cpp:
      (JSC::Interpreter::slideRegisterWindowForCall): Only need to do something
      special if the caller provided too few arguments.
              
      Key simplification: We never need to maintain two copies of our arguments
      anymore.
      
      (JSC::eval):
      (JSC::loadVarargs): Use helper functions.
      
      (JSC::Interpreter::unwindCallFrame): Updated for new interface.
      
      (JSC::Interpreter::execute):
      (JSC::Interpreter::executeCall):
      (JSC::Interpreter::executeConstruct):
      (JSC::Interpreter::prepareForRepeatCall): Seriously, though: use helper
      functions.
      
      (JSC::Interpreter::privateExecute): No need to check for stack overflow
      when calling host functions because they have zero callee registers.
      
      (JSC::Interpreter::retrieveArguments): Explicitly tear off the arguments
      object, since there's no special constructor for this anymore.
      
      * interpreter/Interpreter.h: Reduced the C++ re-entry depth because some
      workers tests were hitting stack overflow in some of my testing. We should
      make this test more exact in future.
      
      * interpreter/RegisterFile.h: Death to all runtime knowledge of argument
      location that does not belong to the CallFrame class!
      
      * jit/JIT.cpp:
      (JSC::JIT::privateCompile): I am a broken record and I use helper functions.
              
      Also, the whole point of this patch: Treat too many arguments as an arity match.
      
      * jit/JITCall32_64.cpp:
      (JSC::JIT::compileLoadVarargs):
      * jit/JITCall.cpp:
      (JSC::JIT::compileLoadVarargs): Updated the argument copying math to use
      helper functions, for backwards-correctness. Removed the condition
      pertaining to declared argument count because, now that arguments are
      always in just one place, this optimization is valid for all functions.
      Standardized the if predicate for each line of the optimization. This might
      fix a bug, but I couldn't get the bug to crash in practice.
      
      * jit/JITOpcodes32_64.cpp:
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emit_op_get_argument_by_val):
      (JSC::JIT::emitSlow_op_get_argument_by_val):
      * jit/JITOpcodes.cpp:
      (JSC::JIT::emit_op_create_arguments):
      (JSC::JIT::emit_op_get_argument_by_val):
      (JSC::JIT::emitSlow_op_get_argument_by_val): Removed cti_op_create_arguments_no_params
      optimization because it's no longer an optimization, now that arguments
      are always contiguous in a known location.
              
      Updated argument access opcode math for backwards-correctness.
      
      * jit/JITStubs.cpp:
      (JSC::arityCheckFor): Updated just like slideRegisterWindowForCall. This
      function is slightly different because it copies the call frame in
      addition to the arguments. (In the Interpreter, the call frame is not
      set up by this point.)
      
      (JSC::lazyLinkFor): The whole point of this patch: Treat too many
      arguments as an arity match.
      
      (JSC::DEFINE_STUB_FUNCTION): Updated for new iterface to tearOff().
      
      * jit/JITStubs.h:
      * jit/SpecializedThunkJIT.h:
      (JSC::SpecializedThunkJIT::loadDoubleArgument):
      (JSC::SpecializedThunkJIT::loadCellArgument):
      (JSC::SpecializedThunkJIT::loadInt32Argument): Use helper functions! They
      build strong bones and teeth!
      
      * runtime/ArgList.cpp:
      (JSC::ArgList::getSlice):
      (JSC::MarkedArgumentBuffer::slowAppend):
      * runtime/ArgList.h:
      (JSC::MarkedArgumentBuffer::MarkedArgumentBuffer):
      (JSC::MarkedArgumentBuffer::~MarkedArgumentBuffer):
      (JSC::MarkedArgumentBuffer::at):
      (JSC::MarkedArgumentBuffer::clear):
      (JSC::MarkedArgumentBuffer::append):
      (JSC::MarkedArgumentBuffer::removeLast):
      (JSC::MarkedArgumentBuffer::last):
      (JSC::ArgList::ArgList):
      (JSC::ArgList::at): Updated for backwards-correctness. WTF::Vector doesn't
      play nice with backwards-ness, so I changed to using manual allocation.
              
      Fixed a FIXME about not all values being marked in the case of out-of-line
      arguments. I had to rewrite the loop anyway, and I didn't feel like
      maintaining fidelity to its old bugs.
      
      * runtime/Arguments.cpp:
      (JSC::Arguments::visitChildren):
      (JSC::Arguments::copyToArguments):
      (JSC::Arguments::fillArgList):
      (JSC::Arguments::getOwnPropertySlotByIndex):
      (JSC::Arguments::getOwnPropertySlot):
      (JSC::Arguments::getOwnPropertyDescriptor):
      (JSC::Arguments::putByIndex):
      (JSC::Arguments::put):
      (JSC::Arguments::tearOff):
      * runtime/Arguments.h:
      (JSC::Arguments::create):
      (JSC::Arguments::Arguments):
      (JSC::Arguments::argument):
      (JSC::Arguments::finishCreation): Secondary benefit of this patch: deleted
      lots of tricky code designed to maintain two different copies of function
      arguments. Now that arguments are always contiguous in one place in memory,
      this complexity can go away.
              
      Reduced down to one create function for the Arguments class, from three.
      
      Moved tearOff() into an out-of-line function because it's huge.
              
      Moved logic about whether to tear off eagerly into the Arguments class,
      so we didn't have to duplicate it elsewhere.
      
      * runtime/JSActivation.cpp:
      (JSC::JSActivation::JSActivation):
      (JSC::JSActivation::visitChildren): Renamed m_numParametersMinusThis to
      m_numCapturedArgs because if the value really were m_numParametersMinusThis
      we would be marking too much. (We shouldn't mark 'this' because it can't
      be captured.) Also, use helper functions.
      
      * runtime/JSActivation.h:
      (JSC::JSActivation::tearOff): Use helper functions.
      
      * runtime/JSArray.cpp:
      (JSC::JSArray::copyToArguments):
      * runtime/JSArray.h: Use helper functions, as above.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@102545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0af1468f
  19. 22 Nov, 2011 1 commit
    • fpizlo@apple.com's avatar
      DFG should have richer debug output for CFA and phi processing · fab66057
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=72922
      
      Reviewed by Gavin Barraclough.
              
      In the default verbose mode, we now print information about variable
      state at the bottom of basic blocks in addition to the top, and we
      also print local variable linking. In the verbose propagation mode,
      the state of phi processing is dumped more richly and CFA merging (the
      most subtle part of CFA) is traced as well.
      
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::endBasicBlock):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      * dfg/DFGAbstractValue.h:
      (JSC::DFG::StructureAbstractValue::dump):
      (JSC::DFG::AbstractValue::dump):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::processPhiStack):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCommon.h:
      (JSC::DFG::NodeIndexTraits::dump):
      * dfg/DFGDriver.cpp:
      (JSC::DFG::compile):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::dumpChildren):
      * dfg/DFGOSRExitCompiler.cpp:
      * dfg/DFGOperands.h:
      (JSC::DFG::OperandValueTraits::dump):
      (JSC::DFG::dumpOperands):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fab66057
  20. 22 Oct, 2011 1 commit
    • fpizlo@apple.com's avatar
      DFG should have inlining · d9ded3b5
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69996
      
      Reviewed by Oliver Hunt.
              
      Implements inlining that's hooked into the bytecode parser. Only
      works for calls, for now, though nothing fundamentally prevents us
      from inlining constructor calls. 2% overall speed-up on all
      benchmarks. 7% speed-up on V8 (around 34% and 27% on deltablue and
      richards respectively), neutral on Kraken and SunSpider. 
              
      * bytecode/CodeBlock.cpp:
      (JSC::CodeBlock::visitAggregate):
      * bytecode/CodeBlock.h:
      (JSC::CodeBlock::baselineVersion):
      (JSC::CodeBlock::setInstructionCount):
      (JSC::CodeBlock::likelyToTakeSlowCase):
      (JSC::CodeBlock::couldTakeSlowCase):
      (JSC::CodeBlock::likelyToTakeSpecialFastCase):
      (JSC::CodeBlock::likelyToTakeDeepestSlowCase):
      (JSC::CodeBlock::likelyToTakeAnySlowCase):
      * bytecode/CodeOrigin.h:
      (JSC::CodeOrigin::inlineDepthForCallFrame):
      (JSC::CodeOrigin::inlineDepth):
      (JSC::CodeOrigin::operator==):
      (JSC::CodeOrigin::inlineStack):
      * bytecompiler/BytecodeGenerator.cpp:
      (JSC::BytecodeGenerator::generate):
      * dfg/DFGAbstractState.cpp:
      (JSC::DFG::AbstractState::beginBasicBlock):
      (JSC::DFG::AbstractState::execute):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      * dfg/DFGBasicBlock.h:
      (JSC::DFG::BasicBlock::BasicBlock):
      (JSC::DFG::BasicBlock::ensureLocals):
      (JSC::DFG::UnlinkedBlock::UnlinkedBlock):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::ByteCodeParser):
      (JSC::DFG::ByteCodeParser::getDirect):
      (JSC::DFG::ByteCodeParser::get):
      (JSC::DFG::ByteCodeParser::setDirect):
      (JSC::DFG::ByteCodeParser::set):
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::flush):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::~InlineStackEntry):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::remapOperand):
      (JSC::DFG::ByteCodeParser::handleInlining):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::processPhiStack):
      (JSC::DFG::ByteCodeParser::linkBlock):
      (JSC::DFG::ByteCodeParser::linkBlocks):
      (JSC::DFG::ByteCodeParser::handleSuccessor):
      (JSC::DFG::ByteCodeParser::determineReachability):
      (JSC::DFG::ByteCodeParser::buildOperandMapsIfNecessary):
      (JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
      (JSC::DFG::ByteCodeParser::parseCodeBlock):
      (JSC::DFG::ByteCodeParser::parse):
      * dfg/DFGCapabilities.cpp:
      (JSC::DFG::canHandleOpcodes):
      (JSC::DFG::canCompileOpcodes):
      (JSC::DFG::canInlineOpcodes):
      * dfg/DFGCapabilities.h:
      (JSC::DFG::mightCompileEval):
      (JSC::DFG::mightCompileProgram):
      (JSC::DFG::mightCompileFunctionForCall):
      (JSC::DFG::mightCompileFunctionForConstruct):
      (JSC::DFG::mightInlineFunctionForCall):
      (JSC::DFG::mightInlineFunctionForConstruct):
      (JSC::DFG::canInlineOpcode):
      (JSC::DFG::canInlineOpcodes):
      (JSC::DFG::canInlineFunctionForCall):
      (JSC::DFG::canInlineFunctionForConstruct):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::printWhiteSpace):
      (JSC::DFG::Graph::dumpCodeOrigin):
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      (JSC::DFG::GetBytecodeBeginForBlock::operator()):
      (JSC::DFG::Graph::blockIndexForBytecodeOffset):
      * dfg/DFGJITCompiler.cpp:
      (JSC::DFG::JITCompiler::decodedCodeMapFor):
      (JSC::DFG::JITCompiler::linkOSRExits):
      (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::debugCall):
      (JSC::DFG::JITCompiler::baselineCodeBlockFor):
      * dfg/DFGJITCompiler32_64.cpp:
      (JSC::DFG::JITCompiler::exitSpeculativeWithOSR):
      * dfg/DFGNode.h:
      (JSC::DFG::Node::hasVariableAccessData):
      (JSC::DFG::Node::shouldGenerate):
      * dfg/DFGOperands.h:
      (JSC::DFG::Operands::ensureLocals):
      (JSC::DFG::Operands::setLocal):
      (JSC::DFG::Operands::getLocal):
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::propagateNodePredictions):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::OSRExit::OSRExit):
      (JSC::DFG::SpeculativeJIT::compile):
      (JSC::DFG::SpeculativeJIT::checkArgumentTypes):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compile):
      * interpreter/CallFrame.cpp:
      (JSC::CallFrame::trueCallerFrameSlow):
      * jit/JITCall.cpp:
      (JSC::JIT::compileOpCallSlowCase):
      * jit/JITStubs.cpp:
      (JSC::DEFINE_STUB_FUNCTION):
      * runtime/Executable.cpp:
      (JSC::FunctionExecutable::baselineCodeBlockFor):
      (JSC::FunctionExecutable::produceCodeBlockFor):
      (JSC::FunctionExecutable::compileForCallInternal):
      (JSC::FunctionExecutable::compileForConstructInternal):
      * runtime/Executable.h:
      (JSC::FunctionExecutable::profiledCodeBlockFor):
      (JSC::FunctionExecutable::parameterCount):
      * runtime/Heuristics.cpp:
      (JSC::Heuristics::initializeHeuristics):
      * runtime/Heuristics.h:
      * runtime/JSFunction.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@98179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d9ded3b5
  21. 12 Oct, 2011 1 commit
    • fpizlo@apple.com's avatar
      DFG does not have flow-sensitive intraprocedural control flow analysis · 4ffd3956
      fpizlo@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69690
      
      Reviewed by Gavin Barraclough.
      
      Implemented a control flow analysis (CFA). It currently propagates type
      proofs only. For example, if all predecessors to a basic block have
      checks that variable X is a JSFinalObject with structure 0xabcdef, then
      this basic block will now know this fact and will know that it does not
      have to emit either JSFinalObject checks or any structure checks since
      the structure is precisely known. The CFA takes heap side-effects into
      account (though somewhat conservatively), so that if the object pointed
      to by variable X could have possibly undergone a structure transition
      then this is reflected: the analysis may simply say that X's structure
      is unknown.
              
      This also propagates a wealth of other type information which is
      currently not being used. For example, we now know when a variable can
      only hold doubles. Even if a variable may hold other types at different
      points in its live range, we can still prove exactly when it will only
      be double.
              
      There's a bunch of stuff that the CFA could do that it still does not
      do, like precise handling of PutStructure (i.e. structure transitions),
      precise handling of CheckFunction and CheckMethod, etc. So this is
      very much intended to be a starting point rather than an end unto
      itself.
              
      This is a 1% win on V8 (mostly due to a 3% win on richards and deltablue)
      and a 1% win on Kraken (mostly due to a 6% win on imaging-desaturate).
      Neutral on SunSpider.
      
      * GNUmakefile.list.am:
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
      * JavaScriptCore.xcodeproj/project.pbxproj:
      * bytecode/ActionablePrediction.h: Removed.
      * bytecode/PredictedType.cpp:
      (JSC::predictionToString):
      * bytecode/PredictedType.h:
      * dfg/DFGAbstractState.cpp: Added.
      (JSC::DFG::AbstractState::AbstractState):
      (JSC::DFG::AbstractState::~AbstractState):
      (JSC::DFG::AbstractState::beginBasicBlock):
      (JSC::DFG::AbstractState::initialize):
      (JSC::DFG::AbstractState::endBasicBlock):
      (JSC::DFG::AbstractState::reset):
      (JSC::DFG::AbstractState::execute):
      (JSC::DFG::AbstractState::clobberStructures):
      (JSC::DFG::AbstractState::mergeStateAtTail):
      (JSC::DFG::AbstractState::merge):
      (JSC::DFG::AbstractState::mergeToSuccessors):
      (JSC::DFG::AbstractState::mergeVariableBetweenBlocks):
      (JSC::DFG::AbstractState::dump):
      * dfg/DFGAbstractState.h: Added.
      (JSC::DFG::AbstractState::forNode):
      (JSC::DFG::AbstractState::isValid):
      * dfg/DFGAbstractValue.h: Added.
      (JSC::DFG::StructureAbstractValue::StructureAbstractValue):
      (JSC::DFG::StructureAbstractValue::clear):
      (JSC::DFG::StructureAbstractValue::makeTop):
      (JSC::DFG::StructureAbstractValue::top):
      (JSC::DFG::StructureAbstractValue::add):
      (JSC::DFG::StructureAbstractValue::addAll):
      (JSC::DFG::StructureAbstractValue::contains):
      (JSC::DFG::StructureAbstractValue::isSubsetOf):
      (JSC::DFG::StructureAbstractValue::doesNotContainAnyOtherThan):
      (JSC::DFG::StructureAbstractValue::isSupersetOf):
      (JSC::DFG::StructureAbstractValue::filter):
      (JSC::DFG::StructureAbstractValue::isClear):
      (JSC::DFG::StructureAbstractValue::isTop):
      (JSC::DFG::StructureAbstractValue::size):
      (JSC::DFG::StructureAbstractValue::at):
      (JSC::DFG::StructureAbstractValue::operator[]):
      (JSC::DFG::StructureAbstractValue::last):
      (JSC::DFG::StructureAbstractValue::predictionFromStructures):
      (JSC::DFG::StructureAbstractValue::operator==):
      (JSC::DFG::StructureAbstractValue::dump):
      (JSC::DFG::AbstractValue::AbstractValue):
      (JSC::DFG::AbstractValue::clear):
      (JSC::DFG::AbstractValue::isClear):
      (JSC::DFG::AbstractValue::makeTop):
      (JSC::DFG::AbstractValue::clobberStructures):
      (JSC::DFG::AbstractValue::isTop):
      (JSC::DFG::AbstractValue::top):
      (JSC::DFG::AbstractValue::set):
      (JSC::DFG::AbstractValue::operator==):
      (JSC::DFG::AbstractValue::merge):
      (JSC::DFG::AbstractValue::filter):
      (JSC::DFG::AbstractValue::validate):
      (JSC::DFG::AbstractValue::dump):
      * dfg/DFGBasicBlock.h: Added.
      (JSC::DFG::BasicBlock::BasicBlock):
      (JSC::DFG::BasicBlock::getBytecodeBegin):
      * dfg/DFGByteCodeParser.cpp:
      (JSC::DFG::ByteCodeParser::getLocal):
      (JSC::DFG::ByteCodeParser::setLocal):
      (JSC::DFG::ByteCodeParser::getArgument):
      (JSC::DFG::ByteCodeParser::setArgument):
      (JSC::DFG::ByteCodeParser::parseBlock):
      (JSC::DFG::ByteCodeParser::processPhiStack):
      (JSC::DFG::ByteCodeParser::setupPredecessors):
      * dfg/DFGGraph.cpp:
      (JSC::DFG::Graph::dump):
      * dfg/DFGGraph.h:
      * dfg/DFGJITCodeGenerator.h:
      (JSC::DFG::block):
      * dfg/DFGJITCodeGenerator32_64.cpp:
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranchNull):
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranch):
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeStrictEq):
      * dfg/DFGJITCodeGenerator64.cpp:
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranchNull):
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeBranch):
      (JSC::DFG::JITCodeGenerator::nonSpeculativePeepholeStrictEq):
      * dfg/DFGJITCompiler.h:
      (JSC::DFG::JITCompiler::noticeOSREntry):
      * dfg/DFGNode.h:
      (JSC::DFG::NodeIndexTraits::defaultValue):
      (JSC::DFG::Node::variableAccessData):
      (JSC::DFG::Node::takenBytecodeOffsetDuringParsing):
      (JSC::DFG::Node::notTakenBytecodeOffsetDuringParsing):
      (JSC::DFG::Node::setTakenBlockIndex):
      (JSC::DFG::Node::setNotTakenBlockIndex):
      (JSC::DFG::Node::takenBlockIndex):
      (JSC::DFG::Node::notTakenBlockIndex):
      * dfg/DFGOSREntry.cpp:
      (JSC::DFG::prepareOSREntry):
      * dfg/DFGOSREntry.h:
      * dfg/DFGOperands.h: Added.
      (JSC::DFG::operandIsArgument):
      (JSC::DFG::OperandValueTraits::defaultValue):
      (JSC::DFG::Operands::Operands):
      (JSC::DFG::Operands::numberOfArguments):
      (JSC::DFG::Operands::numberOfLocals):
      (JSC::DFG::Operands::argument):
      (JSC::DFG::Operands::local):
      (JSC::DFG::Operands::setLocal):
      (JSC::DFG::Operands::setArgumentFirstTime):
      (JSC::DFG::Operands::setLocalFirstTime):
      (JSC::DFG::Operands::operand):
      (JSC::DFG::Operands::setOperand):
      (JSC::DFG::Operands::clear):
      (JSC::DFG::dumpOperands):
      * dfg/DFGPropagator.cpp:
      (JSC::DFG::Propagator::fixpoint):
      (JSC::DFG::Propagator::propagateArithNodeFlags):
      (JSC::DFG::Propagator::propagateNodePredictions):
      (JSC::DFG::Propagator::propagatePredictions):
      (JSC::DFG::Propagator::performBlockCFA):
      (JSC::DFG::Propagator::performForwardCFA):
      (JSC::DFG::Propagator::globalCFA):
      * dfg/DFGSpeculativeJIT.cpp:
      (JSC::DFG::SpeculativeJIT::compilePeepHoleDoubleBranch):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectEquality):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleIntegerBranch):
      (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      (JSC::DFG::SpeculativeJIT::compileGetCharCodeAt):
      (JSC::DFG::SpeculativeJIT::compileGetByValOnString):
      * dfg/DFGSpeculativeJIT.h:
      (JSC::DFG::SpeculativeJIT::SpeculativeJIT):
      * dfg/DFGSpeculativeJIT32_64.cpp:
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compare):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGSpeculativeJIT64.cpp:
      (JSC::DFG::SpeculativeJIT::compileObjectEquality):
      (JSC::DFG::SpeculativeJIT::compare):
      (JSC::DFG::SpeculativeJIT::compileObjectOrOtherLogicalNot):
      (JSC::DFG::SpeculativeJIT::compileLogicalNot):
      (JSC::DFG::SpeculativeJIT::emitObjectOrOtherBranch):
      (JSC::DFG::SpeculativeJIT::emitBranch):
      (JSC::DFG::SpeculativeJIT::compile):
      * dfg/DFGStructureSet.h:
      (JSC::DFG::StructureSet::clear):
      (JSC::DFG::StructureSet::predictionFromStructures):
      (JSC::DFG::StructureSet::operator==):
      (JSC::DFG::StructureSet::dump):
      * dfg/DFGVariableAccessData.h: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4ffd3956