WebKit-https.git
6 years ago[FTL] inlined GetMyArgumentByVal with no arguments passed causes instant crash
fpizlo@apple.com [Tue, 3 Feb 2015 00:43:25 +0000 (00:43 +0000)]
[FTL] inlined GetMyArgumentByVal with no arguments passed causes instant crash
https://bugs.webkit.org/show_bug.cgi?id=141180
rdar://problem/19677552

Reviewed by Benjamin Poulain.

If we do a GetMyArgumentByVal on an inlined call frame that has no arguments, then the
bounds check already terminates execution. This means we can skip the part where we
previously did an out-of-bound array access on the inlined call frame arguments vector.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::safelyInvalidateAfterTermination):
(JSC::FTL::LowerDFGToLLVM::compileGetMyArgumentByVal):
(JSC::FTL::LowerDFGToLLVM::terminate):
(JSC::FTL::LowerDFGToLLVM::didAlreadyTerminate):
(JSC::FTL::LowerDFGToLLVM::crash):
* tests/stress/get-my-argument-by-val-inlined-no-formal-parameters.js: Added.
(foo):
(bar):

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

6 years agoSimple line layout: use std::upper_bound in splitFragmentToFitLine()
zalan@apple.com [Mon, 2 Feb 2015 23:53:26 +0000 (23:53 +0000)]
Simple line layout: use std::upper_bound in splitFragmentToFitLine()
https://bugs.webkit.org/show_bug.cgi?id=141146

Reviewed by Antti Koivisto.

Replace the custom binary search implementation with std::upper_bound and
move splitting functionality to TextFragment.

No change in functionality.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator++):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=):
(WebCore::SimpleLineLayout::FragmentForwardIterator::operator*):
(WebCore::SimpleLineLayout::begin):
(WebCore::SimpleLineLayout::end):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
* rendering/SimpleLineLayoutFlowContentsIterator.cpp:
(WebCore::SimpleLineLayout::FlowContentsIterator::runWidth):
* rendering/SimpleLineLayoutFlowContentsIterator.h:
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::split):

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

6 years agoREGRESSION(r179477): arguments simplification no longer works
fpizlo@apple.com [Mon, 2 Feb 2015 23:36:45 +0000 (23:36 +0000)]
REGRESSION(r179477): arguments simplification no longer works
https://bugs.webkit.org/show_bug.cgi?id=141169

Reviewed by Mark Lam.

The operations involved in callee/scope access don't exit and shouldn't get in the way
of strength-reducing a Flush to a PhantomLocal. Then the PhantomLocal shouldn't get in
the way of further such strength-reduction. We also need to canonicalize PhantomLocal
before running arguments simplification.

* dfg/DFGMayExit.cpp:
(JSC::DFG::mayExit):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):

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

6 years agoVirtualRegister should really know how to dump itself
fpizlo@apple.com [Mon, 2 Feb 2015 23:32:00 +0000 (23:32 +0000)]
VirtualRegister should really know how to dump itself
https://bugs.webkit.org/show_bug.cgi?id=141171

Reviewed by Geoffrey Garen.

Gives VirtualRegister a dump() method that pretty-prints the virtual register. The rest of
the patch is all about using this new power.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::constantName):
(JSC::CodeBlock::registerName):
* bytecode/CodeBlock.h:
(JSC::missingThisObjectMarker): Deleted.
* bytecode/VirtualRegister.cpp: Added.
(JSC::VirtualRegister::dump):
* bytecode/VirtualRegister.h:
(WTF::printInternal): Deleted.
* dfg/DFGArgumentPosition.h:
(JSC::DFG::ArgumentPosition::dump):
* dfg/DFGFlushedAt.cpp:
(JSC::DFG::FlushedAt::dump):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGPutLocalSinkingPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::reportValidationContext):
* dfg/DFGValueSource.cpp:
(JSC::DFG::ValueSource::dump):
* dfg/DFGVariableEvent.cpp:
(JSC::DFG::VariableEvent::dump):
(JSC::DFG::VariableEvent::dumpSpillInfo):
* ftl/FTLExitArgumentForOperand.cpp:
(JSC::FTL::ExitArgumentForOperand::dump):
* ftl/FTLExitValue.cpp:
(JSC::FTL::ExitValue::dumpInContext):
* profiler/ProfilerBytecodeSequence.cpp:
(JSC::Profiler::BytecodeSequence::BytecodeSequence):

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

6 years agoUnreviewed, EFL gardening. Update flakiness tests on W3C SVG 1.1 tests.
gyuyoung.kim@samsung.com [Mon, 2 Feb 2015 23:14:50 +0000 (23:14 +0000)]
Unreviewed, EFL gardening. Update flakiness tests on W3C SVG 1.1 tests.

* platform/efl/TestExpectations:

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

6 years agoWeb Inspector: CSS Autocompletion: Autodetect many color supporting properties
joepeck@webkit.org [Mon, 2 Feb 2015 22:44:51 +0000 (22:44 +0000)]
Web Inspector: CSS Autocompletion: Autodetect many color supporting properties
https://bugs.webkit.org/show_bug.cgi?id=141166

Reviewed by Timothy Hatcher.

* UserInterface/Base/Utilities.js:
Add String.prototype.endsWith. Group String extensions together.

* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
If a property name ends in "color", provide CSS color completions.

(WebInspector.CSSKeywordCompletions.isColorAwareProperty): Deleted.
This was unused and disagrees slightly with the implementation above.

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

6 years agoUse FastMalloc (bmalloc) instead of BlockAllocator for GC pages
ggaren@apple.com [Mon, 2 Feb 2015 22:27:18 +0000 (22:27 +0000)]
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
https://bugs.webkit.org/show_bug.cgi?id=140900

Reviewed by Mark Hahnenberg.

Re-landing just the HandleBlock piece of this patch.

Source/JavaScriptCore:

* heap/HandleBlock.h:
* heap/HandleBlockInlines.h:
(JSC::HandleBlock::create):
(JSC::HandleBlock::destroy):
(JSC::HandleBlock::HandleBlock):
(JSC::HandleBlock::payloadEnd):
* heap/HandleSet.cpp:
(JSC::HandleSet::~HandleSet):
(JSC::HandleSet::grow):

Source/WebCore:

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::fastAlignedMalloc):
(WTF::fastAlignedFree):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
* wtf/FastMalloc.h:

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

6 years ago[Win] 64-bit build fix after r179492.
bfulgham@apple.com [Mon, 2 Feb 2015 22:22:48 +0000 (22:22 +0000)]
[Win] 64-bit build fix after r179492.

* WebCore.vcxproj/WebCore.vcxproj: Forgot to build these files
as standalone under 64-bit target.

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

6 years ago[Win] Unreviewed build fix after r179489.
bfulgham@apple.com [Mon, 2 Feb 2015 22:21:46 +0000 (22:21 +0000)]
[Win] Unreviewed build fix after r179489.

Correct symbol export definitions for 32-bit and 64-bit builds.
Also add some drive-by fixes for 64-bit symbols.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:

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

6 years agoClean up attribute handling: part 2 - attributeNode
benjamin@webkit.org [Mon, 2 Feb 2015 22:00:50 +0000 (22:00 +0000)]
Clean up attribute handling: part 2 - attributeNode
https://bugs.webkit.org/show_bug.cgi?id=141109

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-02-02
Reviewed by Andreas Kling.

Source/WebCore:

Our implementation was covering some old legacy behaviors of Firefox,
even copying bugs in some cases.

The spec (https://dom.spec.whatwg.org) now defines the behavior precisely,
let's move a bit closer to that.

Tests: fast/dom/Element/attribute-ascii-case-insensitive-3.html
       fast/dom/Element/attribute-setAttributeNode-multiple-times.html
       fast/dom/Element/attribute-setAttributeNodeNS-multiple-times.html
       fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html
       fast/dom/Element/mozilla-dom-base-tests/test_bug339494.html
       fast/dom/Element/mozilla-dom-base-tests/test_bug364092.xhtml
       fast/dom/Element/setAttributeNode-overriding-lowercase-values.html

* dom/Element.cpp:
(WebCore::findAttrNodeInList):
New getter for the name-without-namespace case.

(WebCore::Element::setAttributeNode):
This one is the tricky one: https://dom.spec.whatwg.org/#dom-element-setattributenode

When setAttributeNode() is used with an AttributeNode without namespace,
getting the old value behaves like getAttribute(), with ASCII lowercase name matching.
When used with a namespace, getting the old value behaves like getAttributeNS().

Setting the value is a whole different story, the name used always keeps
the original case.

Now that's a bit tricky for us because AttributeNodes are just legacy stuff we don't
used internally.

We have 4 cases to handle:
1) The name being set is lowercase, there was no conflicting name on the element.
   That's easy, we just override any node that would exist, set the name otherwise.
2) The name is lowercase but there was an existing attribute for it.
   -We create a new AttributeNode for the name to represent the old name.
   -We check the names are the same with attribute.name().matches(attrNode->qualifiedName())
    and override the value.
3) The name has uppercase characters, there is no conflicting name.
   We would not find an element to remove, we just use setAttributeInternal() as usual
   to add the attribute;
4) The name has uppercase characters, there is a lowercase conflicing name.
   This is the weird behavior: we need to nuke the old attribute, then add the new attribute
   with a different case.

   First we remove the attribute with a lowercase name with removeAttributeInternal().
   That becomes the old node.

   There might still be an element of the same name as what we are trying to add. We don't want
   to add another version of the same attribute. We need to use findAttributeIndexByName() again
   to find if there is a conflicting attribute. Then we call setAttributeInternal() which handle
   the both the cases where there was an element or not.

(WebCore::Element::setAttributeNodeNS):
This should work like any "NS" method.

(WebCore::Element::removeAttributeNode):
The method removeAttributeNode() is supposed to be exact.

(WebCore::Element::getAttributeNode):
(WebCore::Element::hasAttribute):
(WebCore::Element::attrIfExists):
* dom/Element.h:
* dom/ElementData.cpp:
(WebCore::ElementData::findAttributeIndexByNameSlowCase): Deleted.
(WebCore::ElementData::findAttributeIndexByNameForAttributeNode): Deleted.
Kill the slow case, every caller has been updated now.
* dom/ElementData.h:
(WebCore::ElementData::findAttributeIndexByName):
* dom/QualifiedName.h:
(WebCore::QualifiedName::matchesIgnoringCaseForLocalName): Deleted.

LayoutTests:

Improve the coverage a little.

Not everything is right yet: some getters return an empty string when they
should return null.

* fast/dom/Element/attribute-ascii-case-insensitive-1-expected.txt:
This is now fixed :)

* fast/dom/Element/attribute-ascii-case-insensitive-3-expected.txt: Added.
* fast/dom/Element/attribute-ascii-case-insensitive-3.html: Added.
Test prefixed-like attribute defined through the parser.

* fast/dom/Element/attribute-setAttributeNode-multiple-times-expected.txt: Added.
* fast/dom/Element/attribute-setAttributeNode-multiple-times.html: Added.
Make sure we don't accumulate nodes.

* fast/dom/Element/attribute-setAttributeNodeNS-multiple-times-expected.txt: Added.
* fast/dom/Element/attribute-setAttributeNodeNS-multiple-times.html: Added.
Same without the crazy setter.

* fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js:
* fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt:
With the latest spec, getting a node with any uppercase character through
getAttributeNode() always fails. Update the test to use .getAttributeNodeNS()
were needed.

* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702-expected.txt: Added.
* fast/dom/Element/mozilla-dom-base-tests/test_bug1075702.html: Added.
* fast/dom/Element/mozilla-dom-base-tests/test_bug339494-expected.txt: Added.
* fast/dom/Element/mozilla-dom-base-tests/test_bug339494.html: Added.
* fast/dom/Element/mozilla-dom-base-tests/test_bug364092-expected.txt: Added.
* fast/dom/Element/mozilla-dom-base-tests/test_bug364092.xhtml: Added.
(testGetAttributeNodeMixedCase):
(testAttribNodeNamePreservesCaseGetNode):
(testAttribNodeNamePreservesCaseGetNode2):
Some related tests from Gecko, for completeness.

* fast/dom/Element/setAttributeNode-case-insensitivity-expected.txt:
* fast/dom/Element/setAttributeNode-case-insensitivity.html:
Test that the getAttribute part of setAttributeNode() do not ignore the prefix. The spec
says to use the name, not the localname.

* fast/dom/Element/setAttributeNode-for-existing-attribute-expected.txt:
* fast/dom/Element/setAttributeNode-for-existing-attribute.html:
This test was for legacy behavior that came from Firefox. Firefox does not do that anymore.
Keep the test around for regression catching, but add a sentence explaining the 'incorrect'
behavior.

* fast/dom/Element/setAttributeNode-overriding-lowercase-values-1-expected.txt: Added.
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-1.html: Added.
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-2-expected.txt: Added.
* fast/dom/Element/setAttributeNode-overriding-lowercase-values-2.html: Added.
Some coverage for the name overriding craziness.

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

6 years agoRebaseline test with new expected results.
joepeck@webkit.org [Mon, 2 Feb 2015 21:55:11 +0000 (21:55 +0000)]
Rebaseline test with new expected results.

* http/tests/inspector-protocol/access-inspected-object-expected.txt:

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

