Allocate the data section on the heap again for FTL on ARM64
https://bugs.webkit.org/show_bug.cgi?id=130156

Patch by Juergen Ributzka <juergen@apple.com> on 2014-04-16
Reviewed by Geoffrey Garen and Filip Pizlo.

* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
* ftl/FTLDataSection.cpp:
(JSC::FTL::DataSection::DataSection):
(JSC::FTL::DataSection::~DataSection):
* ftl/FTLDataSection.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Deduplicate LayerTreeContext
https://bugs.webkit.org/show_bug.cgi?id=131773

Reviewed by Simon Fraser.

There are three identical implementations, one for each platform, for no reason.

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* Shared/LayerTreeContext.cpp: Renamed from Source/WebKit2/Shared/mac/LayerTreeContextMac.mm.
(WebKit::LayerTreeContext::LayerTreeContext):
(WebKit::LayerTreeContext::~LayerTreeContext):
(WebKit::LayerTreeContext::encode):
(WebKit::LayerTreeContext::decode):
(WebKit::LayerTreeContext::isEmpty):
(WebKit::operator==):
* Shared/LayerTreeContext.h:
(WebKit::operator!=): Deleted.
* Shared/efl/LayerTreeContextEfl.cpp: Removed.
* Shared/gtk/LayerTreeContextGtk.cpp: Removed.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::initialize):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make IPC::Arguments a variadic template
https://bugs.webkit.org/show_bug.cgi?id=131684

Reviewed by Darin Adler.

Make IPC::Arguments a variadic template that uses the template parameter pack to further
define the std::tuple ValueType and is used to define the std::tuple container of the
values passed into the container.

* Platform/IPC/Arguments.h:
(IPC::Arguments::Arguments):
(IPC::Arguments::encode):
(IPC::Arguments::decode):
(IPC::Arguments0::encode): Deleted.
(IPC::Arguments0::decode): Deleted.
(IPC::Arguments1::Arguments1): Deleted.
(IPC::Arguments1::encode): Deleted.
(IPC::Arguments1::decode): Deleted.
(IPC::Arguments2::Arguments2): Deleted.
(IPC::Arguments2::encode): Deleted.
(IPC::Arguments2::decode): Deleted.
(IPC::Arguments3::Arguments3): Deleted.
(IPC::Arguments3::encode): Deleted.
(IPC::Arguments3::decode): Deleted.
(IPC::Arguments4::Arguments4): Deleted.
(IPC::Arguments4::encode): Deleted.
(IPC::Arguments4::decode): Deleted.
(IPC::Arguments5::Arguments5): Deleted.
(IPC::Arguments5::encode): Deleted.
(IPC::Arguments5::decode): Deleted.
(IPC::Arguments6::Arguments6): Deleted.
(IPC::Arguments6::encode): Deleted.
(IPC::Arguments6::decode): Deleted.
(IPC::Arguments7::Arguments7): Deleted.
(IPC::Arguments7::encode): Deleted.
(IPC::Arguments7::decode): Deleted.
(IPC::Arguments8::Arguments8): Deleted.
(IPC::Arguments8::encode): Deleted.
(IPC::Arguments8::decode): Deleted.
(IPC::Arguments10::Arguments10): Deleted.
(IPC::Arguments10::encode): Deleted.
(IPC::Arguments10::decode): Deleted.
* Scripts/webkit2/LegacyMessages-expected.h:
* Scripts/webkit2/Messages-expected.h:
* Scripts/webkit2/messages.py: Clean up the code a bit.
(reply_parameter_type):
(arguments_type):
(reply_type):
(decode_type):
(arguments_type_old): Deleted.
(base_class): Deleted.
(delayed_reply_type): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Don't include CryptographicallyRandomNumber.h in StringImpl.h
https://bugs.webkit.org/show_bug.cgi?id=131772

Reviewed by Sam Weinig.

* wtf/text/StringImpl.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a way for layout tests to determine whether or not a plugin is snapshotted.
https://bugs.webkit.org/show_bug.cgi?id=131650.
<rdar://problem/16615528>

Reviewed by Dean Jackson.

* testing/Internals.cpp:
(WebCore::Internals::isPluginSnapshotted):
* testing/Internals.h:
* testing/Internals.idl:

Adjust simple.html accordingly, more snapshotting test changes to come.
* platform/mac-wk2/plugins/snapshotting/simple-expected.txt:
* plugins/snapshotting/simple.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaDocument on iOS should be full page
https://bugs.webkit.org/show_bug.cgi?id=131774

Reviewed by Jer Noble.

