The GetById->GetByOffset AI-based optimization should actually do things
https://bugs.webkit.org/show_bug.cgi?id=123299

Reviewed by Oliver Hunt.
        
20% speed-up on Octane/gbemu.

* bytecode/GetByIdStatus.cpp:
(JSC::GetByIdStatus::computeFor): Actually finish filling in the Status by setting the state. Previously it would remain set to NoInformation, meaning that this whole method was a no-op.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Grid Layout] Add support for order inside grid items
https://bugs.webkit.org/show_bug.cgi?id=123208

Reviewed by Antti Koivisto.

Source/WebCore:

Based on Blink r153457 and r153536 by <jchaffraix@chromium.org>

Added support for sorting grid items by using -webkit-order
property. Used OrderIterator to implement it so it had to be moved
out of RenderFlexibleBox to be shared with RenderGrid.

Tests: fast/css-grid-layout/grid-item-order-auto-flow-resolution.html
       fast/css-grid-layout/grid-item-order-paint-order.html

* CMakeLists.txt: Added new file.
* GNUmakefile.list.am: Ditto.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* rendering/OrderIterator.cpp: Added. Ripped out of RenderFlexibleBox.
(WebCore::OrderIterator::OrderIterator):
(WebCore::OrderIterator::setOrderValues): Use std::move semantics.
(WebCore::OrderIterator::first): Use an integer as iterator.
(WebCore::OrderIterator::next): Ditto.
(WebCore::OrderIterator::reset): Ditto.
* rendering/OrderIterator.h: Added.
(WebCore::OrderIterator::currentChild):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::RenderFlexibleBox):
(WebCore::RenderFlexibleBox::layoutBlock):
* rendering/RenderFlexibleBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::RenderGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::paintChildren):
* rendering/RenderGrid.h:

LayoutTests:

From Blink r153536 by <jchaffraix@chromium.org>

Added a couple of tests to verify that we respect the specified
order of grid items both in the auto-placement algorithm and in
the final painting.

* fast/css-grid-layout/grid-item-order-auto-flow-resolution-expected.txt: Added.
* fast/css-grid-layout/grid-item-order-auto-flow-resolution.html: Added.
* fast/css-grid-layout/grid-item-order-paint-order-expected.html: Added.
* fast/css-grid-layout/grid-item-order-paint-order.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158115 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of InlineStart so that I don't have to implement it in FTL
https://bugs.webkit.org/show_bug.cgi?id=123302

Reviewed by Geoffrey Garen.
        
InlineStart was a special instruction that we would insert at the top of inlined code,
so that the backend could capture the OSR state of arguments to an inlined call. It used
to be that only the backend had this information, so this instruction was sort of an ugly
callback from the backend for filling in some data structures.
        
But in the time since when that code was written (two years ago?), we rationalized how
variables work. It's now the case that variables that the runtime must know about are
treated specially in IR (they are "flushed") and we know how we will represent them even
before we get to the backend. The last place that makes changes to their representation
is the StackLayoutPhase.
        
So, this patch gets rid of InlineStart, but keeps around the special meta-data that the
instruction had. Instead of handling the bookkeeping in the backend, we handle it in
StackLayoutPhase. This means that the DFG and FTL can share code for handling this
bookkeeping. This also means that now the FTL can compile code blocks that had inlining.
        
Of course, giving the FTL the ability to handle code blocks that had inlining means that
we're going to have new bugs. Sure enough, the FTL's linker didn't handle inline call
frames. This patch also fixes that.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::InlineStackEntry::InlineStackEntry):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.h:
* dfg/DFGNode.h:
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStackLayoutPhase.cpp:
(JSC::DFG::StackLayoutPhase::run):
* ftl/FTLLink.cpp:
(JSC::FTL::link):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158116 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add additional Apple Mavericks test bots.
        
Unreviewed.
        
* BuildSlaveSupport/build.webkit.org-config/config.json:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Some test expectations for Mavericks.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158119 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expunge Lion and SnowLeopard from TestExpectations.

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158120 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move RenderBlock functions only used by RenderBlockFlow to RenderBlockFlow
https://bugs.webkit.org/show_bug.cgi?id=123318

Reviewed by David Hyatt.

* rendering/LineLayoutState.h:
Move FloatWithRect from RenderBlock.

* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
Move pagination and float functions.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make TileController manipulate PlatformCALayers instead of CALayers
https://bugs.webkit.org/show_bug.cgi?id=123279

Reviewed by Simon Fraser.

In the interest of making TileController more platform-independent
(so that it can be used with the remote layer tree, and maybe Windows),
move TileController onto our PlatformCALayer abstraction instead of
direct manipulation of CALayers.

Some fallout from this includes getting rid of special Mac-specific
TileController-specific CALayer subclasses, and reworking tile
painting to work in a more generic way.

This is a first step, and doesn't get us all the way to a platform independent
TileController, but more patches are forthcoming.

No new tests, just a (largeish) refactor.

* WebCore.exp.in:
The signature of some methods has changed.

* WebCore.xcodeproj/project.pbxproj:
Remove WebTileLayer.*

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::logExposedUnfilledArea):
Use the "isTile" key on the CALayer dictionary instead of the layer's
class to determine if it's a tile. TileController will set this on a tile
when it is created, for now.