6 years agoMemory is written to after deallocated, in GraphicsLayer::setMaskLayer.
commit-queue@webkit.org [Mon, 2 Feb 2015 21:39:14 +0000 (21:39 +0000)]
Memory is written to after deallocated, in GraphicsLayer::setMaskLayer.
https://bugs.webkit.org/show_bug.cgi?id=141168

Patch by peavo@outlook.com <peavo@outlook.com> on 2015-02-02
Reviewed by Brent Fulgham.

Visual Studio detected that a deallocated heap block had been modified in GraphicsLayer::setMaskLayer,
when called from RenderLayerBacking::updateChildClippingStrategy.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateChildClippingStrategy):

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

6 years ago[Cocoa] Make decoded image data purgeable ASAP.
akling@apple.com [Mon, 2 Feb 2015 21:25:24 +0000 (21:25 +0000)]
[Cocoa] Make decoded image data purgeable ASAP.
<https://webkit.org/b/140298>
<rdar://problem/19623377>

Reviewed by Antti Koivisto.

Re-landing this patch since it turned out to not be the cause of
the memory regression we saw around that revision.

Mark decoded images as "transient" which makes CoreGraphics mark
the backing stores as purgeable shortly after they're used.

The decoded representation will remain in CoreGraphics's caches
indefinitely unless the kernel gets starved and needs the pages.

Most resources will now reach a state where the encoded data is
mmap'ed from disk cache (once the entire resource is downloaded)
and the decoded data is purgeable.

This also has the side effect of making the MemoryCache more
palatial since the decoded data cost can be deducted for images,
allowing us to cache more resources.

Note that the worst case for this new behavior would be something
like hovering below 100% memory utilization and constantly having
to drop and re-decode images. While churny, it still beats
crashing the process, plus there's tiling to remove many of the
reasons we'd need the decoded data.

* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::createFrameAtIndex):

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

6 years agoWeb Inspector: Support console.table
joepeck@webkit.org [Mon, 2 Feb 2015 21:07:39 +0000 (21:07 +0000)]
Web Inspector: Support console.table
https://bugs.webkit.org/show_bug.cgi?id=141058

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
Include the firstLevelKeys filter when generating previews.

* runtime/ConsoleClient.cpp:
(JSC::appendMessagePrefix):
Differentiate console.table logs to system log.

Source/WebCore:

* inspector/CommandLineAPIModuleSource.js:
Include "table(foo)" as an alias of "console.table(foo)" on
the command line.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New "Index", "(Index)", "Value", table header strings.

* UserInterface/Views/ConsoleMessage.js:
Add "Table", but add FIXMEs to consider using the protocol generated enums.

* UserInterface/Views/ConsoleMessageImpl.js:
(WebInspector.ConsoleMessageImpl.prototype._format):
Special case console.table messages.

(WebInspector.ConsoleMessageImpl.prototype._appendPropertyPreviews):
(WebInspector.ConsoleMessageImpl.prototype._propertyPreviewElement):
Factor out ProjectPreview printing. Also, replace newlines in strings
with return characters, like we did elsewhere.

(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsTable):
Ultimately try to create a DataGrid from the output. Search first
for rich object data in the list. If no rich object data is found
just check for simple values. If the table is lossy, also do
a log of the object in case the user wants to see more data.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid):
The for..in enumeration is unordered and may not give us the
column ordering we wanted. So include an optional preferred
column names list to get the preferred order.

(WebInspector.DataGrid.createSortableDataGrid):
Numerous bug fixes here. Accidental globals, typos, and sorting failures.

(WebInspector.DataGrid.prototype.autoSizeColumns):
(WebInspector.DataGrid.prototype.textForDataGridNodeColumn):
(WebInspector.DataGrid.prototype._copyTextForDataGridNode):
Create a generic method to get the text for a datagrid node in a column.
This is important for getting the text from console.table previews which
contains Nodes.

* UserInterface/Views/LogContentView.css:
(.console-messages:focus .console-item.selected .data-grid tr.selected):
(.console-item .data-grid tr.selected):
DataGrid selection colors while in the console which may or may
not have selected console items.

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

6 years ago[Win] Build fix following r179482.
roger_fong@apple.com [Mon, 2 Feb 2015 21:04:08 +0000 (21:04 +0000)]
[Win] Build fix following r179482.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* bindings/js/JSBindingsAllInOne.cpp:
* platform/graphics/GraphicsContext3D.h:

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

6 years ago.:
fpizlo@apple.com [Mon, 2 Feb 2015 20:54:59 +0000 (20:54 +0000)]
.:
Revert accidental change in r179490.

* Makefile.shared:

Source/WebKit2:
Revert accidental (and super bad) change in r179490.

* WebProcess/com.apple.WebProcess.sb.in:

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

6 years agoBinarySwitch should be faster on average
fpizlo@apple.com [Mon, 2 Feb 2015 20:52:01 +0000 (20:52 +0000)]
BinarySwitch should be faster on average
https://bugs.webkit.org/show_bug.cgi?id=141046

Reviewed by Anders Carlsson.

This optimizes our binary switch using math. It's strictly better than what we had before
assuming we bottom out in some case (rather than fall through), assuming all cases get
hit with equal probability. The difference is particularly large for large switch
statements. For example, a switch statement with 1000 cases would previously require on
average 13.207 branches to get to some case, while now it just requires 10.464.

This is also a progression for the fall-through case, though we could shave off another
1/6 branch on average if we wanted to - though it would regress taking a case (not falling
through) by 1/6 branch. I believe it's better to bias the BinarySwitch for not falling
through.

This also adds some randomness to the algorithm to minimize the likelihood of us
generating a switch statement that is always particularly bad for some input. Note that
the randomness has no effect on average-case performance assuming all cases are equally
likely.

This ought to have no actual performance change because we don't rely on binary switches
that much. The main reason why this change is interesting is that I'm finding myself
increasingly relying on BinarySwitch, and I'd like to know that it's optimal.

* jit/BinarySwitch.cpp:
(JSC::BinarySwitch::BinarySwitch):
(JSC::BinarySwitch::~BinarySwitch):
(JSC::BinarySwitch::build):
* jit/BinarySwitch.h:

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

6 years agoAccess MemoryCache singleton using MemoryCache::singleton()
cdumez@apple.com [Mon, 2 Feb 2015 20:50:16 +0000 (20:50 +0000)]
Access MemoryCache singleton using MemoryCache::singleton()
https://bugs.webkit.org/show_bug.cgi?id=141104

Reviewed by Andreas Kling.

Access MemoryCache singleton using MemoryCache::singleton() static
member function, instead of a free function, as per the recent
coding style discussion on WebKit-dev.

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

6 years agoAmbiguous naming: Do not call replacedContentRect()'s return value paint rect.
zalan@apple.com [Mon, 2 Feb 2015 20:40:00 +0000 (20:40 +0000)]
Ambiguous naming: Do not call replacedContentRect()'s return value paint rect.
https://bugs.webkit.org/show_bug.cgi?id=141125

Reviewed by Simon Fraser.

It's the content box rect with the object-fit adjustment.

No change in functionality.

* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::updateInnerContentRect):
(WebCore::RenderImage::paintReplaced):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::replacedContentRect):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::splitFragmentToFitLine):

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

6 years ago[Win] Build fix after r179476.
bfulgham@apple.com [Mon, 2 Feb 2015 20:29:41 +0000 (20:29 +0000)]
[Win] Build fix after r179476.
https://bugs.webkit.org/show_bug.cgi?id=141026

Reviewed by Anders Carlsson.

MSVC has a compiler bug that forces us to make some explicit statements about how
the passed pointer values are handled.

* css/CSSParser.cpp:
(WebCore::CSSParser::SourceSize::SourceSize):
(WebCore::CSSParser::sourceSize):
* css/CSSParser.h:

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

6 years agoUnreviewed, revert accidental change to Makefile.shared in r179478
fpizlo@apple.com [Mon, 2 Feb 2015 20:28:17 +0000 (20:28 +0000)]
Unreviewed, revert accidental change to Makefile.shared in r179478

* Makefile.shared:

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

6 years agoGet rid of invalidSelectorVector, use Bison's error recovery instead
benjamin@webkit.org [Mon, 2 Feb 2015 20:13:05 +0000 (20:13 +0000)]
Get rid of invalidSelectorVector, use Bison's error recovery instead
https://bugs.webkit.org/show_bug.cgi?id=141147

Reviewed by Darin Adler.

* css/CSSGrammar.y.in:
Instead of reducing a null selector, we can use a real parsing error
to get out of invalid selector endings.

When that happens, Bison will pop the stack until it can reduce any
valid error recovery rules.

The problem is to make sure there is no floating values because
none of the reduce block between the error and the recovery would
be executed.

In this case, "nth_selector_ending" is a non-recursive production of
the NTHCHILDFUNCTIONS. In turn, NTHCHILDFUNCTIONS are productions
of the non-recursive "pseudo". "pseudo" is only used as a trivial
production of "specifier". "specifier" is only used by "specifier_list".

"specifier_list" has error recovery code -> no production could have
generated a floating values between "specifier_list" and "nth_selector_ending".

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

6 years agoMultiple CSS plus selector not working after checkbox:checked
benjamin@webkit.org [Mon, 2 Feb 2015 20:10:17 +0000 (20:10 +0000)]
Multiple CSS plus selector not working after checkbox:checked
https://bugs.webkit.org/show_bug.cgi?id=110594

Reviewed by Darin Adler.

I fixed the bug not so long ago.

This patch adds coverage for :checked since internal states
tend to have tricky update behaviors.

* fast/selectors/checked-direct-adjacent-style-update-1-expected.txt: Added.
* fast/selectors/checked-direct-adjacent-style-update-1.html: Added.
* fast/selectors/checked-direct-adjacent-style-update-2-expected.txt: Added.
* fast/selectors/checked-direct-adjacent-style-update-2.html: Added.
* fast/selectors/checked-direct-adjacent-style-update-3-expected.txt: Added.
* fast/selectors/checked-direct-adjacent-style-update-3.html: Added.
* fast/selectors/checked-direct-adjacent-style-update-4-expected.txt: Added.
* fast/selectors/checked-direct-adjacent-style-update-4.html: Added.

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

6 years agoWeb Inspector: Extend CSS.getSupportedCSSProperties to provide values for properties...
commit-queue@webkit.org [Mon, 2 Feb 2015 20:07:02 +0000 (20:07 +0000)]
Web Inspector: Extend CSS.getSupportedCSSProperties to provide values for properties for CSS Augmented JSContext
https://bugs.webkit.org/show_bug.cgi?id=141064

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

Source/JavaScriptCore:

* inspector/protocol/CSS.json:

Source/WebInspectorUI:

* UserInterface/Models/CSSCompletions.js:
* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.addCustomCompletions):
(WebInspector.CSSKeywordCompletions.addPropertyCompletionValues):
If a property is specified with custom values, extend the
keyword completions map to make those values available
in autocompletion.

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

6 years agoWebGL2: Implement spec section 3.7.1 Setting and getting state (Part 1).
roger_fong@apple.com [Mon, 2 Feb 2015 20:05:37 +0000 (20:05 +0000)]
WebGL2: Implement spec section 3.7.1 Setting and getting state (Part 1).
https://bugs.webkit.org/show_bug.cgi?id=141096
<rdar://problem/15002469>

Reviewed by Brent Fulgham.

This patch implements the WebGL2 versions of getParameter, getIndexedParameter and isEnabled.
It also removes the WebGL1 implementations from WebGLRenderingContextBase and moves it to WebGLRenderingContext.
I’ve stubbed out most of the parameters for now, some of which will be implemented in Part 2,
and the rest as the our WebGL2 implementation progresses.

* bindings/js/JSWebGL2RenderingContextCustom.cpp:
(WebCore::toJS):
(WebCore::JSWebGL2RenderingContext::getIndexedParameter):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getIndexedParameter):
(WebCore::WebGL2RenderingContext::getParameter):
(WebCore::WebGL2RenderingContext::validateCapability):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
(WebCore::WebGLRenderingContext::validateCapability):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getParameter): Deleted.
(WebCore::WebGLRenderingContextBase::validateCapability): Deleted.
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:
* platform/graphics/GraphicsContext3D.h:
Two read format parameters were moved from the WebGL2 spec to the WebGL1 spec. Update tests accordingly.
* fast/canvas/webgl/constants.html:
* fast/canvas/webgl/webgl-specific-expected.txt:
* fast/canvas/webgl/webgl-specific.html:
* webgl/1.0.2/resources/webgl_test_files/conformance/misc/webgl-specific.html:

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

6 years ago[iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestruc...
dbates@webkit.org [Mon, 2 Feb 2015 19:47:06 +0000 (19:47 +0000)]
[iOS] ASSERTION FAILED: m_scriptExecutionContext->isContextThread() in ContextDestructionObserver::observeContext
https://bugs.webkit.org/show_bug.cgi?id=141057
<rdar://problem/19068790>

Reviewed by Alexey Proskuryakov.

Source/JavaScriptCore:

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::receivedIndicateMessage): Modified to call WTF::callOnWebThreadOrDispatchAsyncOnMainThread().
(Inspector::dispatchAsyncOnQueueSafeForAnyDebuggable): Deleted; moved logic to common helper function,
WTF::callOnWebThreadOrDispatchAsyncOnMainThread() so that it can be called from both RemoteInspector::receivedIndicateMessage()
and CryptoKeyRSA::generatePair().

Source/WebCore:

Fixes an issue where we would create-/delete- the RSA crypto keys and dispatch callbacks on the wrong
thread in WebKit1 for iOS. In iOS WebKit1 we should perform such operations on thread WebThread.

This change is covered by existing layout tests.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair):

Source/WTF:

* wtf/MainThread.h:
* wtf/mac/MainThreadMac.mm:
(WTF::callOnWebThreadOrDispatchAsyncOnMainThread): Added.

LayoutTests:

Un-skip crypto tests. Also, group skip entries for tests crypto/subtle/{rsa-indexeddb, rsa-indexeddb-non-exportable}.html
with other skipped IndexedDB tests.

* platform/ios-simulator/TestExpectations:

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

6 years agoPrevent crash when accessing WebAVPlayerController.delegate.
commit-queue@webkit.org [Mon, 2 Feb 2015 19:40:57 +0000 (19:40 +0000)]
Prevent crash when accessing WebAVPlayerController.delegate.
https://bugs.webkit.org/show_bug.cgi?id=140893

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-02-02
Reviewed by Darin Adler.

Source/WebCore:

This patch aims to prevent a null delegate access during invalidation by adding null checks before accessing the delegate, by making explicit the recreation of m_playerController, and by consolidating and correcting the teardown sequence.

* WebCore.exp.in:
* platform/ios/WebVideoFullscreenInterface.h: add resetMediaState()
* platform/ios/WebVideoFullscreenInterfaceAVKit.h: ditto.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerController playerViewController:shouldExitFullScreenWithReason:]): Check for null before accessing delegate.
(-[WebAVPlayerController play:]): ditto.
(-[WebAVPlayerController pause:]): ditto.
(-[WebAVPlayerController togglePlayback:]): ditto.
(-[WebAVPlayerController setPlaying:]): ditto.
(-[WebAVPlayerController beginScrubbing:]): ditto.
(-[WebAVPlayerController endScrubbing:]): ditto.
(-[WebAVPlayerController seekToTime:]): ditto.
(-[WebAVPlayerController beginScanningForward:]): ditto.
(-[WebAVPlayerController endScanningForward:]): ditto.
(-[WebAVPlayerController beginScanningBackward:]): ditto.
(-[WebAVPlayerController endScanningBackward:]): ditto.
(-[WebAVPlayerController seekToBeginning:]): ditto.
(-[WebAVPlayerController seekToEnd:]): ditto.
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]): ditto.
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]): ditto.
(-[WebAVPlayerController layoutSublayersOfLayer:]): ditto.
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit): initialize m_playerController
(WebVideoFullscreenInterfaceAVKit::resetMediaState): Added.
(WebVideoFullscreenInterfaceAVKit::setDuration): remove playerController()
(WebVideoFullscreenInterfaceAVKit::setCurrentTime): ditto.
(WebVideoFullscreenInterfaceAVKit::setRate): ditto.
(WebVideoFullscreenInterfaceAVKit::setVideoDimensions): ditto.
(WebVideoFullscreenInterfaceAVKit::setSeekableRanges): ditto.
(WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse): ditto.
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions): ditto.
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions): ditto.
(WebVideoFullscreenInterfaceAVKit::setExternalPlayback): ditto.
(WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): ditto.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): ditto.
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal): consolidated cleanup code from invalidate()
(WebVideoFullscreenInterfaceAVKit::invalidate): consolidate cleanup code.
(WebVideoFullscreenInterfaceAVKit::playerController): Deleted.
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::setVideoElement): call resetMediaState()

Source/WebKit2:

Plumb new resetMediaState() through IPC interface WebVideoFullscreenManagerProxy.

* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::invalidate): remove redundant set to nullptr.
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::resetMediaState):

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

6 years agoCreate tests for JSC's Control Flow Profiler
saambarati1@gmail.com [Mon, 2 Feb 2015 19:05:46 +0000 (19:05 +0000)]
Create tests for JSC's Control Flow Profiler
https://bugs.webkit.org/show_bug.cgi?id=141123

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

This patch creates a control flow profiler testing API in jsc.cpp
that accepts a function and a string as arguments. The string must
be a substring of the text of the function argument. The API returns
a boolean indicating whether or not the basic block that encloses the
substring has executed.

This patch uses this API to test that the control flow profiler
behaves as expected on basic block boundaries. These tests do not
provide full coverage for all JavaScript statements that can create
basic blocks boundaries. Full coverage will come in a later patch.

* jsc.cpp:
(GlobalObject::finishCreation):
(functionHasBasicBlockExecuted):
* runtime/ControlFlowProfiler.cpp:
(JSC::ControlFlowProfiler::hasBasicBlockAtTextOffsetBeenExecuted):
* runtime/ControlFlowProfiler.h:
* tests/controlFlowProfiler: Added.
* tests/controlFlowProfiler.yaml: Added.
* tests/controlFlowProfiler/driver: Added.
* tests/controlFlowProfiler/driver/driver.js: Added.
(assert):
* tests/controlFlowProfiler/if-statement.js: Added.
(testIf):
(noMatches):
* tests/controlFlowProfiler/loop-statements.js: Added.
(forRegular):
(forIn):
(forOf):
(whileLoop):
* tests/controlFlowProfiler/switch-statements.js: Added.
(testSwitch):
* tests/controlFlowProfiler/test-jit.js: Added.
(tierUpToBaseline):
(tierUpToDFG):
(baselineTest):
(dfgTest):

Tools:

* Scripts/run-javascriptcore-tests:
(runJSCStressTests):
* Scripts/run-jsc-stress-tests:

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

6 years agoPolymorphic call inlining should be based on polymorphic call inline caching rather...
fpizlo@apple.com [Mon, 2 Feb 2015 18:38:08 +0000 (18:38 +0000)]
Polymorphic call inlining should be based on polymorphic call inline caching rather than logging
https://bugs.webkit.org/show_bug.cgi?id=140660

Reviewed by Geoffrey Garen.

When we first implemented polymorphic call inlining, we did the profiling based on a call
edge log. The idea was to store each call edge (a tuple of call site and callee) into a
global log that was processed lazily. Processing the log would give precise counts of call
edges, and could be used to drive well-informed inlining decisions - polymorphic or not.
This was a speed-up on throughput tests but a slow-down for latency tests. It was a net win
nonetheless.

Experience with this code shows three things. First, the call edge profiler is buggy and
complex. It would take work to fix the bugs. Second, the call edge profiler incurs lots of
overhead for latency code that we care deeply about. Third, it's not at all clear that
having call edge counts for every possible callee is any better than just having call edge
counts for the limited number of callees that an inline cache would catch.

So, this patch removes the call edge profiler and replaces it with a polymorphic call inline
cache. If we miss the basic call inline cache, we inflate the cache to be a jump to an
out-of-line stub that cases on the previously known callees. If that misses again, then we
rewrite that stub to include the new callee. We do this up to some number of callees. If we
hit the limit then we switch to using a plain virtual call.

Substantial speed-up on V8Spider; undoes the slow-down that the original call edge profiler
caused. Might be a SunSpider speed-up (below 1%), depending on hardware.

Rolling this back in after fixing https://bugs.webkit.org/show_bug.cgi?id=141107.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CallEdge.h:
(JSC::CallEdge::count):
(JSC::CallEdge::CallEdge):
* bytecode/CallEdgeProfile.cpp: Removed.
* bytecode/CallEdgeProfile.h: Removed.
* bytecode/CallEdgeProfileInlines.h: Removed.
* bytecode/CallLinkInfo.cpp:
(JSC::CallLinkInfo::unlink):
(JSC::CallLinkInfo::visitWeak):
* bytecode/CallLinkInfo.h:
* bytecode/CallLinkStatus.cpp:
(JSC::CallLinkStatus::CallLinkStatus):
(JSC::CallLinkStatus::computeFor):
(JSC::CallLinkStatus::computeFromCallLinkInfo):
(JSC::CallLinkStatus::isClosureCall):
(JSC::CallLinkStatus::makeClosureCall):
(JSC::CallLinkStatus::dump):
(JSC::CallLinkStatus::computeFromCallEdgeProfile): Deleted.
* bytecode/CallLinkStatus.h:
(JSC::CallLinkStatus::CallLinkStatus):
(JSC::CallLinkStatus::isSet):
(JSC::CallLinkStatus::variants):
(JSC::CallLinkStatus::size):
(JSC::CallLinkStatus::at):
(JSC::CallLinkStatus::operator[]):
(JSC::CallLinkStatus::canOptimize):
(JSC::CallLinkStatus::edges): Deleted.
(JSC::CallLinkStatus::canTrustCounts): Deleted.
* bytecode/CallVariant.cpp:
(JSC::variantListWithVariant):
(JSC::despecifiedVariantList):
* bytecode/CallVariant.h:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::~CodeBlock):
(JSC::CodeBlock::linkIncomingPolymorphicCall):
(JSC::CodeBlock::unlinkIncomingCalls):
(JSC::CodeBlock::noticeIncomingCall):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::isIncomingCallAlreadyLinked): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::addCallWithoutSettingResult):
(JSC::DFG::ByteCodeParser::handleCall):
(JSC::DFG::ByteCodeParser::handleInlining):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasHeapPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTierUpCheckInjectionPhase.cpp:
(JSC::DFG::TierUpCheckInjectionPhase::run):
(JSC::DFG::TierUpCheckInjectionPhase::removeFTLProfiling): Deleted.
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* heap/Heap.cpp:
(JSC::Heap::collect):
* jit/BinarySwitch.h:
* jit/ClosureCallStubRoutine.cpp: Removed.
* jit/ClosureCallStubRoutine.h: Removed.
* jit/JITCall.cpp:
(JSC::JIT::compileOpCall):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileOpCall):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
(JSC::operationLinkPolymorphicCallFor):
(JSC::operationLinkClosureCallFor): Deleted.
* jit/JITStubRoutine.h:
* jit/JITWriteBarrier.h:
* jit/PolymorphicCallStubRoutine.cpp: Added.
(JSC::PolymorphicCallNode::~PolymorphicCallNode):
(JSC::PolymorphicCallNode::unlink):
(JSC::PolymorphicCallCase::dump):
(JSC::PolymorphicCallStubRoutine::PolymorphicCallStubRoutine):
(JSC::PolymorphicCallStubRoutine::~PolymorphicCallStubRoutine):
(JSC::PolymorphicCallStubRoutine::variants):
(JSC::PolymorphicCallStubRoutine::edges):
(JSC::PolymorphicCallStubRoutine::visitWeak):
(JSC::PolymorphicCallStubRoutine::markRequiredObjectsInternal):
* jit/PolymorphicCallStubRoutine.h: Added.
(JSC::PolymorphicCallNode::PolymorphicCallNode):
(JSC::PolymorphicCallCase::PolymorphicCallCase):
(JSC::PolymorphicCallCase::variant):
(JSC::PolymorphicCallCase::codeBlock):
* jit/Repatch.cpp:
(JSC::linkSlowFor):
(JSC::linkFor):
(JSC::revertCall):
(JSC::unlinkFor):
(JSC::linkVirtualFor):
(JSC::linkPolymorphicCall):
(JSC::linkClosureCall): Deleted.
* jit/Repatch.h:
* jit/ThunkGenerators.cpp:
(JSC::linkPolymorphicCallForThunkGenerator):
(JSC::linkPolymorphicCallThunkGenerator):
(JSC::linkPolymorphicCallThatPreservesRegsThunkGenerator):
(JSC::linkClosureCallForThunkGenerator): Deleted.
(JSC::linkClosureCallThunkGenerator): Deleted.
(JSC::linkClosureCallThatPreservesRegsThunkGenerator): Deleted.
* jit/ThunkGenerators.h:
(JSC::linkPolymorphicCallThunkGeneratorFor):
(JSC::linkClosureCallThunkGeneratorFor): Deleted.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::prepareToDiscardCode):
(JSC::VM::ensureCallEdgeLog): Deleted.
* runtime/VM.h:

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

6 years agoConverting Flushes and PhantomLocals to Phantoms requires an OSR availability analysi...
fpizlo@apple.com [Mon, 2 Feb 2015 18:15:44 +0000 (18:15 +0000)]
Converting Flushes and PhantomLocals to Phantoms requires an OSR availability analysis rather than just using the SetLocal's child
https://bugs.webkit.org/show_bug.cgi?id=141107

Reviewed by Michael Saboff.

See the bugzilla for a discussion of the problem. This addresses the problem by ensuring
that Flushes are always strength-reduced to PhantomLocals, and CPS rethreading does a mini
OSR availability analysis to determine the right MovHint value to use for the Phantom.

* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::CPSRethreadingPhase):
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::clearVariables):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::clearVariablesAtHeadAndTail): Deleted.
* dfg/DFGNode.h:
(JSC::DFG::Node::convertPhantomToPhantomLocal):
(JSC::DFG::Node::convertFlushToPhantomLocal):
(JSC::DFG::Node::convertToPhantomLocal): Deleted.
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* tests/stress/inline-call-that-doesnt-use-all-args.js: Added.
(foo):
(bar):
(baz):

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

6 years agoREGRESSION (r170576): Storage leaks in parsing of CSS image sizes
darin@apple.com [Mon, 2 Feb 2015 18:12:32 +0000 (18:12 +0000)]
REGRESSION (r170576): Storage leaks in parsing of CSS image sizes
https://bugs.webkit.org/show_bug.cgi?id=141026

Reviewed by Anders Carlsson.