Source/WebCore:
A MediaDocument on iOS has two problems. It can't rely
on intrinsic size, since it doesn't load the content until
a user gesture. Secondly, on a small screen you want the
media to fill the page.

Add width/height 100% for iOS documents.

Test: platform/iphone-simulator/media/media-document-controls-size.html

* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):

LayoutTests:
* platform/iphone-simulator/media/media-document-controls-size-expected.txt: Added.
* platform/iphone-simulator/media/media-document-controls-size.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Images dragged from WebKit1 on 2x displays are too big
https://bugs.webkit.org/show_bug.cgi?id=131775
<rdar://problem/15933525>

Reviewed by Simon Fraser.

* WebCoreSupport/WebDragClient.mm:
(WebDragClient::startDrag):
Scale the drag image's logical size down by the device scale factor
in WebKit1 just like we do in WebKit2.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] Selection gets confused when the mouse is in the column gaps.
https://bugs.webkit.org/show_bug.cgi?id=131739

Reviewed by Enrica Casucci.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::selectionGaps):
Make sure not to paint selection gaps. This matches the old multi-column behavior. Even though
selection gaps *nearly* work with the new multi-column code, I am disabling them so that we
can turn them on without visual regressions.
        
(WebCore::isChildHitTestCandidate):
Don't allow in-flow RenderFlowThreads to be descended into from positionForPoint. We always want
to look only at the spanners and at the sets.

* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::nodeAtPoint):
* rendering/RenderMultiColumnFlowThread.h:
Override nodeAtPoint to disallow the RenderMultiColumnFlowThread from being considered for hit
testing when no DOM node is found. It's better to just let RenderBlock's positionForPoint run
to drill back down into the appropriate column set.

* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::positionForPoint):
Implement positionForPoint for RenderMultiColumnSets. This is a straight-up port of the
old multi-column code's adjustPointToColumnContents function.

* rendering/RenderMultiColumnSet.h:
Add override of positionForPoint.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Unreviewed Windows gardening. Restrict our new 'isinf' check
to 32-bit builds, and revise the comment to explain what we are
doing.

* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isMachineInt): Provide motivation for the new
'isinf' check for our 32-bit code path.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Replay: memoize fallback time values for document.lastModified
https://bugs.webkit.org/show_bug.cgi?id=131318

Reviewed by Joseph Pecoraro.

Source/WebCore:
If a document's Last-Modified header can't be found or used, then
document.lastModified is derived from the current system time or
from filesystem data, which is obviously nondeterministic.

It's better to handle this inside Document::lastModified rather than using
MemoizedDOMResult, because only the fallback case is nondeterministic.

Test: http/tests/inspector/replay/document-last-modified-fallback-value.html

The test is skipped for now, as it will be very flaky without the
functionality introduced by bugs 130728 and 129391.

* dom/Document.cpp:
(WebCore::Document::lastModified): Save or reuse memoized fallback value.
* replay/WebInputs.json: Add input DocumentLastModifiedDate.

LayoutTests:
Mark the new test as skipped until dependent functionality is landed.

* http/tests/inspector/replay/document-last-modified-fallback-value.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Improve performance of the RenderLayerCompositor::OverlapMap
https://bugs.webkit.org/show_bug.cgi?id=115063

Reviewed by Simon Fraser.

PerformanceTests:
Testing the performance of computing the overlap of 5000 layers.

* Layout/layers_overlap_2d.html: Added. Using non-composited layers, to check
that the performance on the non-composited path is not changing with this patch.
* Layout/layers_overlap_3d.html: Added. Records the time to do the layout of 5000
non-overlapping 3D layers.

Source/WebCore:
No new tests, no new functionality or behavior.

Do not use the OverlapMap in RenderLayerCompositor::computeCompositingRequirements if the layer already
has a 3D transform. This way we can avoid a potential expensive lookups when we know for sure the layer
is already supposed to be composited.

Also, added a bounding box of the overlap map, so that it can catch cases when the new layer is not overlapping
any of the previous layers. This is pretty common when having composited layers laid out in a vertical/horizontal list.

* rendering/RenderLayerCompositor.cpp:
(OverlapMapContainer):
(WebCore::OverlapMapContainer::add):
(WebCore::OverlapMapContainer::overlapsLayers):
(WebCore::OverlapMapContainer::unite):
(WebCore):
(WebCore::RenderLayerCompositor::OverlapMap::add):
(WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
(WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer):
(WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer):
(RenderLayerCompositor::OverlapMap):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Do not update the visible content rects when setting the same obscured insets multiple times
https://bugs.webkit.org/show_bug.cgi?id=131633

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-16
Reviewed by Darin Adler.

We should avoid computing the visible content rects when not needed.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setObscuredInsets:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Improve the approximation of the scroll position of the dynamic viewport size updates
https://bugs.webkit.org/show_bug.cgi?id=131720

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-16
Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollToContentOffset:]):
The scrolling tree was forcing scroll at the wrong scale during the transition. 