* platform/graphics/TiledBacking.h:
tiledScrollingIndicatorLayer() should return a PlatformCALayer.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount):
* platform/graphics/ca/PlatformCALayerClient.h:
The PlatformCALayerClient paintContents and incrementRepaintCount callbacks
should include the platformCALayer that caused the callback.

* platform/graphics/ca/PlatformCALayer.h:
Add LayerTypeSimpleLayer, which is similar to LayerTypeWebLayer
except it just calls back its client to paint, instead of doing
complicated things with repaint rects. This is so that TileController
doesn't re-enter drawLayerContents when asking its GraphicsLayer
to paint for each PlatformCALayer (it will be entering drawLayerContents
for the first time for each layer). It also happens to be useful
for things like the tile controller overlay, which don't need
all that complication.

Add LayerTypeTiledBackingTileLayer, which is used simply to distinguish
TileController Tile layers from other LayerTypeSimpleLayers.

* platform/graphics/ca/mac/LayerPool.h:
* platform/graphics/ca/mac/LayerPool.mm:
(WebCore::LayerPool::addLayer):
(WebCore::LayerPool::takeLayerWithSize):
LayerPool should operate on PlatformCALayers now.

* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::PlatformCALayerMac):
Set the "isTile" key on the CALayer to true for TiledBackingTileLayers,
so that the scrolling performance logging can tell a tile apart from
any other layer, on the scrolling thread, without touching PlatformCALayers
or the TileController or any other main-thread data structures.

(PlatformCALayerMac::setEdgeAntialiasingMask): Added.
* platform/graphics/ca/mac/TileController.h:
Remove references to Objective-C classes; instead use PlatformCALayer everywhere.
TileController is now a PlatformCALayerClient, and the layers it owns are
all PlatformCALayers (and it is constructed with a PlatformCALayer, etc.).
Hand in the tile debug border color as a WebCore color, instead of a CGColorRef.
blankPixelCountForTiles() now operates on a list of PlatformLayers instead of
WebTileLayers specifically, since WebTileLayer is gone.
Make drawTileMapContents private because WebTileCacheMapLayer no longer exists.

(WebCore::TileController::platformCALayerDrawsContent):
All of the layers who have TileController as their client paint their contents.

(WebCore::TileController::platformCALayerContentsOpaque):
This will only be called for layers which paint via drawLayerContents,
so it's OK that we don't special-case the debugging overlay here.

(WebCore::TileController::owningGraphicsLayer):
Return the GraphicsLayer that owns the TileController's main
layer, via its conformance to PlatformCALayerClient. This is
a bit strange (because it's not strictly a GraphicsLayer, despite
always being so at the moment), but is done for clarity inside
TileController itself.

* platform/graphics/ca/mac/TileController.mm:
Remove CALayer (WebCALayerDetails), WebTiledScrollingIndicatorLayer,
and a bunch of includes that we don't need anymore.

(WebCore::TileController::create):
(WebCore::TileController::TileController):
TileController is passed a PlatformCALayer for the tile cache root layer,
instead of a WebTiledBackingLayer. It also creates a PlatformCALayer with
LayerTypeLayer instead of a bare CALayer for the container layer.
It's OK to remove the transaction because it was only used to stop
the implicit animation, which PlatformCALayer will do for us.

(WebCore::TileController::~TileController):
Clear the owner of the PlatformCALayers which the TileController previously owned,
so they don't try to call back a destroyed TileController.

(WebCore::TileController::tileCacheLayerBoundsChanged):
(WebCore::TileController::setNeedsDisplay):
Straightforward adjustments towards use of PlatformCALayer.

(WebCore::TileController::setTileNeedsDisplayInRect):
Adjustments towards use of PlatformCALayer; we need FloatRects so we can
pass pointers to PlatformCALayer::setNeedsDisplay.

(WebCore::TileController::platformCALayerPaintContents):
Replace drawLayer with platformCALayerPaintContents, which will be called
back from our various WebSimpleLayers. If the PlatformCALayer is our
tiled scrolling debug indicator, paint that. Otherwise, it's a tile.
Make use of drawLayerContents() to paint the tile contents.
Make use of drawRepaintIndicator() to paint the repaint indicator if needed.
Move scrolling performance logging code that used to be in WebTileLayer here.

(WebCore::TileController::platformCALayerDeviceScaleFactor):
(WebCore::TileController::platformCALayerShowDebugBorders):
(WebCore::TileController::platformCALayerShowRepaintCounter):
Forward these to the owning GraphicsLayerCA, because it will have the right answers.

(WebCore::TileController::setScale):
Adjustments towards use of PlatformCALayer; remove some code that Simon
caused to be unused in 156291 but did not remove.