* css/CSSGrammar.y.in: Fixed all the shift/reduce conflicts caused
by the ENABLE_PICTURE_SIZES code by removing all the redundant
maybe_space which caused them. Rearranged the productions for
ENABLE_PICTURE_SIZES to tighten up the code quite a bit. Changed
the code to build up the source size vector as a Vector instead of
a special class, and use the SourceSize struct from inside the
CSSParser class.'

* css/CSSParser.cpp:
(WebCore::CSSParser::setupParser): Changed this to take a StringView.
In the future we can change all the parsing functions to take StringView,
since they don't work with the String in place.
(WebCore::CSSParser::parseSizesAttribute): Changed to return a vector
of SourceSize instead of a SourceSizeList. This is better because it's
a real CSS data structure that does not contain a CSSParserValue.
(WebCore::CSSParser::sourceSize): Added. Helper that creates a
SourceSize, mapping parser data structures into real CSS ones.

* css/CSSParser.h: Updated for changes above.

* css/MediaQuery.cpp:
(WebCore::MediaQuery::MediaQuery): Use std::make_unique and the copy
constructor directly instead of using a MediaQuery::copy function.

* css/MediaQueryExp.cpp: Streamlined the class a little bit.
* css/MediaQueryExp.h: Removed unneeded includes. Moved functions out
of the class body so the class is easier to read. Removed the unneeded
copy function.

* css/SourceSizeList.cpp:
(WebCore::SourceSize::match): Changed to use WTF::move instead
of releasing and then re-creating the unique_ptr.
(WebCore::computeLength): Added a comment to explain this function
is using an incorrect strategy. Also added some type checking code
to handle cases where a null or non-primitive CSS value might be
returned. Probably dead code, but we don't want to risk a bad cast.
Worthe cleaning up when we fix the strategy.
(WebCore::SourceSizeList::getEffectiveSize): Updated since the
vector now contains actual SourceSize objects rather than pointers
to SourceSize objects on the heap.

* css/SourceSizeList.h: Changed the CSSParserValue argument to be
an rvalue reference to make it clearer that we take ownership of it
when it's moved in. Added a move constructor and a destructor. Added
comments explaining that it's not correct design to use a
CSSParserValue here, outside the parser. Changed SourceSizeList's
append function to move a SourceSize in rather than a unique_ptr.
Made getEffectiveSize private. Moved the various inline functions to
the bottom of the file to make the class definitions easier to read.

* css/SourceSizeList.cpp: Made almost everything about this private
to this source file instead of public in the header.
(WebCore::match): Made this a free function instead of a member function
and made it take the media query expression as an argument.
(WebCore::computeLength): Changed the argument type to CSSValue*,
rather than using CSSParserValue here outside the parser.
(WebCore::parseSizesAttribute): Streamlined and simplified this.
Now that the parser builds the list in the correct order, there was
no need to iterate backwards any more so we could use a modern for
loop.

* css/SourceSizeList.h: Removed almost everything in this header.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute): Call the
parseSizesAttribute function as free function since it's no longer
a member of a SourceSizeList class.

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
Ditto.

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

6 years agoRemove copy/paste code from run-jsc-stress-tests to determine numberOfTests
ossy@webkit.org [Mon, 2 Feb 2015 17:06:19 +0000 (17:06 +0000)]
Remove copy/paste code from run-jsc-stress-tests to determine numberOfTests
https://bugs.webkit.org/show_bug.cgi?id=141158

Reviewed by Darin Adler.

* Scripts/run-jsc-stress-tests:

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

6 years ago[GTK] MiniBrowser should close itself on Ctrl+W or Ctrl+Q
commit-queue@webkit.org [Mon, 2 Feb 2015 08:48:37 +0000 (08:48 +0000)]
[GTK] MiniBrowser should close itself on Ctrl+W or Ctrl+Q
https://bugs.webkit.org/show_bug.cgi?id=141142

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-02-02
Reviewed by Carlos Garcia Campos.

* MiniBrowser/gtk/BrowserWindow.c:
(browser_window_init): Quit on Ctrl+W or Ctrl+Q

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

6 years agoFix some leaks found by the leak bot
darin@apple.com [Mon, 2 Feb 2015 08:27:03 +0000 (08:27 +0000)]
Fix some leaks found by the leak bot
https://bugs.webkit.org/show_bug.cgi?id=141149

Reviewed by Alexey Proskuryakov.

* bindings/js/JSSubtleCryptoCustom.cpp:
(WebCore::importKey): Changed argument types to std::unique_ptr for better code clarity.
(WebCore::JSSubtleCrypto::importKey): Use WTF::move instead of release.
(WebCore::JSSubtleCrypto::wrapKey): Fixed leaks by adding missing delete calls to the
case where we get a DOM exception.
(WebCore::JSSubtleCrypto::unwrapKey): Ditto.

* dom/SelectorQuery.cpp:
(WebCore::SelectorQuery::SelectorQuery): Use WTF::move here. Not clear how this could
have caused the storage leak, but it does seem obviously missing. The leak is pretty big,
implying that we leak almost all CSSSelectorList objects we parse; not sure this fixes it.

* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveResponse): Added code to
deleted the unguarded pointer if postTaskForModeToWorkerGlobalScope fails.
(WebCore::WorkerThreadableLoader::MainThreadBridge::didReceiveData): Ditto.
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail): Ditto.
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck): Ditto.

* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions): Added missing adoptNS.

* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::updateDocumentMarkerResources): Added missing release.

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

6 years agoUse more references in HistoryItem
cdumez@apple.com [Mon, 2 Feb 2015 00:49:36 +0000 (00:49 +0000)]
Use more references in HistoryItem
https://bugs.webkit.org/show_bug.cgi?id=141133

Reviewed by Andreas Kling.

Use more references in HistoryItem instead of pointers.
Source/WebKit2:

* WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
(WebKit::InjectedBundleBackForwardListItem::children):
* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::addItem):
* WebProcess/WebPage/WebBackForwardListProxy.h:

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

6 years agoUnreviewed, rolling out r179467 and r179470.
commit-queue@webkit.org [Sun, 1 Feb 2015 23:47:31 +0000 (23:47 +0000)]
Unreviewed, rolling out r179467 and r179470.
https://bugs.webkit.org/show_bug.cgi?id=141144

Broke svg/custom/use-events-crash.svg (Requested by ap on
#webkit).

Reverted changesets:

"Stop dispatching events with SVGElementInstance objects as
their targets"
https://bugs.webkit.org/show_bug.cgi?id=141108
http://trac.webkit.org/changeset/179467

"REGRESSION(r179467): svg/custom/use-events-crash.svg times
out"
http://trac.webkit.org/changeset/179470

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

6 years agoREGRESSION(r179467): svg/custom/use-events-crash.svg times out
ap@apple.com [Sun, 1 Feb 2015 22:05:52 +0000 (22:05 +0000)]
REGRESSION(r179467): svg/custom/use-events-crash.svg times out

Looks like the new test (svg/custom/use-event-retargeting.html) somehow breaks
subsequent one, let's try skipping it for now.

* TestExpectations:

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

6 years agoWeb platform test server is not always launching properly on Mac EWS bots
youenn.fablet@crf.canon.fr [Sun, 1 Feb 2015 21:23:07 +0000 (21:23 +0000)]
Web platform test server is not always launching properly on Mac EWS bots
https://bugs.webkit.org/show_bug.cgi?id=141141

Unreviewed.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
(create_wpt_empty_file_if_needed): Removed creation of empty __init.py__ files from AutoInstalled modules.

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

6 years agoRemove ViewGestureController tracing
mitz@apple.com [Sun, 1 Feb 2015 18:42:33 +0000 (18:42 +0000)]
Remove ViewGestureController tracing
https://bugs.webkit.org/show_bug.cgi?id=141137

Reviewed by Tim Horton.

Remove the tracing added in r176133, now that http://webkit.org/b/138750 is fixed.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::endSwipeGesture):
(WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
(WebKit::ViewGestureController::removeSwipeSnapshot):
(WebKit::addLogEntry): Deleted.
(WebKit::dumpLogEntries): Deleted.
* UIProcess/mac/ViewGestureController.h:

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

6 years agoSource/WebCore:
darin@apple.com [Sun, 1 Feb 2015 15:22:57 +0000 (15:22 +0000)]
Source/WebCore:
Stop dispatching events to with SVGElementInstance objects as their targets
https://bugs.webkit.org/show_bug.cgi?id=141108

Reviewed by Anders Carlsson.

Test: svg/custom/use-event-retargeting.html

* dom/EventDispatcher.cpp:
(WebCore::eventTargetRespectingTargetRules): Replaced the code that retargeted
events at SVGElementInstance objects with code that retargets them at the use
element instead. Also wrote the code in a simpler way.

LayoutTests:
Stop dispatching events with SVGElementInstance objects as their targets
https://bugs.webkit.org/show_bug.cgi?id=141108

Reviewed by Anders Carlsson.

Many tests are no longer relevant once we aren't doing this any more.

* platform/gtk/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
* platform/gtk/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
* platform/gtk/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/ios-sim-deprecated/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/ios-simulator/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/mac-mountainlion/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png: Removed.
* platform/mac/svg/custom/use-instanceRoot-modifications-expected.png: Removed.
* platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt: Removed.
* svg/custom/use-instanceRoot-modifications.svg: Removed.
* svg/custom/use-instanceRoot-with-use-removed-expected.txt: Removed.
* svg/custom/use-instanceRoot-with-use-removed.svg: Removed.

* svg/custom/resources/use-instanceRoot-event-bubbling.js: Updated this test to expect
the events to be dispatched with the SVGUseElement as the target. I talked this over with
Sam Weinig and we decided this is good behavior for now, and it almost matches what the
spec says. Might be worth refining later.
* svg/custom/use-instanceRoot-event-bubbling-expected.txt: Updated expected results.
* svg/custom/use-instanceRoot-event-bubbling.xhtml: Tweaked the test a little. It still
could use improvement; it's like half a "repaint test", which is strange.

* svg/custom/use-event-retargeting-expected.txt: Added. Got this test from Blink.
* svg/custom/use-event-retargeting.html: Added. Ditto.

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

6 years agoUnreviewd EFL gardening. Add new failing tests related to W3C SVG 1.1.
gyuyoung.kim@samsung.com [Sun, 1 Feb 2015 14:53:01 +0000 (14:53 +0000)]
Unreviewd EFL gardening. Add new failing tests related to W3C SVG 1.1.

* platform/efl/TestExpectations:

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

6 years agoUnreviewed EFL gardening. Update crash tests related to webgl because
gyuyoung.kim@samsung.com [Sun, 1 Feb 2015 13:02:05 +0000 (13:02 +0000)]
Unreviewed EFL gardening. Update crash tests related to webgl because
webgl isn't supported by EFL port at the moment.

* platform/efl/TestExpectations:

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

6 years agoUnreviewed EFL gardening. Update tests which don't have expectation result yet.
gyuyoung.kim@samsung.com [Sun, 1 Feb 2015 12:22:16 +0000 (12:22 +0000)]
Unreviewed EFL gardening. Update tests which don't have expectation result yet.

* platform/efl/TestExpectations:

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

6 years ago[TexMap] Optimize TextureMapperLayer::removeAllChildren()
zandobersek@gmail.com [Sun, 1 Feb 2015 10:25:15 +0000 (10:25 +0000)]
[TexMap] Optimize TextureMapperLayer::removeAllChildren()
https://bugs.webkit.org/show_bug.cgi?id=140734

Reviewed by Chris Dumez.

Instead of removing the children from the Vector member one by one,
move the Vector out and iterate through the ex-children, clearing
out the pointer to the parent.

* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::removeAllChildren):

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

6 years ago[TexMap] Avoid unnecessary TransformationMatrix copies in GraphicsLayerTransform
zandobersek@gmail.com [Sun, 1 Feb 2015 10:17:49 +0000 (10:17 +0000)]
[TexMap] Avoid unnecessary TransformationMatrix copies in GraphicsLayerTransform
https://bugs.webkit.org/show_bug.cgi?id=140735

Reviewed by Chris Dumez.

* platform/graphics/GraphicsLayerTransform.cpp:
(WebCore::GraphicsLayerTransform::combined): Return a const reference to the matrix.
(WebCore::GraphicsLayerTransform::combinedForChildren): Ditto.
(WebCore::GraphicsLayerTransform::combineTransforms): First copy the parent transform,
then apply the translation and multiplication. Previously this copied the parent
transform into a temporary object, performed the translation and multiplication, and
copied that temporary object again when assigning to the member variable.
(WebCore::GraphicsLayerTransform::combineTransformsForChildren): Mark const. m_childrenDirty
and m_combinedForChildren members are marked mutable.
* platform/graphics/GraphicsLayerTransform.h:

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

6 years agoUnreviewed EFL gardening. Update flaky tests regarding W3C SVG 1.1 tests.
gyuyoung.kim@samsung.com [Sun, 1 Feb 2015 07:30:31 +0000 (07:30 +0000)]
Unreviewed EFL gardening. Update flaky tests regarding W3C SVG 1.1 tests.

* platform/efl/TestExpectations:

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

6 years ago[Win] Unreviewed test machine configuration change.
bfulgham@apple.com [Sun, 1 Feb 2015 06:54:29 +0000 (06:54 +0000)]
[Win] Unreviewed test machine configuration change.

* http/conf/apache2.4-httpd-win.conf: Provide reasonable default PidFile location for xampp-based install.

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

6 years agoREGRESSION (r177689): Emoji variation sequences rendered incorrectly (as characters...
commit-queue@webkit.org [Sun, 1 Feb 2015 04:18:00 +0000 (04:18 +0000)]
REGRESSION (r177689): Emoji variation sequences rendered incorrectly (as characters from other non-emoji font)
https://bugs.webkit.org/show_bug.cgi?id=141112

Patch by Myles C. Maxfield <litherum@gmail.com> on 2015-01-31
Reviewed by Sam Weinig.

Source/WebCore:

Typo in r177689.

Test: platform/mac/fast/text/combining-mark-paint.html

* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

LayoutTests:

* platform/mac/fast/text/combining-mark-paint-expected.html: Added.
* platform/mac/fast/text/combining-mark-paint.html: Added.

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

6 years agoUnreviewed, rolling out r178183.
commit-queue@webkit.org [Sun, 1 Feb 2015 04:03:43 +0000 (04:03 +0000)]
Unreviewed, rolling out r178183.
https://bugs.webkit.org/show_bug.cgi?id=141132

Caused more mallocing than the volatility saved. (Requested by
kling on #webkit).

Reverted changeset:

"[Cocoa] Make decoded image data purgeable ASAP."
https://bugs.webkit.org/show_bug.cgi?id=140298
http://trac.webkit.org/changeset/178183

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

6 years agoCrash (DFG assertion) beneath AbstractInterpreter::verifyEdge() @ http://experilous...
msaboff@apple.com [Sun, 1 Feb 2015 03:58:39 +0000 (03:58 +0000)]
Crash (DFG assertion) beneath AbstractInterpreter::verifyEdge() @ experilous.com/1/planet-generator/2014-09-28/version-1
https://bugs.webkit.org/show_bug.cgi?id=141111

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

In LowerDFGToLLVM::compileNode(), if we determine while compiling a node that we would have
exited, we don't need to process the OSR availability or abstract interpreter.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::safelyInvalidateAfterTermination): Broke this out a a separate
method since we need to call it at the top and near the bottom of compileNode().
(JSC::FTL::LowerDFGToLLVM::compileNode):

LayoutTests:

New tests.

* js/regress-141111-expected.txt: Added.
* js/regress-141111.html: Added.
* js/script-tests/regress-141111.js: Added.
(MyObject):
(foo):
(.result):
(bar):

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

6 years agoUse simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
cdumez@apple.com [Sun, 1 Feb 2015 03:11:14 +0000 (03:11 +0000)]
Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
https://bugs.webkit.org/show_bug.cgi?id=141110

Reviewed by Antti Koivisto.

Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING
enabled. Previously, we would be using a HashMap of HashMap to store
CachedResources. The outer HashMap would use the URL as key and the inner
HashMap would use the partition name as key. This would make traversing the
structure overly complicated, especially considering that the code needs to
traverse a simple HashMap if CACHE_PARTITIONING is disabled.

This patch updates the CachedResourceMap structure to be a simple HashMap,
whose key is an std::pair<URL, String /* partitionName */>. Having a flat
structure simplifies the traversal code a lot and enables more code sharing
between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress
performance because we always have both a URL and a partition name when we
need to look up a resource. We never need to retrieve all resources with
a particular URL.

This patch also switches to using a URL as key instead of a String as we
always have a URL has input.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequestImpl):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::remove):
After removing the resource from the CachedResourceMap, remove the
sessionID from m_sessionResources if the CachedResourceMap is now
empty. Previously, no code was removing sessionIDs from
m_sessionResources.

(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::getOriginsWithCache):
(WebCore::MemoryCache::getStatistics):
(WebCore::MemoryCache::setDisabled):
* loader/cache/MemoryCache.h:

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

6 years agoMerge the iOS implementations of GraphicsContext::drawText and GraphicsContext::drawB...
commit-queue@webkit.org [Sun, 1 Feb 2015 03:04:21 +0000 (03:04 +0000)]
Merge the iOS implementations of GraphicsContext::drawText and GraphicsContext::drawBidiText with the platform independent ones
https://bugs.webkit.org/show_bug.cgi?id=141131

Patch by Sam Weinig <sam@webkit.org> on 2015-01-31
Reviewed by Antti Koivisto.

* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawText):
The only difference between the two implementation here was the iOS one returns the length of
the text that was drawn. As all platforms now support that, we can merge by keeping the iOS one.

