OSR exit profiling should be robust against all code being cleared
https://bugs.webkit.org/show_bug.cgi?id=123629
<rdar://problem/15365476>

Reviewed by Michael Saboff.
        
The problem here is two-fold:

1) A watchpoint (i.e. ProfiledCodeBlockJettisoningWatchpoint) may be fired after we
have cleared the CodeBlock for all or some Executables.  This means that doing
codeBlock->baselineVersion() would either crash or return a bogus CodeBlock, since
there wasn't a baseline code block reachable from the Executable anymore.  The
solution is that we shouldn't be asking for the baseline code block reachable from
the owning executable (what baselineVersion did), but instead we should be asking
for the baseline version reachable from the code block being watchpointed (basically
what CodeBlock::alternative() did).

2) If dealing with inlined code, baselienCodeBlockForOriginAndBaselineCodeBlock()
may return null, for the same reason as above - we might have cleared the baseline
codeblock for the executable that was inlined.  The solution is to just not do
profiling if there isn't a baseline code block anymore.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::baselineAlternative):
(JSC::CodeBlock::baselineVersion):
(JSC::CodeBlock::jettison):
* bytecode/CodeBlock.h:
* bytecode/CodeBlockJettisoningWatchpoint.cpp:
(JSC::CodeBlockJettisoningWatchpoint::fireInternal):
* bytecode/ProfiledCodeBlockJettisoningWatchpoint.cpp:
(JSC::ProfiledCodeBlockJettisoningWatchpoint::fireInternal):
* dfg/DFGOSRExitBase.cpp:
(JSC::DFG::OSRExitBase::considerAddingAsFrequentExitSiteSlow):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::AssemblyHelpers):
* runtime/Executable.cpp:
(JSC::FunctionExecutable::baselineCodeBlockFor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] WKObject seems to be initializing its target in a thread-safe manner, but really is not
https://bugs.webkit.org/show_bug.cgi?id=123640

Reviewed by Darin Adler.

* Shared/Cocoa/WKObject.mm:
(initializeTargetIfNeeded): Removed misleading incorrect code.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Kill RenderArena.
<https://webkit.org/b/123634>

There are no remaining users of the RenderArena allocator.

Reviewed by Geoffrey Garen.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remote Layer Tree: Move RemoteLayerBackingStore to Shared/
https://bugs.webkit.org/show_bug.cgi?id=123646

Reviewed by Darin Adler.

Move RemoteLayerBackingStore to Shared/, since it is
used on both the UI and Web process side of things.

* Shared/mac/RemoteLayerBackingStore.h: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.h.
* Shared/mac/RemoteLayerBackingStore.mm: Renamed from Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerBackingStore.mm.
* WebKit2.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS 'initial' and 'inherit' value constructors should return PassRef.
<https://webkit.org/b/123641>

Make the helpers involved in constructing CSS{Initial,Inherited}Value
all return PassRef instead of PassRefPtr. This avoids generating
pointless null checks at the call sites.

Reviewed by Darin Adler.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Fix typo in simple-polygon.js LayoutTest helper
https://bugs.webkit.org/show_bug.cgi?id=123595

Reviewed by Darin Adler.

* fast/shapes/resources/simple-polygon.js:
(generatePolygonContentString): Fixed a typo: the lineHeight parameter generatePolygonContentString() is now lineHeight.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Initial implementation of text-decoration-skip ink
https://bugs.webkit.org/show_bug.cgi?id=121806

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-11-01
Reviewed by Darin Adler.

Source/WebCore:

text-decoration-skip: ink is implemented by the following steps:
1. Before drawing any decorations, figure out the bounding box for the decorations that will be drawn
2. Create an ImageBuffer with these dimensions
3. Draw text into this ImageBuffer with a thicker stroke
4. Apply the ImageBuffer as a mask to the context
5. Draw decorations like normal
6. Clean up

Test: fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink.html

* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::computeLineBoundsAndAntialiasingModeForText): Don't call GraphicsContext::roundToDevicePixels
when painting is disabled
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Pass the TextPainter to paintDecoration
(WebCore::computeUnderlineOffset): Small cleanup
(WebCore::getWavyStrokeControlPointDistance): Pulling out of strokeWavyTextDecoration()
(WebCore::getWavyStrokeStep): Ditto
(WebCore::strokeWavyTextDecoration): Use the previous 2 functions
(WebCore::getSingleDecorationBoundingBox): Pulling out repeated code into a function
(WebCore::getDecorationBoundingBox): Compute the bounding box for an underline which
hasn't been drawn yet
(WebCore::InlineTextBox::paintDecoration): Construct a mask and apply it to the GraphicsContext
* rendering/InlineTextBox.h: paintDecoration needs the TextPainter
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline): Redraw the underline when
text-decoration-skip changes

LayoutTests:

Adding a test which draws a very large "p" with text-decoration-skip:ink. The
viewport is restricted to be just hugging the place where an underline would
intersect the descender of the "p". This should look the same as if there was
no underline at all (because of the skipping underline).

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink-expected.html: Added.
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-ink.html: Added.

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