LegacyProfiler: ProfileNodes should be used more like structs
https://bugs.webkit.org/show_bug.cgi?id=136381

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Previously, both the profile generator and individual profile nodes
were collectively responsible for creating new Call entries and
maintaining data structure invariants. This complexity is unnecessary.

This patch centralizes profile data creation inside the profile generator.
The profile nodes manage nextSibling and parent pointers, but do not
collect the current time or create new Call entries themselves.

Since ProfileNode::nextSibling and its callers are only used within
debug printing code, it should be compiled out for release builds.

* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::ProfileGenerator):
(JSC::AddParentForConsoleStartFunctor::operator()):
(JSC::ProfileGenerator::beginCallEntry): create a new Call entry.
(JSC::ProfileGenerator::endCallEntry): finish the last Call entry.
(JSC::ProfileGenerator::willExecute): inline ProfileNode::willExecute()
(JSC::ProfileGenerator::didExecute): inline ProfileNode::didExecute()
(JSC::ProfileGenerator::stopProfiling): Only walk up the spine.
(JSC::ProfileGenerator::removeProfileStart):
(JSC::ProfileGenerator::removeProfileEnd):
* profiler/ProfileGenerator.h:
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::ProfileNode):
(JSC::ProfileNode::addChild):
(JSC::ProfileNode::removeChild):
(JSC::ProfileNode::spliceNode): Renamed from insertNode.
(JSC::ProfileNode::debugPrintRecursively):
(JSC::ProfileNode::willExecute): Deleted.
(JSC::ProfileNode::insertNode): Deleted.
(JSC::ProfileNode::stopProfiling): Deleted.
(JSC::ProfileNode::traverseNextNodePostOrder):
(JSC::ProfileNode::endAndRecordCall): Deleted.
(JSC::ProfileNode::debugPrintDataSampleStyle):
* profiler/ProfileNode.h:
(JSC::ProfileNode::Call::setStartTime):
(JSC::ProfileNode::Call::setTotalTime):
(JSC::ProfileNode::appendCall):
(JSC::ProfileNode::firstChild):
(JSC::ProfileNode::lastChild):
(JSC::ProfileNode::nextSibling):
(JSC::ProfileNode::setNextSibling):

Source/WebCore:

* inspector/ScriptProfileNode.idl: Remove an unused property.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173262 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r173245.
https://bugs.webkit.org/show_bug.cgi?id=136533

Broke JSC tests. (Requested by ddkilzer on #webkit).

Reverted changeset:

"JavaScriptCore should build with newer clang"
https://bugs.webkit.org/show_bug.cgi?id=136002
http://trac.webkit.org/changeset/173245

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173263 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: the profiler should not accrue time to nodes while the debugger is paused
https://bugs.webkit.org/show_bug.cgi?id=136352

Reviewed by Timothy Hatcher.

Hook up pause/continue events to the LegacyProfiler and any active
ProfilerGenerators. If the debugger is paused, all intervening call
entries will be created with totalTime as 0.0.

* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::handlePause):
* profiler/LegacyProfiler.cpp: Move from typedef'd callbacks to using
std::function. This allows callbacks to take different argument types.

(JSC::callFunctionForProfilesWithGroup):
(JSC::LegacyProfiler::willExecute):
(JSC::LegacyProfiler::didExecute):
(JSC::LegacyProfiler::exceptionUnwind):
(JSC::LegacyProfiler::didPause):
(JSC::LegacyProfiler::didContinue):
(JSC::dispatchFunctionToProfiles): Deleted.
* profiler/LegacyProfiler.h:
* profiler/ProfileGenerator.cpp:
(JSC::ProfileGenerator::ProfileGenerator):
(JSC::ProfileGenerator::endCallEntry):
(JSC::ProfileGenerator::didExecute): Deleted.
* profiler/ProfileGenerator.h:
(JSC::ProfileGenerator::didPause):
(JSC::ProfileGenerator::didContinue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove iOS specific disk image cache
https://bugs.webkit.org/show_bug.cgi?id=136517

Reviewed by Antti Koivisto.

Disk image cache code unnecessarily complicates SharedBuffer implementation. We can remove
this now since we don't enable it in WebKit2 on iOS.

Source/WebCore:

* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceBuffer.cpp:
(WebCore::ResourceBuffer::isUsingDiskImageCache): Deleted.
* loader/ResourceBuffer.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::canUseDiskImageCache): Deleted.
(WebCore::CachedImage::useDiskImageCache): Deleted.
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::isUsingDiskImageCache): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::canUseDiskImageCache): Deleted.
(WebCore::CachedResource::useDiskImageCache): Deleted.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::TypeStatistic::addResource):
(WebCore::MemoryCache::dumpStats):
(WebCore::MemoryCache::dumpLRULists):
(WebCore::MemoryCache::flushCachedImagesToDisk): Deleted.
* loader/cache/MemoryCache.h:
(WebCore::MemoryCache::TypeStatistic::TypeStatistic):
* loader/ios/DiskImageCacheClientIOS.h: Removed.
* loader/ios/DiskImageCacheIOS.h: Removed.
* loader/ios/DiskImageCacheIOS.mm: Removed.
* platform/Logging.h:
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::~SharedBuffer):
(WebCore::SharedBuffer::data):
(WebCore::SharedBuffer::append):
(WebCore::SharedBuffer::buffer):
(WebCore::SharedBuffer::getSomeData):
(WebCore::SharedBuffer::isAllowedToBeMemoryMapped): Deleted.
(WebCore::SharedBuffer::allowToBeMemoryMapped): Deleted.
(WebCore::SharedBuffer::failedMemoryMap): Deleted.
(WebCore::SharedBuffer::markAsMemoryMapped): Deleted.
(WebCore::SharedBuffer::memoryMappedNotificationCallbackData): Deleted.
(WebCore::SharedBuffer::memoryMappedNotificationCallback): Deleted.
(WebCore::SharedBuffer::setMemoryMappedNotificationCallback): Deleted.
* platform/SharedBuffer.h:
(WebCore::SharedBuffer::isMemoryMapped): Deleted.
* platform/cf/SharedBufferCF.cpp:
(WebCore::SharedBuffer::SharedBuffer):
* platform/mac/SharedBufferMac.mm:
(-[WebCoreSharedBufferData length]):
(-[WebCoreSharedBufferData bytes]):
(WebCore::SharedBuffer::createCFData):
(-[WebCoreSharedBufferData initWithMemoryMappedSharedBuffer:]): Deleted.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/ios:

* WebCoreSupport/WebDiskImageCacheClientIOS.h: Removed.
* WebCoreSupport/WebDiskImageCacheClientIOS.mm: Removed.
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder finishedLoadingWithDataSource:]):
(-[WebPDFViewPlaceholder dataSourceMemoryMapped]): Deleted.
(-[WebPDFViewPlaceholder dataSourceMemoryMapFailed]): Deleted.

Source/WebKit/mac:

* Misc/WebCache.mm:
(+[WebCache statistics]):
* WebView/WebDataSource.mm:
(-[WebDataSource _setAllowToBeMemoryMapped]):
(-[WebDataSource setDataSourceDelegate:]):
(-[WebDataSource dataSourceDelegate]):
(-[WebDataSource dealloc]):
(BufferMemoryMapped): Deleted.
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences diskImageCacheEnabled]): Deleted.
(-[WebPreferences setDiskImageCacheEnabled:]): Deleted.
(-[WebPreferences diskImageCacheMinimumImageSize]): Deleted.
(-[WebPreferences setDiskImageCacheMinimumImageSize:]): Deleted.
(-[WebPreferences diskImageCacheMaximumCacheSize]): Deleted.
(-[WebPreferences setDiskImageCacheMaximumCacheSize:]): Deleted.
(-[WebPreferences _diskImageCacheSavedCacheDirectory]): Deleted.
(-[WebPreferences _setDiskImageCacheSavedCacheDirectory:]): Deleted.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(+[WebView _handleMemoryWarning]):
(-[WebView _preferencesChanged:]):

Source/WTF:

* wtf/FeatureDefines.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173265 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r173248.
https://bugs.webkit.org/show_bug.cgi?id=136536

