[GTK] Add new ARM build slave for GTK+
https://bugs.webkit.org/show_bug.cgi?id=128978

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2014-02-19
Reviewed by Brent Fulgham.

* BuildSlaveSupport/build.webkit.org-config/config.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Missing box doesn't use border-box as reference box for clip-path
https://bugs.webkit.org/show_bug.cgi?id=129049

Reviewed by Simon Fraser.

Source/WebCore:

If no reference box was specified the default reference box should be
border-box. Previously to this patch the reference box was the bounding
client rect. This was not following the specification.
http://www.w3.org/TR/2014/WD-css-masking-1-20140213/#the-clip-path
The change affects content using -webkit-clip-path in Safari. Since the
bounding client box is equalvalent to the border box most of the time
there shouldn't be to much impact.

Existing tests cover the issue.

* rendering/RenderLayer.cpp:
(WebCore::computeReferenceBox):

LayoutTests:

Update the result for overflowing content. The clip-path uses the border-box instead of
the bounding client rect as reference box.
Change pixel test to reference text.

* css3/masking/clip-path-circle-relative-overflow-expected.html: Added.
* platform/mac/css3/masking/clip-path-circle-relative-overflow-expected.png: Removed.
* platform/mac/css3/masking/clip-path-inset-expected.png: Added. This was missing in the repo.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164380 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] REGRESSION (r162710): Open tab urls not restored after switching to new Safari build
https://bugs.webkit.org/show_bug.cgi?id=128536
<rdar://problem/15911839>

Reviewed by Dan Bernstein.

* UIProcess/cf/WebBackForwardListCF.cpp:
(WebKit::extractBackForwardListEntriesFromArray):
Don't fail to extract an entry if it doesn't have a snapshot UUID.

* UIProcess/cf/WebPageProxyCF.cpp:
It turns out that this was the wrong version to bump, and we don't support
reading different versions of the session state data.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
UIProcess needs to know the color of the page's extended background
https://bugs.webkit.org/show_bug.cgi?id=129004

Source/WebCore: 

Reviewed by Brent Fulgham.

This patch adds a new ChromeClient function, 
pageExtendedBackgroundColorDidChange() which will be called whenever the extended 
background color has changed.

New function.
* page/ChromeClient.h:
(WebCore::ChromeClient::pageExtendedBackgroundColorDidChange):

Store the extended background color in a member variable so that we can know if it 
changed even if we do not have an m_layerForOverhangAreas.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor):
* rendering/RenderLayerCompositor.h:

Source/WebKit2: 

Reviewed by Simon Fraser and Brent Fulgham.

New method on WKWebView and WKView will return the page’s extended background 
color.
* UIProcess/API/Cocoa/WKViewPrivate.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView pageExtendedBackgroundColor]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView pageExtendedBackgroundColor]):

The color is stored in the WebPageProxy, and the ChromeClient sends a message to 
the WebPageProxy with the new color whenever it changes.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageExtendedBackgroundColorDidChange):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::pageExtendedBackgroundColor):
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
* WebProcess/WebCoreSupport/WebChromeClient.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
UIProcess needs to know the color of the page's extended background
https://bugs.webkit.org/show_bug.cgi?id=129004

Rubber-stamped by Andreas Kling.

Missed this late-breaking review comment. Fixing now!

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164383 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make PrintStream::print() a variadic template
https://bugs.webkit.org/show_bug.cgi?id=126388

Patch by Zan Dobersek <zdobersek@igalia.com> on 2014-02-19
Reviewed by Brent Fulgham.

PrintStream::print() can be converted into a variadic template, printing the value
of the first parameter and recursively calling itself until the single parameter version
is used for printing the last value.

* wtf/DataLog.h:
(WTF::dataLog): Convert the function to a variadic template as well.
* wtf/PrintStream.h:
(WTF::PrintStream::print):
* wtf/StringPrintStream.h:
(WTF::toCString): Ditto.
(WTF::toString): Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove unused InspectorBackend member variable
https://bugs.webkit.org/show_bug.cgi?id=129053

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2014-02-19
Reviewed by Timothy Hatcher.