(WebCore::GraphicsContext::drawBidiText):
This function had a few differences:
    - iOS returns the length of the text that was drawn.
        Since this is not used anywhere, I dropped this ability.
    - iOS took additional inputs of initial bidi status and run length (and returned the
      the final bidi status as an out parameter)
        Since this was also unused, I dropped it.
    - iOS used the fact that font.drawText() returns the length that was drawn, to avoid
      measuring the text twice.
        I kept this, since all platforms now support this.

* platform/graphics/GraphicsContext.h:
Update signatures. Remove WEBCORE_EXPORT for function that is not used outside of WebCore.

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

6 years agoShrink RenderBlock.
akling@apple.com [Sun, 1 Feb 2015 02:58:13 +0000 (02:58 +0000)]
Shrink RenderBlock.
<https://webkit.org/b/141129>

Reviewed by Antti Koivisto.

Get rid of the bitfield in RenderBlock by moving the essential bits to
RenderElement (plenty of space in the bitfield there.)

RenderBlock also had a cache of its line-height, but it doesn't appear
to help any of the benchmarks that we're tracking so I'd say it's okay
to lose this optimization.

This knocks 8 bytes off of RenderBlock (and all of its subclasses.)

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::RenderBlock):
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::recomputeLogicalWidth):
(WebCore::RenderBlock::lineHeight):
* rendering/RenderBlock.h:
(WebCore::RenderBlock::setHasMarginBeforeQuirk):
(WebCore::RenderBlock::setHasMarginAfterQuirk):
(WebCore::RenderBlock::setHasBorderOrPaddingLogicalWidthChanged):
(WebCore::RenderBlock::hasMarginBeforeQuirk):
(WebCore::RenderBlock::hasMarginAfterQuirk):
(WebCore::RenderBlock::hasBorderOrPaddingLogicalWidthChanged):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutInlineChildren):
(WebCore::RenderBlockFlow::invalidateLineLayoutPath):
(WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
(WebCore::RenderBlockFlow::ensureLineBoxes):
* rendering/RenderBlockFlow.h:
(WebCore::RenderBlockFlow::lineLayoutPath):
(WebCore::RenderBlockFlow::setLineLayoutPath):
(WebCore::RenderBlockFlow::setHasMarkupTruncation):
(WebCore::RenderBlockFlow::hasMarkupTruncation):
(WebCore::RenderBlockFlow::simpleLineLayout):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderElement.h:
(WebCore::RenderElement::setRenderBlockHasMarginBeforeQuirk):
(WebCore::RenderElement::setRenderBlockHasMarginAfterQuirk):
(WebCore::RenderElement::setRenderBlockHasBorderOrPaddingLogicalWidthChanged):
(WebCore::RenderElement::renderBlockHasMarginBeforeQuirk):
(WebCore::RenderElement::renderBlockHasMarginAfterQuirk):
(WebCore::RenderElement::renderBlockHasBorderOrPaddingLogicalWidthChanged):
(WebCore::RenderElement::setRenderBlockFlowLineLayoutPath):
(WebCore::RenderElement::setRenderBlockFlowHasMarkupTruncation):
(WebCore::RenderElement::renderBlockFlowLineLayoutPath):
(WebCore::RenderElement::renderBlockFlowHasMarkupTruncation):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::removeLineRegionInfo):

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

6 years agoRemove useless PageCache::singleton() call from PageCache member function
cdumez@apple.com [Sun, 1 Feb 2015 02:06:44 +0000 (02:06 +0000)]
Remove useless PageCache::singleton() call from PageCache member function
https://bugs.webkit.org/show_bug.cgi?id=141127

Reviewed by Andreas Kling.

* history/PageCache.cpp:
(WebCore::PageCache::get):

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

6 years agoRemove empty #if/#endif
weinig@apple.com [Sun, 1 Feb 2015 00:38:19 +0000 (00:38 +0000)]
Remove empty #if/#endif

Rubber-stamped by Antti Koivisto.

* platform/graphics/FontPlatformData.h:

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

6 years agoRemove support for disabling drawing of emoji
weinig@apple.com [Sat, 31 Jan 2015 23:52:38 +0000 (23:52 +0000)]
Remove support for disabling drawing of emoji
https://bugs.webkit.org/show_bug.cgi?id=141126

Reviewed by Antti Koivisto.

Remove unused support for disabling the drawing of emoji.

* WebCore.exp.in:
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::emojiDrawingEnabled): Deleted.
(WebCore::GraphicsContext::setEmojiDrawingEnabled): Deleted.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContextState::GraphicsContextState):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):

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

6 years agoRemove even more Mountain Lion support
weinig@apple.com [Sat, 31 Jan 2015 22:55:39 +0000 (22:55 +0000)]
Remove even more Mountain Lion support
https://bugs.webkit.org/show_bug.cgi?id=141124

Reviewed by Alexey Proskuryakov.

Source/bmalloc:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:

Source/JavaScriptCore:

* API/tests/DateTests.mm:
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* jit/ExecutableAllocatorFixedVMPool.cpp:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityActionNames]):
(-[WebAccessibilityObjectWrapper subrole]):
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::drawLayerContents):
* platform/mac/ThemeMac.mm:
(-[WebCoreThemeView _focusRingVisibleRect]):

Source/WebKit/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* Configurations/WebKitLegacy.xcconfig:

Source/WebKit2:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/FeatureDefines.xcconfig:
* Configurations/Version.xcconfig:
* Configurations/WebContentService.Development.xcconfig:
* Configurations/WebContentService.xcconfig:
* Configurations/WebKit.xcconfig:
* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:

Source/WTF:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* wtf/Assertions.cpp:
* wtf/FeatureDefines.h:
* wtf/Platform.h:

Tools:

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::attributedStringRangeIsMisspelled):
* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* DumpRenderTree/mac/DumpRenderTree.mm:
(activateTestingFonts):
(prepareConsistentTestingEnvironment):
* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController mouseScrollByX:andY:withWheel:andMomentumPhases:]):
(-[EventSendingController contextClick]):
* DumpRenderTree/mac/TextInputController.m:
* LayoutTestRelay/Configurations/Base.xcconfig:
* LayoutTestRelay/Configurations/DebugRelease.xcconfig:
* MiniBrowser/Configurations/Base.xcconfig:
* MiniBrowser/Configurations/DebugRelease.xcconfig:
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(-[WK2BrowserWindowController webView:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:]):
(-[WK2BrowserWindowController webView:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:]):
* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/DebugRelease.xcconfig:
* TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
(-[DownloadDelegate _downloadDidFinish:]):
* TestWebKitAPI/Tests/mac/StringTruncator.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/mac/InjectedBundleControllerMac.mm:
(TestWebKitAPI::InjectedBundleController::platformInitialize):
* WebKitLauncher/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
* WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm:
(WTR::activateFonts):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::webProcessName):
* WebKitTestRunner/mac/EventSenderProxy.mm:
* asan/asan.xcconfig:

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

6 years agoEnable WebKit disk cache on OS X
antti@apple.com [Sat, 31 Jan 2015 22:54:17 +0000 (22:54 +0000)]
Enable WebKit disk cache on OS X
https://bugs.webkit.org/show_bug.cgi?id=141022

Reviewed by Gavin Barraclough.

Source/WebKit2:

* config.h: Flip the switch.

LayoutTests:

* TestExpectations: Enable the test for cache functionality.

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

6 years agoUnreviewed, rolling out r179447.
antti@apple.com [Sat, 31 Jan 2015 22:51:19 +0000 (22:51 +0000)]
Unreviewed, rolling out r179447.

Forgot to include the test.

Reverted changeset:

"Enable WebKit disk cache on OS X"
https://bugs.webkit.org/show_bug.cgi?id=141022
http://trac.webkit.org/changeset/179447

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

6 years agoEnable WebKit disk cache on OS X
antti@apple.com [Sat, 31 Jan 2015 22:43:20 +0000 (22:43 +0000)]
Enable WebKit disk cache on OS X
https://bugs.webkit.org/show_bug.cgi?id=141022

Reviewed by Gavin Barraclough.

* config.h: Flip the switch.

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

6 years agoOSObjectPtr does not work with dispatch_data_t on Maverics
antti@apple.com [Sat, 31 Jan 2015 20:43:33 +0000 (20:43 +0000)]
OSObjectPtr does not work with dispatch_data_t on Maverics
https://bugs.webkit.org/show_bug.cgi?id=141081

Reviewed by Zalan Bujtas.

Previous attempt to special case dispatch_data_t in OSObjectPtr didn't work in all cases
probably due to the context sensitivity of the definition of the dispatch_data_t type.

For now, add DispatchPtr for the cache code and use it.

* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::DispatchPtr::DispatchPtr):
(WebKit::DispatchPtr::~DispatchPtr):
(WebKit::DispatchPtr::operator=):
(WebKit::DispatchPtr::get):
(WebKit::DispatchPtr::operator bool):
(WebKit::adoptDispatch):
* NetworkProcess/cache/NetworkCacheStorageCocoa.mm:
(WebKit::NetworkCacheStorage::Data::Data):
(WebKit::NetworkCacheStorage::Data::data):
(WebKit::NetworkCacheStorage::NetworkCacheStorage):
(WebKit::createIOChannelForKey):
(WebKit::decodeEntry):
(WebKit::encodeEntryMetaData):
(WebKit::encodeEntry):

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