call edge profiling and polymorphic call inlining are still
causing crashes (Requested by eric_carlson on #webkit).

Reverted changeset:

"Reenable call edge profiling and polymorphic call inlining,
now that a bunch of the bugs"
http://trac.webkit.org/changeset/173248

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173266 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r173201.
https://bugs.webkit.org/show_bug.cgi?id=136538

Improves the situation but also introduces additional crashes.
(Requested by zdobersek on #webkit).

Reverted changeset:

"GMainLoopSource is exposed to race conditions"
https://bugs.webkit.org/show_bug.cgi?id=135800
http://trac.webkit.org/changeset/173201

Patch by Commit Queue <commit-queue@webkit.org> on 2014-09-04


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@173267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove CSS_FILTERS flag
https://bugs.webkit.org/show_bug.cgi?id=136529

Patch by Eva Balazsfalvi <evab.u-szeged@partner.samsung.com> on 2014-09-04
Reviewed by Dirk Schulze.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmakeconfig.h.cmake:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No new tests, no behaviour changed.

* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* WebCore.exp.in:
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::toJS):
* bindings/objc/DOMCSS.mm:
(kitClass):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForFilter):
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSFilterImageValue.cpp:
* css/CSSFilterImageValue.h:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseGeneratedImage):
(WebCore::CSSParser::parseFilterImage):
(WebCore::CSSParser::parseFilter):
* css/CSSParser.h:
* css/CSSPropertyNames.in:
* css/CSSValue.cpp:
(WebCore::CSSValue::hasFailedOrCanceledSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::clear):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::generatedOrPendingFromValue):
(WebCore::StyleResolver::loadPendingResources):
* css/StyleResolver.h:
* css/WebKitCSSFilterValue.cpp:
* css/WebKitCSSFilterValue.h:
* css/WebKitCSSFilterValue.idl:
* loader/cache/CachedSVGDocumentReference.cpp:
* loader/cache/CachedSVGDocumentReference.h:
* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsFastPath):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::AnimationBase):
* page/animation/AnimationBase.h:
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilter):
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::reset):
(WebCore::ImplicitAnimation::checkForMatchingFilterFunctionLists):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
* page/animation/KeyframeAnimation.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::validateFilterOperations):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerAnimation.cpp:
(WebCore::applyFilterAnimation):
(WebCore::GraphicsLayerAnimation::applyInternal):
* platform/graphics/GraphicsLayerAnimation.h:
* platform/graphics/IntRectExtent.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::propertyIdToString):
(WebCore::supportsAcceleratedFilterAnimations):
(WebCore::GraphicsLayerCA::filtersCanBeComposited):
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::setFilters):
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateFilters):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes):
(WebCore::GraphicsLayerCA::setFilterAnimationKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCAFilters.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCAAnimationMac.h:
* platform/graphics/ca/mac/PlatformCAAnimationMac.mm:
(PlatformCAAnimationMac::setFromValue):
(PlatformCAAnimationMac::setToValue):
(PlatformCAAnimationMac::setValues):
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::animatedFilterPropertyName):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::clone):
(PlatformCALayerMac::filtersCanBeComposited):
* platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
(PlatformCAAnimationWin::setFromValue):
(PlatformCAAnimationWin::setToValue):
(PlatformCAAnimationWin::setValues):
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
(PlatformCAFilters::animatedFilterPropertyName):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::clone):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/filters/FilterOperation.cpp:
* platform/graphics/filters/FilterOperation.h:
* platform/graphics/filters/FilterOperations.cpp:
* platform/graphics/filters/FilterOperations.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
(WebCore::GraphicsLayerTextureMapper::setFilters):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::TextureMapperGLData):
(WebCore::prepareFilterProgram):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::BitmapTextureGL::applyFilters):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
(WebCore::BitmapTextureImageBuffer::applyFilters):
* platform/graphics/texmap/TextureMapperImageBuffer.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::setAnimatedFilters):
(WebCore::TextureMapperLayer::computeOverlapRegions):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::TextureMapperLayer::setFilters):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::hasFilters):
* platform/graphics/texmap/TextureMapperShaderProgram.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::didChangeFilters):
(WebCore::CoordinatedGraphicsLayer::setFilters):
(WebCore::CoordinatedGraphicsLayer::syncFilters):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
(WebCore::CoordinatedGraphicsScene::setLayerFiltersIfNeeded):
(WebCore::CoordinatedGraphicsScene::setLayerState):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
* rendering/FilterEffectRenderer.cpp:
* rendering/FilterEffectRenderer.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustStyleDifference):
* rendering/RenderElement.h:
(WebCore::RenderElement::hasFilter): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::transparencyClipBox):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateFilters):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::startTransition):
(WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
(WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
(WebCore::RenderLayerCompositor::requiresCompositingForFilters):
* rendering/RenderLayerFilterInfo.cpp:
* rendering/RenderLayerFilterInfo.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleWillChange):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containerForRepaint):
(WebCore::RenderObject::repaintUsingContainer):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView):
* rendering/RenderView.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout):
(WebCore::RenderStyle::changeRequiresLayerRepaint):
* rendering/style/RenderStyle.h:
* rendering/style/StyleFilterData.cpp:
* rendering/style/StyleFilterData.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
(WebCore::StyleRareNonInheritedData::hasFilters):
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::markAllClientLayersForInvalidation):

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
(IPC::ArgumentCoder<WebCore::FilterOperations>::decode):
(IPC::ArgumentCoder<GraphicsLayerAnimation>::encode):
(IPC::ArgumentCoder<GraphicsLayerAnimation>::decode):
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
(IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
* Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
(WebKit::GraphicsLayerCARemote::filtersCanBeComposited):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
(WebKit::PlatformCAAnimationRemote::setFromValue):
(WebKit::PlatformCAAnimationRemote::setToValue):
(WebKit::PlatformCAAnimationRemote::setValues):
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::updateClonedLayerProperties):
(WebKit::PlatformCALayerRemote::filtersCanBeComposited):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* Scripts/webkitperl/FeatureList.pm:

WebKitLibraries:

* win/tools/vsprops/FeatureDefines.props:
* win/tools/vsprops/FeatureDefinesCairo.props:

LayoutTests:

* platform/efl/TestExpectations:

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