(-[WKWebView _setMinimumLayoutSizeOverride:]):
This was left out by accident. The WebProcess was getting the new layout size twice, making
WebPage::dynamicViewportSizeUpdate() very confused when the content size changes.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
Add scrolling adjustment for the dynamic relayout case:
-Sticky top and bottom like the UIProcess.
-Keep the same relative position of the unobscured rect's center.

Also fix a bug in the horizontal and vertical adjustments: the code was using the exposed rect
instead of the unobscured rect, which made the adjustments off by the size of the obscured insets.

The type is changed from double to float since ARMv7 has a grudge against double.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
On iOS keep network process running using a process assertion rather than a boost
https://bugs.webkit.org/show_bug.cgi?id=131779

Reviewed by Benjamin Poulain.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):
    - No need to leak a boost onto the NetworkProcess on iOS.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didFinishLaunching):
    - Take a ProcessAssertion on the NetworkProcess.
* UIProcess/Shared/ChildProcessProxy.h:
    - Added m_assertion.
* UIProcess/WebProcessProxy.h:
    - Removed m_assertion.
* UIProcess/ios/ProcessAssertion.h: Added.
    - Added - refactored from WebProcessProxy.h.
* UIProcess/ios/ProcessAssertion.mm: Added.
(WebKit::ProcessAssertion::ProcessAssertion):
(WebKit::ProcessAssertion::setState):
    - Added - refactored from WebProcessProxyIOS.mm.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::updateProcessState):
    - Code refactored out to ProcessAssertion.mm.
* WebKit2.xcodeproj/project.pbxproj:
    - Added files.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Fix annoying scrolling bugs
https://bugs.webkit.org/show_bug.cgi?id=131722

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-16
Reviewed by Simon Fraser.


Source/WebCore: 
* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):
Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
keep changing the scroll position to incorrect values.

On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
the code does not run because there is a platformWidget().

Just #ifdef the whole useless code.

Source/WebKit2: 
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollToContentOffset:WebCore::]):
We are scrolling at the wrong position when we have the "small obscured insets".


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][WK2] Fix the DidCommitLoad initial scrolling position
https://bugs.webkit.org/show_bug.cgi?id=131780

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-16
Reviewed by Jon Honeycutt.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
That code is older than _obscuredInsets and used the contentInsets as a workaround.


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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r167412

Patch by Benjamin Poulain <bpoulain@apple.com> on 2014-04-16

* platform/ScrollView.cpp:
(WebCore::ScrollView::updateScrollbars):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sink NaN sanitization to uses and remove it when it's unnecessary
https://bugs.webkit.org/show_bug.cgi?id=131419

Reviewed by Oliver Hunt.
        
This moves NaN purification to stores that could see an impure NaN.
        
5% speed-up on AsmBench, 50% speed-up on AsmBench/n-body. It is a regression on FloatMM
though, because of the other bug that causes that benchmark to box doubles in a loop.

* bytecode/SpeculatedType.h:
(JSC::isInt32SpeculationForArithmetic):
(JSC::isMachineIntSpeculationForArithmetic):
(JSC::isDoubleSpeculation):
(JSC::isDoubleSpeculationForArithmetic):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAbstractValue.cpp:
(JSC::DFG::AbstractValue::fixTypeForRepresentation):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::injectTypeConversionsForEdge):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::mergeStateAtTail):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueRep):
(JSC::DFG::SpeculativeJIT::compileGetByValOnFloatTypedArray):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileValueRep):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):
* runtime/PureNaN.h:
* tests/stress/float32-array-nan-inlined.js: Added.
(foo):
(test):
* tests/stress/float32-array-nan.js: Added.
(foo):
(test):
* tests/stress/float64-array-nan-inlined.js: Added.
(foo):
(isBigEndian):
(test):
* tests/stress/float64-array-nan.js: Added.
(foo):
(isBigEndian):
(test):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@167416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Extra error reporting for invalid value conversions
https://bugs.webkit.org/show_bug.cgi?id=131786

Rubber stamped by Ryosuke Niwa.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::injectTypeConversionsForEdge):



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