6 years agoMerge SimpleFontDataIOS.mm and SimpleFontDataMac.mm into FontCocoa.mm
weinig@apple.com [Sat, 31 Jan 2015 20:42:57 +0000 (20:42 +0000)]
Merge SimpleFontDataIOS.mm and SimpleFontDataMac.mm into FontCocoa.mm
https://bugs.webkit.org/show_bug.cgi?id=141101

Rubber-stamped by Dan Bernstein.

* WebCore.xcodeproj/project.pbxproj:
Remove SimpleFontDataIOS.mm and SimpleFontDataMac.mm. Add FontCocoa.mm.

* platform/graphics/Font.h:
Remove a few CG only functions from the header that can be implemented as static functions
in the implementation file.

* platform/graphics/cocoa/FontCocoa.mm: Copied from Source/WebCore/platform/graphics/mac/SimpleFontDataMac.mm.
(WebCore::fontFamilyShouldNotBeUsedForArabic):
(WebCore::Font::platformInit):
(WebCore::Font::platformCharWidthInit):
(WebCore::Font::platformCreateScaledFont):
(WebCore::Font::determinePitch):
(WebCore::renderingStyle):
(WebCore::advanceForColorBitmapFont):
(WebCore::hasCustomTracking):
(WebCore::canUseFastGlyphAdvanceGetter):
(WebCore::Font::platformWidthForGlyph):
(WebCore::Font::compositeFontReferenceFont):
(WebCore::copyFontTableForTag): Deleted.
(WebCore::Font::renderingStyle): Deleted.
Merge in the iOS specific parts.

* platform/graphics/ios/SimpleFontDataIOS.mm: Removed.
* platform/graphics/mac/SimpleFontDataMac.mm: Removed.

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

6 years agoRegression(r179438) Simple line layout: ASSERTION at SimpleLineLayout::FlowContentsIt...
zalan@apple.com [Sat, 31 Jan 2015 20:30:50 +0000 (20:30 +0000)]
Regression(r179438) Simple line layout: ASSERTION at SimpleLineLayout::FlowContentsIterator::runWidth().
https://bugs.webkit.org/show_bug.cgi?id=141121

Reviewed by Antti Koivisto.

When a breakable text fragment does not fit the current line, we split it.
The first part stays on the current line, while the second part gets pushed to the next line.
In certain cases, the first part could end up being empty.
This patch ensures that we don't measure empty fragments.

Covered by existing tests.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::splitFragmentToFitLine):

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

6 years agoUnreviewed, rolling out r179426.
commit-queue@webkit.org [Sat, 31 Jan 2015 18:28:17 +0000 (18:28 +0000)]
Unreviewed, rolling out r179426.
https://bugs.webkit.org/show_bug.cgi?id=141119

"caused a memory use regression" (Requested by Guest45 on
#webkit).

Reverted changeset:

"Use FastMalloc (bmalloc) instead of BlockAllocator for GC
pages"
https://bugs.webkit.org/show_bug.cgi?id=140900
http://trac.webkit.org/changeset/179426

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

6 years ago[Win] Unreviewed 64-bit build fix.
bfulgham@apple.com [Sat, 31 Jan 2015 18:12:55 +0000 (18:12 +0000)]
[Win] Unreviewed 64-bit build fix.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Correct symbol
definitions for 64-bit build.

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

6 years agoUnreviewed, rolling out r179408.
commit-queue@webkit.org [Sat, 31 Jan 2015 17:43:01 +0000 (17:43 +0000)]
Unreviewed, rolling out r179408.
https://bugs.webkit.org/show_bug.cgi?id=141117

This didn't fully fix the issue (Requested by anttik on
#webkit).

Reverted changeset:

"OSObjectPtr does not work with dispatch_data_t on Maverics"
https://bugs.webkit.org/show_bug.cgi?id=141081
http://trac.webkit.org/changeset/179408

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

6 years agohttps://trac.webkit.org/changeset/179439 breaks a python test
youenn.fablet@crf.canon.fr [Sat, 31 Jan 2015 11:24:04 +0000 (11:24 +0000)]
https://trac.webkit.org/changeset/179439 breaks a python test
https://bugs.webkit.org/show_bug.cgi?id=141114

Unreviewed.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules): Checks whether WPTModules file exists before reading it as no such file exists in mock tests.

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

6 years agoImport W3C web platform tests infrastructure
youenn.fablet@crf.canon.fr [Sat, 31 Jan 2015 09:46:40 +0000 (09:46 +0000)]
Import W3C web platform tests infrastructure
https://bugs.webkit.org/show_bug.cgi?id=140934

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Initial import of the web-platform-tests repository.
This includes all infrastructure folders.
web-platform-tests submodules are downloaded when needed based on resources/WPTModules.

This patch also adds two tests from the domparsing folder to ensure
W3C test infrastructure works properly on WebKit bots.

* resources/WPTModules: Added
* web-platform-tests/.gitignore: Added.
* web-platform-tests/_certs: Added.
* web-platform-tests/common: Added.
* web-platform-tests/config.default.json: Added.
* web-platform-tests/fonts: Added.
* web-platform-tests/images: Added.
* web-platform-tests/resource: Added.
* web-platform-tests/serve.py: Added.
* web-platform-tests/tools: Added.
* web-platform-tests/w3c-import.log: Added
* web-platform-tests/domparsing/DOMParser-parseFromString-html-expected.txt: Added.
* web-platform-tests/domparsing/DOMParser-parseFromString-html.html: Added.
* web-platform-tests/domparsing/insert-adjacent-expected.txt: Added.
* web-platform-tests/domparsing/insert-adjacent.html: Added.
* web-platform-tests/domparsing/w3c-import.log: Added.

Tools:

Loading necessary web platform tests modules before launching server.
Ensuring that some empty __init__.py files are present and create them if necessary.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:

LayoutTests:

* TestExpectations: added lines to skip web-platform-tests
infrastructure folders. Added one line for a partially passing test.

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

6 years agoSimple line layout: Improve FlowContentsIterator::TextFragment's encapsulation.
zalan@apple.com [Sat, 31 Jan 2015 06:26:02 +0000 (06:26 +0000)]
Simple line layout: Improve FlowContentsIterator::TextFragment's encapsulation.
https://bugs.webkit.org/show_bug.cgi?id=141090

Reviewed by Andreas Kling.

Make members private to avoid accidental change in TextFragment.

No change in functionality.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::LineState::addFragment):
(WebCore::SimpleLineLayout::LineState::addWhitespace):
(WebCore::SimpleLineLayout::splitFragmentToFitLine):
(WebCore::SimpleLineLayout::firstFragment):
(WebCore::SimpleLineLayout::createLineRuns):
* rendering/SimpleLineLayoutFlowContentsIterator.cpp:
(WebCore::SimpleLineLayout::FlowContentsIterator::nextTextFragment):
* rendering/SimpleLineLayoutFlowContentsIterator.h:
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::TextFragment):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::start):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::end):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::width):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::type):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isCollapsed):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isBreakable):
(WebCore::SimpleLineLayout::FlowContentsIterator::TextFragment::isEmpty):

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

6 years ago[Win] Another unreviewed test fix.
bfulgham@apple.com [Sat, 31 Jan 2015 05:27:06 +0000 (05:27 +0000)]
[Win] Another unreviewed test fix.

Correct copy/paste error in buildbot handling.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__):
(LayoutTestApacheHttpd._get_apache_config_file_path):

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

6 years ago[Win] Unreviewed test fix.
bfulgham@apple.com [Sat, 31 Jan 2015 04:59:31 +0000 (04:59 +0000)]
[Win] Unreviewed test fix.

Correct path handling based on failures on test bots to get things running again.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__):
(LayoutTestApacheHttpd._get_apache_config_file_path):

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

6 years agoSimple line layout: Make LineState fragment handling simpler.
zalan@apple.com [Sat, 31 Jan 2015 03:37:46 +0000 (03:37 +0000)]
Simple line layout: Make LineState fragment handling simpler.
https://bugs.webkit.org/show_bug.cgi?id=141100

Reviewed by Andreas Kling.

New fragments are appeneded to the Run's last entry
instead of accumulating them until after a new run is required.
(whitespace collapse or line end)
LineState::appendFragment manages whitespace collapsing now.
This makes createLineRuns() logic lighter and no need to "flush"
the LineState when the line ends.

No change in functionality.

* rendering/SimpleLineLayout.cpp: Make LineState members private and introduce getters.
(WebCore::SimpleLineLayout::LineState::setAvailableWidth):
(WebCore::SimpleLineLayout::LineState::setLogicalLeftOffset):
(WebCore::SimpleLineLayout::LineState::setOverflowedFragment):
(WebCore::SimpleLineLayout::LineState::availableWidth):
(WebCore::SimpleLineLayout::LineState::logicalLeftOffset):
(WebCore::SimpleLineLayout::LineState::overflowedFragment):
(WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace):
(WebCore::SimpleLineLayout::LineState::isWhitespaceOnly):
(WebCore::SimpleLineLayout::LineState::fits):
(WebCore::SimpleLineLayout::LineState::firstCharacterFits):
(WebCore::SimpleLineLayout::LineState::width):
(WebCore::SimpleLineLayout::LineState::appendFragment): Append each fragment to the Run
by either creating a new run or expanding the last one.
(WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace): Remove trailing whitespace from
the Run's and reset the trailing whitespace variables.
(WebCore::SimpleLineLayout::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::updateLineConstrains):
(WebCore::SimpleLineLayout::firstFragment):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
(WebCore::SimpleLineLayout::createTextRuns):
(WebCore::SimpleLineLayout::LineState::createRun): Deleted.
(WebCore::SimpleLineLayout::LineState::addFragment): Deleted.
(WebCore::SimpleLineLayout::LineState::addWhitespace): Deleted.
(WebCore::SimpleLineLayout::LineState::hasWhitespaceOnly): Deleted.

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

6 years agoDrop HistoryItem's m_prev / m_next
cdumez@apple.com [Sat, 31 Jan 2015 03:06:11 +0000 (03:06 +0000)]
Drop HistoryItem's m_prev / m_next
https://bugs.webkit.org/show_bug.cgi?id=141105

Reviewed by Zalan Bujtas.

Drop HistoryItem's m_prev / m_next. Those are no longer needed after
the PageCache refactoring in <http://trac.webkit.org/r179347>.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:

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

6 years agoClean up: Remove unnecessary <dispatch/dispatch.h> header from RemoteInspectorDebugga...
commit-queue@webkit.org [Sat, 31 Jan 2015 02:23:28 +0000 (02:23 +0000)]
Clean up: Remove unnecessary <dispatch/dispatch.h> header from RemoteInspectorDebuggableConnection.h
https://bugs.webkit.org/show_bug.cgi?id=141067

Patch by Daniel Bates <dabates@apple.com> on 2015-01-30
Reviewed by Timothy Hatcher.

Remove the header <dispatch/dispatch.h> from RemoteInspectorDebuggableConnection.h as we
do not make use of its functionality. Instead, include this header in RemoteInspectorDebuggableConnection.mm
and RemoteInspector.mm. The latter depended on <dispatch/dispatch.h> being included via
header RemoteInspectorDebuggableConnection.h.

* inspector/remote/RemoteInspector.mm: Include header <dispatch/dispatch.h>.
* inspector/remote/RemoteInspectorDebuggableConnection.h: Remove header <dispatch/dispatch.h>.
* inspector/remote/RemoteInspectorDebuggableConnection.mm: Include header <dispatch/dispatch.h>.

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

6 years agoUpdate the comment in RenderLayer for clarity as related code location is changed
commit-queue@webkit.org [Sat, 31 Jan 2015 02:09:52 +0000 (02:09 +0000)]
Update the comment in RenderLayer for clarity as related code location is changed
https://bugs.webkit.org/show_bug.cgi?id=141103

Patch by Jeongmin Kim <jm86.kim@lge.com> on 2015-01-30
Reviewed by Simon Fraser.

Update the comment in RenderLayer for clarity as related code location is changed
The repainting in implicitClose() that is now called in setVisualUpdatesAllowed(bool) is removed

* rendering/RenderLayer.cpp:
(WebCore::shouldSuppressPaintingLayer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):

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

6 years agoOptimize MemoryCache::getSessionMap() a bit
cdumez@apple.com [Sat, 31 Jan 2015 01:39:28 +0000 (01:39 +0000)]
Optimize MemoryCache::getSessionMap() a bit
https://bugs.webkit.org/show_bug.cgi?id=141069

Reviewed by Anders Carlsson.

Optimize MemoryCache::getSessionMap() a bit by doing 1 HashMap lookup
instead of previously 3. Also rename the method to
ensureSessionResourceMap() as we usually don't use "get" prefix for
getters and the implementation will also create the HashMap value if
the key is not found.

Also add a alternative sessionResourceMap() method which returns
the HashMap value if the key exists but doesn't try to create it if
missing. This is actually what we really want for some call sites.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequest):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::getSessionMap): Deleted.
* loader/cache/MemoryCache.h:

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