* UserInterface/InspectorBackend.js:
(InspectorBackendClass):
(InspectorBackendClass.prototype.registerCommand):
(InspectorBackendClass.prototype.registerEnum):
(InspectorBackendClass.prototype.registerEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
media/controls-styling-strict.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=129057

* TestExpectations: Marked it as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
isEditablePosition shouldn't trigger synchronous layout
https://bugs.webkit.org/show_bug.cgi?id=129026

Reviewed by Brent Fulgham.

Just trigger style recalc instead.

* editing/htmlediting.cpp:
(WebCore::isEditablePosition):


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

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



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164388 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should be able to convey branch weights to LLVM
https://bugs.webkit.org/show_bug.cgi?id=129054

Reviewed by Michael Saboff.
        
This introduces a really nice way to convey branch weights to LLVM. The basic class
is Weight, which just wraps a float; NaN is used when you are not sure. You can
pass this alongside a LBasicBlock to branching instructions like condbr and switch.
But for simplicity, you can just pass a WeightedTarget, which is a tuple of the
two. And for even greater simplicity, you can create WeightedTargets from
LBasicBlocks by doing:
        
    usually(b)   => WeightedTarget(b, Weight(1))
    rarely(b)    => WeightedTarget(b, Weight(0))
    unsure(b)    => WeightedTarget(b, Weight()) or WeightedTarget(b, Weight(NaN))
        
This allows for constructs like:
        
    m_out.branch(isCell(value), usually(isCellCase), rarely(slowCase));
        
This was intended to be perf-neutral for now, but it did end up creating a ~1%
speed-up on V8v7 and Octane2.

* JavaScriptCore.xcodeproj/project.pbxproj:
* ftl/FTLAbbreviations.h:
(JSC::FTL::mdNode):
* ftl/FTLCommonValues.cpp:
(JSC::FTL::CommonValues::CommonValues):
* ftl/FTLCommonValues.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::lower):
(JSC::FTL::LowerDFGToLLVM::compileValueToInt32):
(JSC::FTL::LowerDFGToLLVM::compileStoreBarrierWithNullCheck):
(JSC::FTL::LowerDFGToLLVM::compileToThis):
(JSC::FTL::LowerDFGToLLVM::compileArithMul):
(JSC::FTL::LowerDFGToLLVM::compileArithDiv):
(JSC::FTL::LowerDFGToLLVM::compileArithMod):
(JSC::FTL::LowerDFGToLLVM::compileArithMinOrMax):
(JSC::FTL::LowerDFGToLLVM::compileCheckStructure):
(JSC::FTL::LowerDFGToLLVM::compileArrayifyToStructure):
(JSC::FTL::LowerDFGToLLVM::compileGetById):
(JSC::FTL::LowerDFGToLLVM::compileGetIndexedPropertyStorage):
(JSC::FTL::LowerDFGToLLVM::compileGetTypedArrayByteOffset):
(JSC::FTL::LowerDFGToLLVM::compileGetByVal):
(JSC::FTL::LowerDFGToLLVM::compilePutByVal):
(JSC::FTL::LowerDFGToLLVM::compileArrayPush):
(JSC::FTL::LowerDFGToLLVM::compileArrayPop):
(JSC::FTL::LowerDFGToLLVM::compileNewArrayWithSize):
(JSC::FTL::LowerDFGToLLVM::compileToString):
(JSC::FTL::LowerDFGToLLVM::compileToPrimitive):
(JSC::FTL::LowerDFGToLLVM::compileStringCharAt):
(JSC::FTL::LowerDFGToLLVM::compileStringCharCodeAt):
(JSC::FTL::LowerDFGToLLVM::compileMultiGetByOffset):
(JSC::FTL::LowerDFGToLLVM::compileNotifyWrite):
(JSC::FTL::LowerDFGToLLVM::compileBranch):
(JSC::FTL::LowerDFGToLLVM::compileSwitch):
(JSC::FTL::LowerDFGToLLVM::compareEqObjectOrOtherToObject):
(JSC::FTL::LowerDFGToLLVM::nonSpeculativeCompare):
(JSC::FTL::LowerDFGToLLVM::allocateCell):
(JSC::FTL::LowerDFGToLLVM::allocateBasicStorageAndGetEnd):
(JSC::FTL::LowerDFGToLLVM::boolify):
(JSC::FTL::LowerDFGToLLVM::equalNullOrUndefined):
(JSC::FTL::LowerDFGToLLVM::contiguousPutByValOutOfBounds):
(JSC::FTL::LowerDFGToLLVM::buildSwitch):
(JSC::FTL::LowerDFGToLLVM::doubleToInt32):
(JSC::FTL::LowerDFGToLLVM::sensibleDoubleToInt32):
(JSC::FTL::LowerDFGToLLVM::lowDouble):
(JSC::FTL::LowerDFGToLLVM::strictInt52ToJSValue):
(JSC::FTL::LowerDFGToLLVM::speculateObjectOrOther):
(JSC::FTL::LowerDFGToLLVM::speculateStringOrStringObject):
(JSC::FTL::LowerDFGToLLVM::emitStoreBarrier):
(JSC::FTL::LowerDFGToLLVM::callCheck):
(JSC::FTL::LowerDFGToLLVM::appendOSRExit):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::initialize):
(JSC::FTL::Output::appendTo):
(JSC::FTL::Output::newBlock):
(JSC::FTL::Output::sensibleDoubleToInt):
(JSC::FTL::Output::load):
(JSC::FTL::Output::store):
(JSC::FTL::Output::baseIndex):
(JSC::FTL::Output::branch):
(JSC::FTL::Output::crashNonTerminal):
* ftl/FTLOutput.h:
(JSC::FTL::Output::branch):
(JSC::FTL::Output::switchInstruction):
* ftl/FTLSwitchCase.h:
(JSC::FTL::SwitchCase::SwitchCase):
(JSC::FTL::SwitchCase::weight):
* ftl/FTLWeight.h: Added.
(JSC::FTL::Weight::Weight):
(JSC::FTL::Weight::isSet):
(JSC::FTL::Weight::operator!):
(JSC::FTL::Weight::value):
(JSC::FTL::Weight::scaleToTotal):
* ftl/FTLWeightedTarget.h: Added.
(JSC::FTL::WeightedTarget::WeightedTarget):
(JSC::FTL::WeightedTarget::target):
(JSC::FTL::WeightedTarget::weight):
(JSC::FTL::usually):
(JSC::FTL::rarely):
(JSC::FTL::unsure):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix after r164374