(WebCore::TileController::setAcceleratesDrawing):
(WebCore::TileController::setTilesOpaque):
(WebCore::TileController::setVisibleRect):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::setTileDebugBorderWidth):
(WebCore::TileController::setTileDebugBorderColor):
(WebCore::TileController::bounds):
(WebCore::TileController::blankPixelCount):
(WebCore::TileController::blankPixelCountForTiles):
(WebCore::queueTileForRemoval):
(WebCore::TileController::setNeedsRevalidateTiles):
(WebCore::TileController::ensureTilesForRect):
(WebCore::TileController::retainedTileBackingStoreMemory):
Straightforward adjustments towards use of PlatformCALayer.

(WebCore::TileController::updateTileCoverageMap):
Adjustments towards use of PlatformCALayer; rename backgroundColor
to visibleRectIndicatorColor, since it's actually a border, not a background.

(WebCore::TileController::tiledScrollingIndicatorLayer):
Create a LayerTypeSimpleLayer PlatformCALayer for the tiled scrolling indicator.
It will be asked to paint straightforwardly, like a CALayer would.
Create a LayerTypeLayer PlatformCALayer for the visible rect indicator.
It doesn't need to paint anything, so it doesn't get an owner.

(WebCore::TileController::createTileLayer):
When creating a new tile layer, adopt it by setting its owner.
Otherwise, straightforward adjustments towards use of PlatformCALayer.

(WebCore::TileController::platformCALayerIncrementRepaintCount):
Manage repaint counts for tiles in TileController now.

(WebCore::TileController::drawTileMapContents):
Adjustments towards use of PlatformCALayer.

* platform/graphics/ca/mac/WebTileLayer.h: Removed.
* platform/graphics/ca/mac/WebTileLayer.mm: Removed.
We don't need WebTileLayer anymore, tiles are now just WebSimpleLayers
owned by TileController. Its behavior has been moved into TileController.

* platform/graphics/ca/mac/WebTiledBackingLayer.h:
* platform/graphics/ca/mac/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer createTileController:]):
Add createTileController: so that the WebTiledBackingLayer's owner can
hand the TileController the PlatformCALayer for the WebTiledBackingLayer
without propagating additional usage of PlatformCALayer::platformCALayer(),
which we need to remove in light of the remote layer tree work.

(-[WebTiledBackingLayer setBorderColor:]):

* platform/graphics/ca/win/PlatformCALayerWin.h:
Add an empty implementation of setEdgeAntialiasingMask.
We'll probably want to implement it before adopting TileController on Windows.

* platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
(PlatformCALayerWinInternal::displayCallback):
* platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerPaintContents):
(WebCore::MediaPlayerPrivateQuickTimeVisualContext::LayerClient::platformCALayerIncrementRepaintCount):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerPaintContents):
(WebCore::LayerClient::platformCALayerIncrementRepaintCount):
Adjust for new parameters on PlatformCALayerClient callbacks.

* platform/graphics/mac/WebLayer.h:
Add WebSimpleLayer, which inherits directly from CALayer, and make
our standard WebLayer (which is used for compositing layers in web content)
inherit from that.

* platform/graphics/mac/WebLayer.mm:
Move most of the behavior of WebLayer onto WebSimpleLayer, except for its
complex painting code. That stays as an override on WebLayer.

(WebCore::drawLayerContents):
Use the PlatformCALayer's PlatformLayer - if it exists - to extract
fine-grained repaint rects. If it doesn't, we'll just use the CGContext's
clip rect as our single repaint rect.
Rename platformLayer to platformCALayer for accuracy.
Remove special code for CATiledLayer since we ought not use it on Mac anymore.

(WebCore::drawRepaintIndicator):
Factor repaint indicator code out into its own function so that TileController
can use it. It can't be called from drawLayerContents for TileController, since
the PlatformCALayer that TileController passes in to drawLayerContents is actually
that of the tile cache's root layer, not the tile itself.
Also, add a custom background color parameter so TileController can override
the default green color with its own standard purple.

(-[WebLayer drawInContext:]):
(-[WebSimpleLayer drawInContext:]):
* platform/graphics/mac/WebTiledLayer.mm:
(-[WebTiledLayer drawInContext:]):
Removed a param from drawLayerContents because it's trivially acquirable
from the PlatformCALayer.

* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerPaintContents):
(FullscreenVideoController::LayerClient::platformCALayerIncrementRepaintCount):
Adjust for new parameters on PlatformCALayerClient callbacks.

* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::dump):
Support the new LayerTypes.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::setEdgeAntialiasingMask):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
Add an empty implementation of setEdgeAntialiasingMask.

* WebProcess/WebPage/mac/RemoteLayerBackingStore.mm:
(RemoteLayerBackingStore::display):
Removed a parameter from drawLayerContents.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::updateDebugInfoLayer):
TiledCoreAnimationDrawingArea still operates in terms of CALayers, so
grab the PlatformLayer out from TileController's indicator.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RunLoop::dispatch should take an std::function
https://bugs.webkit.org/show_bug.cgi?id=123407

Reviewed by Andreas Kling.

Source/WebCore:

* WebCore.exp.in:
* platform/RunLoop.cpp:
(WebCore::RunLoop::performWork):
(WebCore::RunLoop::dispatch):
* platform/RunLoop.h:

Source/WTF:

* wtf/FunctionDispatcher.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158123 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add TrackPrivateBase.
Add audio and video tracks to GStreamer ports.