6 years agoAdd and hook up APINavigationClient
timothy_horton@apple.com [Sat, 31 Jan 2015 01:28:05 +0000 (01:28 +0000)]
Add and hook up APINavigationClient
https://bugs.webkit.org/show_bug.cgi?id=140698

Reviewed by Sam Weinig.

Add a single APINavigationClient that NavigationState implements and
WebPageProxy prefers over APILoaderClient and APIPolicyClient.

* UIProcess/API/APILoaderClient.h:
Fix a comment.

* UIProcess/API/APINavigationClient.h: Added.
APINavigationClient is the union of NavigationState's overrides of APILoaderClient and APIPolicyClient.
Names are adjusted to more closely match the Modern API.

* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
Instead of having policy and loader clients, NavigationState has a single navigation client.
Adjust as necessary.

Move as much logic as possible (isMainFrame checks, construction of API objects) out of here
and into WebPageProxy.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
Install the aforementioned single navigation client.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setNavigationClient):
Add a navigation client setter.

For all policy and loader client calls, if we have a navigation client, use that;
otherwise, fall back on the policy and loader clients.

* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:

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

6 years agoImplement ES6 Symbol
utatane.tea@gmail.com [Sat, 31 Jan 2015 01:23:56 +0000 (01:23 +0000)]
Implement ES6 Symbol
https://bugs.webkit.org/show_bug.cgi?id=140435

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements ES6 Symbol. In this patch, we don't support
Symbol.keyFor, Symbol.for, Object.getOwnPropertySymbols. They will be
supported in the subsequent patches.

Since ES6 Symbol is introduced as new primitive value, we implement
Symbol as a derived class from JSCell. And now JSValue accepts Symbol*
as a new primitive value.

Symbol has a *unique* flagged StringImpl* as an `uid`. Which pointer
value represents the Symbol's identity. So don't compare Symbol's
JSCell pointer value for comparison.
This enables re-producing Symbol primitive value from StringImpl* uid
by executing`Symbol::create(vm, uid)`. This is needed to produce
Symbol primitive values from stored StringImpl* in `Object.getOwnPropertySymbols`.

And Symbol.[[Description]] is folded into the string value of Symbol's uid.
By doing so, we can represent ES6 Symbol without extending current PropertyTable key; StringImpl*.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.order:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinExecutables.cpp:
(JSC::BuiltinExecutables::createBuiltinExecutable):
* builtins/BuiltinNames.h:
* dfg/DFGOperations.cpp:
(JSC::DFG::operationPutByValInternal):
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
* interpreter/Interpreter.cpp:
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* runtime/CommonIdentifiers.h:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/CommonSlowPaths.h:
(JSC::CommonSlowPaths::opIn):
* runtime/ExceptionHelpers.cpp:
(JSC::createUndefinedVariableError):
* runtime/JSCJSValue.cpp:
(JSC::JSValue::synthesizePrototype):
(JSC::JSValue::dumpInContextAssumingStructure):
(JSC::JSValue::toStringSlowCase):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isSymbol):
(JSC::JSValue::isPrimitive):
(JSC::JSValue::toPropertyKey):

It represents ToPropertyKey abstract operation in the ES6 spec.
It cleans up the old implementation's `isName` checks.
And to prevent performance regressions in
    js/regress/fold-get-by-id-to-multi-get-by-offset-rare-int.html
    js/regress/fold-get-by-id-to-multi-get-by-offset.html
we annnotate this function as ALWAYS_INLINE.

(JSC::JSValue::getPropertySlot):
(JSC::JSValue::get):
(JSC::JSValue::equalSlowCaseInline):
(JSC::JSValue::strictEqualSlowCaseInline):
* runtime/JSCell.cpp:
(JSC::JSCell::put):
(JSC::JSCell::putByIndex):
(JSC::JSCell::toPrimitive):
(JSC::JSCell::getPrimitiveNumber):
(JSC::JSCell::toNumber):
(JSC::JSCell::toObject):
* runtime/JSCell.h:
* runtime/JSCellInlines.h:
(JSC::JSCell::isSymbol):
(JSC::JSCell::toBoolean):
(JSC::JSCell::pureToBoolean):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::symbolPrototype):
(JSC::JSGlobalObject::symbolObjectStructure):
* runtime/JSONObject.cpp:
(JSC::Stringifier::Stringifier):
* runtime/JSSymbolTableObject.cpp:
(JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
* runtime/JSType.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::isName): Deleted.
* runtime/MapData.cpp:
(JSC::MapData::find):
(JSC::MapData::add):
(JSC::MapData::remove):
(JSC::MapData::replaceAndPackBackingStore):
* runtime/MapData.h:
(JSC::MapData::clear):
* runtime/NameInstance.h: Removed.
* runtime/NamePrototype.cpp: Removed.
* runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyDescriptor):
(JSC::objectConstructorDefineProperty):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
* runtime/Operations.cpp:
(JSC::jsTypeStringForValue):
(JSC::jsIsObjectType):
* runtime/PrivateName.h:
(JSC::PrivateName::PrivateName):
(JSC::PrivateName::operator==):
(JSC::PrivateName::operator!=):
* runtime/PropertyMapHashTable.h:
(JSC::PropertyTable::find):
(JSC::PropertyTable::get):
* runtime/PropertyName.h:
(JSC::PropertyName::PropertyName):
(JSC::PropertyName::publicName):
* runtime/SmallStrings.h:
* runtime/StringConstructor.cpp:
(JSC::callStringConstructor):

In ES6, String constructor accepts Symbol to execute `String(symbol)`.

* runtime/Structure.cpp:
(JSC::Structure::getPropertyNamesFromStructure):
* runtime/StructureInlines.h:
(JSC::Structure::prototypeForLookup):
* runtime/Symbol.cpp: Added.
(JSC::Symbol::Symbol):
(JSC::SymbolObject::create):
(JSC::Symbol::toPrimitive):
(JSC::Symbol::toBoolean):
(JSC::Symbol::getPrimitiveNumber):
(JSC::Symbol::toObject):
(JSC::Symbol::toNumber):
(JSC::Symbol::destroy):
(JSC::Symbol::descriptiveString):
* runtime/Symbol.h: Added.
(JSC::Symbol::createStructure):
(JSC::Symbol::create):
(JSC::Symbol::privateName):
(JSC::Symbol::finishCreation):
(JSC::asSymbol):
* runtime/SymbolConstructor.cpp: Renamed from Source/JavaScriptCore/runtime/NameConstructor.cpp.
(JSC::SymbolConstructor::SymbolConstructor):
(JSC::SymbolConstructor::finishCreation):
(JSC::callSymbol):
(JSC::SymbolConstructor::getConstructData):
(JSC::SymbolConstructor::getCallData):
* runtime/SymbolConstructor.h: Renamed from Source/JavaScriptCore/runtime/NameConstructor.h.
(JSC::SymbolConstructor::create):
(JSC::SymbolConstructor::createStructure):
* runtime/SymbolObject.cpp: Renamed from Source/JavaScriptCore/runtime/NameInstance.cpp.
(JSC::SymbolObject::SymbolObject):
(JSC::SymbolObject::finishCreation):
(JSC::SymbolObject::defaultValue):

Now JSC doesn't support @@toPrimitive. So instead of it, we implement
Symbol.prototype[@@toPrimitive] as ES5 Symbol.[[DefaultValue]].

* runtime/SymbolObject.h: Added.
(JSC::SymbolObject::create):
(JSC::SymbolObject::internalValue):
(JSC::SymbolObject::createStructure):
* runtime/SymbolPrototype.cpp: Added.
(JSC::SymbolPrototype::SymbolPrototype):
(JSC::SymbolPrototype::finishCreation):
(JSC::SymbolPrototype::getOwnPropertySlot):
(JSC::symbolProtoFuncToString):
(JSC::symbolProtoFuncValueOf):
* runtime/SymbolPrototype.h: Renamed from Source/JavaScriptCore/runtime/NamePrototype.h.
(JSC::SymbolPrototype::create):
(JSC::SymbolPrototype::createStructure):

SymbolPrototype object is ordinary JS object. Not wrapper object of Symbol.
It is tested in js/symbol-prototype-is-ordinary-object.html.

* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

Source/WTF:

Introduce new unique string mechanizm into StringImpl.
It is used for implementing Symbol which holds a [[Description]] value.

* wtf/text/AtomicString.h:
(WTF::AtomicString::add):
(WTF::AtomicString::addWithStringTableProvider):

Previously, we checked `isAtomic()` or `!length()`. This guard can filter out EmptyUnique.
But now, we introduced new unique StringImpl. Since it has an actual string value, we need to check `isUnique()`.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
(WTF::StringImpl::createUnique):

In createUnique, we leverage Substring mechanizm to produce a new unique
string from an existing string.

* wtf/text/StringImpl.h:
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::createUniqueEmpty):
(WTF::StringImpl::flagIsUnique):
(WTF::StringImpl::isUnique):
(WTF::StringImpl::setIsAtomic):
(WTF::StringImpl::createEmptyUnique): Deleted.
(WTF::StringImpl::isEmptyUnique): Deleted.

Instead of EmptyUnique, we introduced new flag to StringImpl, `isUnique`.
While EmptyUnique cannot hold any string values except for empty string,
the unique StringImpl can hold any String values.
We fold the Symbol's descriptiveString value here.

* wtf/text/StringStatics.cpp:
(WTF::StringImpl::hashAndFlagsForUnique):
(WTF::StringImpl::hashAndFlagsForEmptyUnique): Deleted.

LayoutTests:

* js/script-tests/symbol-abstract-equality-comparison.js: Added.
(Pair):
(relationalOperators.forEach):
* js/script-tests/symbol-abstract-relational-comparison.js: Added.
(relationalOperators.forEach):
* js/script-tests/symbol-in-map.js: Added.
(set shouldBe):
* js/script-tests/symbol-object.js: Added.
* js/script-tests/symbol-prototype-is-ordinary-object.js: Added.
* js/script-tests/symbol-strict-equality-comparison.js: Added.
(Pair):
(relationalOperators.forEach):
* js/script-tests/symbol-tostring.js: Added.
* js/script-tests/symbols.js: Renamed from LayoutTests/js/script-tests/names.js.
(forIn):
* js/symbol-abstract-equality-comparison-expected.txt: Added.
* js/symbol-abstract-equality-comparison.html: Copied from LayoutTests/js/names.html.
* js/symbol-abstract-relational-comparison-expected.txt: Added.
* js/symbol-abstract-relational-comparison.html: Copied from LayoutTests/js/names.html.
* js/symbol-in-map-expected.txt: Added.
* js/symbol-in-map.html: Copied from LayoutTests/js/names.html.
* js/symbol-object-expected.txt: Added.
* js/symbol-object.html: Copied from LayoutTests/js/names.html.
* js/symbol-prototype-is-ordinary-object-expected.txt: Added.
* js/symbol-prototype-is-ordinary-object.html: Copied from LayoutTests/js/names.html.
* js/symbol-strict-equality-comparison-expected.txt: Added.
* js/symbol-strict-equality-comparison.html: Copied from LayoutTests/js/names.html.
* js/symbol-tostring-expected.txt: Added.
* js/symbol-tostring.html: Copied from LayoutTests/js/names.html.
* js/symbols-expected.txt: Renamed from LayoutTests/js/names-expected.txt.
* js/symbols.html: Renamed from LayoutTests/js/names.html.

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

6 years agoUnreviewed. Remove outdated comment.
cdumez@apple.com [Sat, 31 Jan 2015 01:22:54 +0000 (01:22 +0000)]
Unreviewed. Remove outdated comment.

* loader/cache/MemoryCache.cpp:

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

6 years agoRemove MediaPlayerProxy.h
eric.carlson@apple.com [Sat, 31 Jan 2015 00:58:01 +0000 (00:58 +0000)]
Remove MediaPlayerProxy.h
https://bugs.webkit.org/show_bug.cgi?id=141087

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj: Remove reference to MediaPlayerProxy.h.
* platform/graphics/mac/MediaPlayerProxy.h: Removed.

Source/WebKit/mac:

* MigrateHeaders.make: Don't need to copy MediaPlayerProxy.h.
* Plugins/WebPluginController.mm: Don't include MediaPlayerProxy.h.

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

6 years agoUse FastMalloc (bmalloc) instead of BlockAllocator for GC pages
ggaren@apple.com [Sat, 31 Jan 2015 00:51:05 +0000 (00:51 +0000)]
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
https://bugs.webkit.org/show_bug.cgi?id=140900

Reviewed by Mark Hahnenberg.

Re-landing just the HandleBlock piece of this patch.

Source/JavaScriptCore:

* heap/HandleBlock.h:
* heap/HandleBlockInlines.h:
(JSC::HandleBlock::create):
(JSC::HandleBlock::destroy):
(JSC::HandleBlock::HandleBlock):
(JSC::HandleBlock::payloadEnd):
* heap/HandleSet.cpp:
(JSC::HandleSet::~HandleSet):
(JSC::HandleSet::grow):

Source/WebCore:

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::install):

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::fastAlignedMalloc):
(WTF::fastAlignedFree):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
* wtf/FastMalloc.h:

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

6 years ago[EFL] Gardening: update some accessibility tests as failed
commit-queue@webkit.org [Sat, 31 Jan 2015 00:40:21 +0000 (00:40 +0000)]
[EFL] Gardening: update some accessibility tests as failed
https://bugs.webkit.org/show_bug.cgi?id=141034