* llint/LLIntOfflineAsmConfig.h: Added #define OFFLINE_ASM_X86_WIN 0
for ENABLE(LLINT_C_LOOP).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WTF_MAKE_FAST_ALLOCATED to more classes
https://bugs.webkit.org/show_bug.cgi?id=129064

Reviewed by Andreas Kling.

Source/JavaScriptCore:

* dfg/DFGSpeculativeJIT.h:
* heap/CopyWorkList.h:
* heap/Region.h:
* runtime/Arguments.h:
* runtime/SymbolTable.h:
* runtime/WriteBarrier.h:

Source/WebCore:

* dom/EventContext.h:
* platform/graphics/Region.h:
* platform/text/BidiResolver.h:
* rendering/LayoutState.h:

Source/WTF:

* wtf/Bitmap.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, fix comment.

* ftl/FTLWeight.h:
(JSC::FTL::Weight::scaleToTotal):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should allow LLVM to allocate data sections with alignment > 8
https://bugs.webkit.org/show_bug.cgi?id=129066

Reviewed by Geoffrey Garen.
        
We were previously using the native allocator's alignment guarantees (which we presumed
to be 8 bytes), and further hinting our desires by using the LSectionWord type (which
was 8 bytes). This breaks now that LLVM will sometimes ask for 16 byte alignment on
some sections.
        
This changes our data section allocation strategy to use the new FTL::DataSection,
which can handle arbitrary 2^k alignment.

* JavaScriptCore.xcodeproj/project.pbxproj:
* ftl/FTLCompile.cpp:
(JSC::FTL::mmAllocateDataSection):
(JSC::FTL::dumpDataSection):
(JSC::FTL::compile):
* ftl/FTLDataSection.cpp: Added.
(JSC::FTL::DataSection::DataSection):
(JSC::FTL::DataSection::~DataSection):
* ftl/FTLDataSection.h: Added.
(JSC::FTL::DataSection::base):
(JSC::FTL::DataSection::size):
* ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::addDataSection):
* ftl/FTLJITCode.h:
(JSC::FTL::JITCode::dataSections):
* ftl/FTLState.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Another Windows update to quiet the bots.

* platform/win/TestExpectations: Add more flakes and pass lint-test-expectations.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Add performance test for stacked floats with shape-outsides
https://bugs.webkit.org/show_bug.cgi?id=128821

Reviewed by Brent Fulgham.

This tests generate stacked floats content with shape-outsides.
The test is skipped by default.

* Layout/Shapes/ShapeOutsideStackedPolygons.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JS] Convert Promise.prototype.catch to be a built-in
https://bugs.webkit.org/show_bug.cgi?id=129052

Patch by Sam Weinig <sam@webkit.org> on 2014-02-19
Reviewed by Geoffrey Garen.

* GNUmakefile.list.am:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/Promise.prototype.js: Added.
(catch): Add JS based implementation of Promise.prototype.catch.

* runtime/JSPromisePrototype.cpp:
Remove the C++ implementation of Promise.prototype.catch.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Need to align sp before calling operationLoadVarargs on 32-bit platforms.
<https://webkit.org/b/129056>

Reviewed by Michael Saboff.

In JIT::compileLoadVarargs(), we'll call operationSizeFrameForVarargs()
to compute the amount of stack space we need for the varargs, adjust the
stack pointer to make room for those varargs, and then call
operationLoadVarargs() to fill in the varargs. Currently, the stack
pointer adjustment takes care of allocating space for the varargs, but
does not align the stack pointer for the call to operationLoadVarargs().
The fix is to align the stack pointer there.

Note: The stack pointer adjustment is based on the new CallFrame pointer
value returned by operationSizeFrameForVarargs(). On 64-bit platforms,
both the stack pointer and call frame pointer are similarly aligned
(i.e. low nibbles are 0). Hence, no additional adjustment is needed.
Only the 32-bit code needs the fix.

Note: The LLINT also works this way i.e. aligns the stack pointer before
calling llint_slow_path_call_varargs().

* jit/JITCall32_64.cpp:
(JSC::JIT::compileLoadVarargs):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WK2 SPI to get bytecode profile from web process
https://bugs.webkit.org/show_bug.cgi?id=129069

Reviewed by Anders Carlsson.

Simple patch to allow asynchronous fetching of the
bytecode profiler output from the WebProcess.

* UIProcess/API/C/WKPage.cpp:
(WKPageGetBytecodeProfile):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getBytecodeProfile):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getBytecodeProfile):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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