Unreviewed EFL gardening.

Patch by Dariusz Frankiewicz <d.frankiewic@samsung.com> on 2015-01-30

* platform/efl/TestExpectations:
* platform/efl/accessibility/roles-exposed-expected.txt:
update expectation after bumping ATK to 2.15.2

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

6 years agoCall vsnprintf instead of _vsnprintf in vprintf_stderr_common
commit-queue@webkit.org [Sat, 31 Jan 2015 00:39:40 +0000 (00:39 +0000)]
Call vsnprintf instead of _vsnprintf in vprintf_stderr_common
https://bugs.webkit.org/show_bug.cgi?id=141078

In windows _vsnprintf api does not place null character
automatically. Simply replace it with vsnprintf. Which is
polyfill to call wtf_vsnprintf in windows.

Patch by Namhoon Kim <yanhkim@gmail.com> on 2015-01-30
Reviewed by Brent Fulgham.

* wtf/Assertions.cpp:

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

6 years ago[EFL] Mark test css3/masking/mask-repeat-space-padding.html as passing
commit-queue@webkit.org [Sat, 31 Jan 2015 00:37:17 +0000 (00:37 +0000)]
[EFL] Mark test css3/masking/mask-repeat-space-padding.html as passing
https://bugs.webkit.org/show_bug.cgi?id=141077

Unreviewed EFL gardening.

Patch by Piotr Pajak <p.pajak@samsung.com> on 2015-01-30

* platform/efl/TestExpectations:

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

6 years agoGC marking threads should clear malloc caches
ggaren@apple.com [Sat, 31 Jan 2015 00:29:22 +0000 (00:29 +0000)]
GC marking threads should clear malloc caches
https://bugs.webkit.org/show_bug.cgi?id=141097

Reviewed by Sam Weinig.

Follow-up based on Mark Hahnenberg's review: Release after the copy
phase, rather than after any phase, since we'd rather not release
between marking and copying.

* heap/GCThread.cpp:
(JSC::GCThread::waitForNextPhase):
(JSC::GCThread::gcThreadMain):

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

6 years agoUpdate MemoryCache code to use more references instead of pointers
cdumez@apple.com [Sat, 31 Jan 2015 00:04:36 +0000 (00:04 +0000)]
Update MemoryCache code to use more references instead of pointers
https://bugs.webkit.org/show_bug.cgi?id=141099

Reviewed by Andreas Kling.
Source/WebKit2:

* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::clearCacheForOrigin):

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

6 years agoWeb Inspector: ASSERT in InspectorTimelineAgent::internalStop
burg@cs.washington.edu [Fri, 30 Jan 2015 23:56:58 +0000 (23:56 +0000)]
Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
https://bugs.webkit.org/show_bug.cgi?id=141039

Reviewed by Timothy Hatcher.

Source/WebCore:

Don't unconditionally stop the environment stopwatch, since it could have
already stopped due to the debugger pausing.

* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::internalStop):

Source/WTF:

Add messages to Stopwatch assertions, and clean up constructor.

* wtf/Stopwatch.h:
(WTF::Stopwatch::Stopwatch):
(WTF::Stopwatch::start):
(WTF::Stopwatch::stop):

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

6 years agoRemote Web Inspector should not show undock toolbar buttons
commit-queue@webkit.org [Fri, 30 Jan 2015 23:56:45 +0000 (23:56 +0000)]
Remote Web Inspector should not show undock toolbar buttons
https://bugs.webkit.org/show_bug.cgi?id=141061

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-01-30
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Be sure to update the toolbar's dock navigation icons because they
may need to be hidden (the default state).

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

6 years ago[EFL] Rebaseline efl/js/dom/global-constructors-attributes-expected.txt
commit-queue@webkit.org [Fri, 30 Jan 2015 23:55:45 +0000 (23:55 +0000)]
[EFL] Rebaseline efl/js/dom/global-constructors-attributes-expected.txt
https://bugs.webkit.org/show_bug.cgi?id=141029

Unreviewed EFL gardening

Patch by Karol Pawlowski <k.pawlowski@samsung.com> on 2015-01-30

* platform/efl/js/dom/global-constructors-attributes-expected.txt:

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

6 years agoAdd match_constness<Reference, T> helper struct
cdumez@apple.com [Fri, 30 Jan 2015 23:32:01 +0000 (23:32 +0000)]
Add match_constness<Reference, T> helper struct
https://bugs.webkit.org/show_bug.cgi?id=140905

Reviewed by Benjamin Poulain.

Add match_constness<Reference, T> helper struct to simplify downcast<>()
a bit. The purpose of this helper is to update T's constness to match
Reference's.

* wtf/TypeCasts.h:
(WTF::downcast):

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

6 years agoAdd assertion in RefPtr's operator*() to make sure we don't dereference nullptr
cdumez@apple.com [Fri, 30 Jan 2015 23:25:55 +0000 (23:25 +0000)]
Add assertion in RefPtr's operator*() to make sure we don't dereference nullptr
https://bugs.webkit.org/show_bug.cgi?id=141092

Reviewed by Anders Carlsson.

Add assertion in RefPtr's operator*() to make sure we don't dereference
nullptr.

* wtf/RefPtr.h:
(WTF::RefPtr::operator*):

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

6 years agoUnreviewed. Fix Windows build after r179409.
cdumez@apple.com [Fri, 30 Jan 2015 23:13:31 +0000 (23:13 +0000)]
Unreviewed. Fix Windows build after r179409.

* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::notifyDone):
(TestRunner::queueLoad):

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

6 years agoWhen no background-size is specified on the 2nd background layer, it takes the first...
cdumez@apple.com [Fri, 30 Jan 2015 22:54:34 +0000 (22:54 +0000)]
When no background-size is specified on the 2nd background layer, it takes the first instead of the initial value
https://bugs.webkit.org/show_bug.cgi?id=141059

Reviewed by Antti Koivisto.

Source/WebCore:

This patch fixes fill size support for 'initial' value.

Test: fast/css/background-layers-initial-size.html

* css/CSSToStyleMap.cpp:
- Add check for initial values and set fill size to initialFillSize()
  in this case (which is 'auto'). Previously, we were handling all
  non CSSPrimitiveValues the same way and setting the fill size type
  to SizeNone, which means no size (not 'auto').
- Clean up the rest of the function (no behavior change).

* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
- Initialize m_sizeLength to SizeNone instead of calling
  initialFillSizeType(). There is no behavior change here. However,
  initialFillSizeType() was not supposed to return SizeNone.
- Stop explicitly initializing m_sizeLength to LengthSize() as this
  is already what happens implicitly.

* rendering/style/FillLayer.h:
(WebCore::FillLayer::initialFillSize):
Return FillSize() instead of FillSize(SizeNone, LengthSize()).
FillSize() is equivalent to FillSize(SizeLength, LengthSize())
which is resolved to 'auto'. SizeNone means no size which isn't
what we want as an initial value.

(WebCore::FillLayer::initialFillSizeType): Deleted.
(WebCore::FillLayer::initialFillSizeLength): Deleted.
Remove Individual initialFillSizeType() / initialFillSizeLength()
functions now that all caller use initialFillSize() instead.

LayoutTests:

Add layout test to cover the case where we have 2 background layers, with an explicit
size only for the first one.

* fast/css/background-layers-initial-size-expected.txt: Added.
* fast/css/background-layers-initial-size.html: Added.

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

6 years agoGC marking threads should clear malloc caches
ggaren@apple.com [Fri, 30 Jan 2015 22:27:56 +0000 (22:27 +0000)]
GC marking threads should clear malloc caches
https://bugs.webkit.org/show_bug.cgi?id=141097

Reviewed by Andreas Kling.

Split the scavenging API into per-thread vs global, so that you can
request to scavenge your own thread without scavenging the whole heap.

Source/bmalloc:

* bmalloc/Cache.cpp:
(bmalloc::Cache::scavenge):
* bmalloc/bmalloc.h:
(bmalloc::api::scavengeThisThread):
(bmalloc::api::scavenge):

Source/WTF:

* wtf/FastMalloc.cpp:
(WTF::releaseFastMallocFreeMemoryForThisThread):
(WTF::TCMalloc_ThreadCache::CreateCacheIfNecessary):
* wtf/FastMalloc.h:

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

6 years agoGC marking threads should clear malloc caches
ggaren@apple.com [Fri, 30 Jan 2015 22:22:57 +0000 (22:22 +0000)]
GC marking threads should clear malloc caches
https://bugs.webkit.org/show_bug.cgi?id=141097

Reviewed by Andreas Kling.

This is an attempt to ameliorate a potential memory use regression
caused by https://bugs.webkit.org/show_bug.cgi?id=140900
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages.

FastMalloc may accumulate a per-thread cache on each of the 8-ish
GC marking threads, which can be expensive.

* heap/GCThread.cpp:
(JSC::GCThread::waitForNextPhase): Scavenge the current thread before
going to sleep. There's probably not too much value to keeping our
per-thread cache between GCs, and it has some memory footprint.

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

6 years agoUnreviewed, rolling out r179403.
cdumez@apple.com [Fri, 30 Jan 2015 22:00:22 +0000 (22:00 +0000)]
Unreviewed, rolling out r179403.
https://bugs.webkit.org/show_bug.cgi?id=141091

Broke fast/files/workers/worker-apply-blob-url-to-xhr.html
(Requested by ap_ on #webkit).

Reverted changeset:

"Optimize MemoryCache::getSessionMap() a bit"
https://bugs.webkit.org/show_bug.cgi?id=141069
http://trac.webkit.org/changeset/179403

Patch by Commit Queue <commit-queue@webkit.org> on 2015-01-30

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

6 years agoRename shared() static member functions to singleton() for singleton classes.
cdumez@apple.com [Fri, 30 Jan 2015 20:49:33 +0000 (20:49 +0000)]
Rename shared() static member functions to singleton() for singleton classes.
https://bugs.webkit.org/show_bug.cgi?id=141088

Reviewed by Ryosuke Niwa and Benjamin Poulain.

Rename shared() static member functions to singleton() for singleton
classes as per the recent coding style change.
Source/JavaScriptCore:

* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::singleton):
(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::shared): Deleted.
* inspector/remote/RemoteInspectorDebuggable.cpp:
(Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::init):
(Inspector::RemoteInspectorDebuggable::update):
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectorDebuggable::pauseWaitingForAutomaticInspection):
(Inspector::RemoteInspectorDebuggable::unpauseForInitializedInspector):
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorDebuggableConnection::setup):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):

Source/WebKit:

* Storage/WebDatabaseProvider.cpp:
(WebDatabaseProvider::singleton):
(WebDatabaseProvider::shared): Deleted.
* Storage/WebDatabaseProvider.h:

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

6 years agoOSObjectPtr does not work with dispatch_data_t on Maverics
antti@apple.com [Fri, 30 Jan 2015 20:46:00 +0000 (20:46 +0000)]
OSObjectPtr does not work with dispatch_data_t on Maverics
https://bugs.webkit.org/show_bug.cgi?id=141081

Reviewed by Pratik Solanki.
Source/WTF:

Trying to use OSObjectPtr<dispatch_data_t> throws

-[OS_dispatch_data _xref_dispose]: unrecognized selector sent to instance 0

* wtf/OSObjectPtr.h:
(WTF::retainOSObject<dispatch_data_t>):
(WTF::releaseOSObject<dispatch_data_t>):

    Add specialization for dispatch_data_t on Maverics.

Tools:

* TestWebKitAPI/Tests/WTF/darwin/OSObjectPtr.cpp:
(TestWebKitAPI::TEST):

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

6 years agoUse FastMalloc (bmalloc) instead of BlockAllocator for GC pages
ggaren@apple.com [Fri, 30 Jan 2015 19:57:35 +0000 (19:57 +0000)]
Use FastMalloc (bmalloc) instead of BlockAllocator for GC pages
https://bugs.webkit.org/show_bug.cgi?id=140900

Reviewed by NOBODY (OOPS!).

Re-landing just the CopyWorkListSegment piece of this patch.

* heap/CopiedBlockInlines.h:
(JSC::CopiedBlock::reportLiveBytes):
* heap/CopyWorkList.h:
(JSC::CopyWorkListSegment::create):
(JSC::CopyWorkListSegment::destroy):
(JSC::CopyWorkListSegment::CopyWorkListSegment):
(JSC::CopyWorkList::CopyWorkList):
(JSC::CopyWorkList::~CopyWorkList):
(JSC::CopyWorkList::append):

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

6 years agoSource/WebCore:
mmirman@apple.com [Fri, 30 Jan 2015 19:09:14 +0000 (19:09 +0000)]
Source/WebCore:
Added ClientRect as an interface that requires attributes
on instance for compatibility.
https://bugs.webkit.org/show_bug.cgi?id=141063
<rdar://problem/18437653>

Reviewed by Oliver Hunt.

Added a new test to LayoutTests/js/resources/JSON-stringify.js

* bindings/scripts/CodeGeneratorJS.pm:
(InterfaceRequiresAttributesOnInstanceForCompatibility):

LayoutTests:
Added a test for JSON.stringify on ClientRect.
https://bugs.webkit.org/show_bug.cgi?id=141063
<rdar://problem/18437653>

Reviewed by Oliver Hunt.

* js/resources/JSON-stringify.js:
(createTests.var):
(createTests.result):
* js/resources/JSON-stringify-expected.txt:

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