Stop using String::deprecatedCharacters to call WTF::Collator
https://bugs.webkit.org/show_bug.cgi?id=128517

Source/JavaScriptCore:

Reviewed by Alexey Proskuryakov.

* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncLocaleCompare): Use the default constructor for Collator, which now
gives the default locale collation rules. Use the new arguments for Collator::collate, which
are now StringView. These two changes together eliminate the need for a separate helper function.

Source/WebCore:

Reviewed by Alexey Proskuryakov.

* xml/XSLTUnicodeSort.cpp:
(WebCore::xsltUnicodeSortFunction): Create the collator in a single line using the
new constructor that takes a shouldSortLowercaseFirst boolean. Use the new
collateUTF8 function instead of upconverting UTF-8 strings to UTF-16 as the old code did.

Source/WTF:

WTF passes ICU’s deprecated ULOC_REQUESTED_LOCALE to ucol_getLocaleByType()
rdar://problem/15183390

Reviewed by Alexey Proskuryakov.

This patch fixes both bugs above by reworking WTF::Collator.

* wtf/unicode/Collator.h: Fixed formatting. Got rid of the Collator::Result type,
since the collator uses the same return value scheme as strcmp and as ICU; an int
will do for the return type. Simplified the support for UCONFIG_NO_COLLATION by
using a separate copy of the class definition. (We should check if anyone needs
UCONFIG_NO_COLLATION support, and remove it if not.) Changed the lower-first flag
from a separate function to a constructor argument. Changed the arguments to
the collate function to StringView. Added a collate UTF8 function. Changed the
m_collate data member to no longer be mutable since we no longer allocate it lazily.

* wtf/unicode/CollatorDefault.cpp:
(WTF::Collator::collate): Rewrote to be simpler.
(WTF::Collator::collateUTF8): Added. Converts from UTF-8 to a String and then calls
the collate function above.

* wtf/unicode/icu/CollatorICU.cpp: Added a FIXME about the fact that this file
has the wrong name and location. Since we always use ICU, there's no need to mention
it in the file name.
(WTF::copyASCIIString): Added.
(WTF::copyDefaultLocale): Added.
(WTF::resolveDefaultLocale): Added. Maps null locale to a default on Mac and iOS,
since on those platforms ICU does not use the correct default locale when passed null.
(WTF::localesMatch): Added.
(WTF::Collator::Collator): Moved most of the code from createCollator here.
Simplified it by storing the collator configuration along with the collator in globals.
(WTF::Collator::~Collator): Moved most of the code from releaseCollator here.
(WTF::getIndexLatin1): Added.
(WTF::moveLatin1): Added.
(WTF::hasNextLatin1): Added.
(WTF::hasPreviousLatin1): Added.
(WTF::currentLatin1): Added.
(WTF::nextLatin1): Added.
(WTF::previousLatin1): Added.
(WTF::getStateLatin1): Added.
(WTF::setStateLatin1): Added.
(WTF::createLatin1Iterator): Added. Uses the functions above to make a UCharIterator
that works for a WTF::StringView-style Latin-1 string.
(WTF::createIterator): Added. Uses either createLatin1Iterator or uiter_setString to
make a UCharIterator that works for a WTF::StringView.
(WTF::Collator::collate): Changed to use ucol_strcollIter.
(WTF::createIteratorUTF8): Added. Uses uiter_setUTF8.
(WTF::Collator::collateUTF8): Added. Like collate, but for null-terminated UTF-8 strings.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Automatically generate isRendererOfType in RENDER_OBJECT_TYPE_CASTS
https://bugs.webkit.org/show_bug.cgi?id=128520

Reviewed by Andreas Kling.

* rendering/RenderObject.h: Updated the RENDER_OBJECT_TYPE_CASTS macro so
that it generates isRendererOfType specializations as well as type casts
and also have the type casts use the isRendererOfType function. The macro
also now uses an argument name of "renderer" and allows for a predicate
that is more than just a single function call (see RenderTextFragment.h).

* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.h:
* rendering/RenderCounter.h:
* rendering/RenderElement.h:
* rendering/RenderFrameSet.h:
* rendering/RenderLayerModelObject.h:
* rendering/RenderMenuList.h:
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTableSection.h:
* rendering/RenderText.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLToken.h:
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.h:
Removed specialization of isRendererOfType, since the RENDER_OBJECT_TYPE_CASTS
macro handles that now. Also removed some unneeded semicolons.

* rendering/RenderTextFragment.h: Use RENDER_OBJECT_TYPE_CASTS instead of
hand written casts, now that it can handle a non-trivial predicate.

* rendering/RenderCombineText.h:
* rendering/RenderDetailsMarker.h:
* rendering/RenderListMarker.h:
* rendering/RenderVideo.h:
* rendering/RenderView.h:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
Removed unneeded semicolons.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSC environment variables should override other mechanisms for setting options
https://bugs.webkit.org/show_bug.cgi?id=128511

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

* runtime/Options.cpp:
(JSC::Options::setOption):
* runtime/Options.h:

Source/WebKit2:

* WebProcess/mac/WebProcessMac.mm:
(WebKit::WebProcess::platformInitializeWebProcess):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163794 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[iOS][wk2] WebKit2 View Gestures (Swipe): Forward swipe gesture
https://bugs.webkit.org/show_bug.cgi?id=128523
<rdar://problem/16020378>

Reviewed by Darin Adler.

We can't install the gesture recognizer on a view that's going to be
reparented during the swipe, because the gesture will be cancelled.
Install the recognizer on the WKView and move the WKView's scrollview
child around instead.

* UIProcess/API/ios/WKViewIOS.mm:
(-[WKView setAllowsBackForwardNavigationGestures:]):
We'll install the gesture recognizer on the WKView, but swipe the scrollview.

* UIProcess/ios/ViewGestureControllerIOS.mm:
(-[WKSwipeTransitionController initWithViewGestureController:gestureRecognizerView:]):
Clarify that WKSwipeTransitionController gets handed only the view to install the gesture recognizer on.
(-[WKSwipeTransitionController gestureRecognizerForInteractiveTransition:WithTarget:action:]):
Use public enum values so we can get rid of one private header.

(WebKit::ViewGestureController::installSwipeHandler):
Separate out the gesture recognizer view from the one that gets swiped.

(WebKit::ViewGestureController::beginSwipeGesture):
Record a snapshot before beginning the swipe. This is important for the back-then-forward
swipe case, and matches the behavior of the Mac implementation.

(WebKit::ViewGestureController::endSwipeGesture):
* UIProcess/mac/ViewGestureController.h:
Slight geometry adjustments due to the change in targetted view.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163795 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove extra includes from DFG
https://bugs.webkit.org/show_bug.cgi?id=126983

Patch by Peter Molnar <pmolnar.u-szeged@partner.samsung.com> on 2014-02-10
Reviewed by Andreas Kling.

* dfg/DFGAbstractInterpreter.h:
* dfg/DFGAbstractValue.h:
* dfg/DFGAdjacencyList.h:
* dfg/DFGArgumentPosition.h:
* dfg/DFGArgumentsSimplificationPhase.cpp:
* dfg/DFGArrayMode.cpp:
* dfg/DFGArrayifySlowPathGenerator.h:
* dfg/DFGAtTailAbstractState.h:
* dfg/DFGAvailability.h:
* dfg/DFGBackwardsPropagationPhase.cpp:
* dfg/DFGBasicBlock.h:
* dfg/DFGBasicBlockInlines.h:
* dfg/DFGByteCodeParser.cpp:
* dfg/DFGCFAPhase.cpp:
* dfg/DFGCFGSimplificationPhase.cpp:
* dfg/DFGCPSRethreadingPhase.cpp:
* dfg/DFGCSEPhase.cpp:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
* dfg/DFGCapabilities.cpp:
* dfg/DFGCapabilities.h:
* dfg/DFGClobberize.h:
* dfg/DFGCommonData.cpp:
* dfg/DFGConstantFoldingPhase.cpp:
* dfg/DFGCriticalEdgeBreakingPhase.cpp:
* dfg/DFGDCEPhase.cpp:
* dfg/DFGDominators.h:
* dfg/DFGDriver.cpp:
* dfg/DFGDriver.h:
* dfg/DFGFixupPhase.cpp:
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGenerationInfo.h:
* dfg/DFGGraph.cpp:
* dfg/DFGGraph.h:
* dfg/DFGInPlaceAbstractState.cpp:
* dfg/DFGInPlaceAbstractState.h:
* dfg/DFGInlineCacheWrapperInlines.h:
* dfg/DFGInvalidationPointInjectionPhase.cpp:
* dfg/DFGJITCode.h:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGJITCompiler.h:
* dfg/DFGJITFinalizer.cpp:
* dfg/DFGJITFinalizer.h:
* dfg/DFGLICMPhase.cpp:
* dfg/DFGLivenessAnalysisPhase.cpp:
* dfg/DFGLoopPreHeaderCreationPhase.cpp:
* dfg/DFGMinifiedNode.h:
* dfg/DFGNaturalLoops.h:
* dfg/DFGNode.cpp:
* dfg/DFGNode.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
* dfg/DFGOSREntry.cpp:
* dfg/DFGOSREntrypointCreationPhase.cpp:
* dfg/DFGOSRExit.cpp:
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitBase.cpp:
* dfg/DFGOSRExitCompilationInfo.h:
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler32_64.cpp:
* dfg/DFGOSRExitCompiler64.cpp:
* dfg/DFGOSRExitJumpPlaceholder.cpp:
* dfg/DFGOperations.cpp:
* dfg/DFGPhase.h:
* dfg/DFGPlan.h:
* dfg/DFGPredictionInjectionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGResurrectionForValidationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
* dfg/DFGSSALoweringPhase.cpp:
* dfg/DFGSaneStringGetByValSlowPathGenerator.h:
* dfg/DFGSlowPathGenerator.h:
* dfg/DFGSpeculativeJIT.cpp:
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
* dfg/DFGSpeculativeJIT64.cpp:
* dfg/DFGStackLayoutPhase.cpp:
* dfg/DFGStoreBarrierElisionPhase.cpp:
* dfg/DFGStrengthReductionPhase.cpp:
* dfg/DFGThunks.cpp:
* dfg/DFGTierUpCheckInjectionPhase.cpp:
* dfg/DFGTypeCheckHoistingPhase.cpp:
* dfg/DFGUnificationPhase.cpp:
* dfg/DFGValidate.h:
* dfg/DFGValueSource.h:
* dfg/DFGVariableAccessData.h:
* dfg/DFGVariableAccessDataDump.cpp:
* dfg/DFGVariableEvent.h:
* dfg/DFGVariableEventStream.h:
* dfg/DFGVirtualRegisterAllocationPhase.cpp:
* dfg/DFGWatchpointCollectionPhase.cpp:
* dfg/DFGWorklist.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163796 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GLIB] Add GUniqueOutPtr and use it instead of GOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=127554

Reviewed by Gustavo Noronha Silva.

Source/WebCore:

Use GUniqueOutPtr instead of GOwnPtr.

* GNUmakefile.list.am:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
(WebCore::AudioDestinationGStreamer::handleMessage):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::handleMessage):
* platform/glib/BatteryProviderUPower.cpp:
(BatteryProviderUPower::startUpdating):
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
(WebCore::TrackPrivateBaseGStreamer::getTag):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage):
(WebCore::ImageBuffer::toDataURL):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::loadResourceSharedBuffer):
* platform/gtk/DataObjectGtk.cpp:
(WebCore::DataObjectGtk::setURIList):
* platform/gtk/FileSystemGtk.cpp:
(WebCore::readFromFile):
* platform/gtk/GamepadsGtk.cpp:
(WebCore::GamepadDeviceGtk::readCallback):
* platform/gtk/GtkInputMethodFilter.cpp:
(WebCore::GtkInputMethodFilter::handlePreeditChanged):
* platform/gtk/PasteboardHelper.cpp:
(WebCore::PasteboardHelper::fillDataObjectFromDropData):
* platform/gtk/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::systemFont):
* platform/gtk/SharedBufferGtk.cpp:
(WebCore::SharedBuffer::createWithContentsOfFile):
* platform/network/gtk/CredentialBackingStore.cpp:
(WebCore::credentialForChallengeAsyncReadyCallback):
* platform/network/soup/GOwnPtrSoup.cpp: Removed.
* platform/network/soup/GOwnPtrSoup.h: Removed.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::redirectSkipCallback):
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::addFileToSoupMessageBody):
(WebCore::createSoupRequestAndMessageForHandle):
(WebCore::readCallback):
* platform/network/soup/SocketStreamHandleSoup.cpp:
(WebCore::SocketStreamHandle::platformSend):
(WebCore::SocketStreamHandle::platformClose):
(WebCore::connectedCallback):
(WebCore::readReadyCallback):
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::httpProxy):

Source/WebKit/gtk:

Use GUniqueOutPtr instead of GOwnPtr.

* WebCoreSupport/FrameLoaderClientGtk.cpp:
(WebKit::FrameLoaderClient::dispatchDidFailLoad):
* WebCoreSupport/TextCheckerClientGtk.cpp:
* webkit/webkitdownload.cpp:
(webkit_download_open_stream_for_uri):
(webkit_download_set_destination_uri):
(webkit_download_received_data):
* webkit/webkitwebplugin.cpp:
(webkit_web_plugin_get_path):
* webkit/webkitwebview.cpp:
(webkit_web_view_expose_event):

Source/WebKit2:

Use GUniqueOutPtr instead of GOwnPtr.

* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::getCacheDiskFreeSize):
* Shared/Downloads/soup/DownloadSoup.cpp:
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didFinishLoading):
* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(processPendingIconsForPageURL):
(webkit_favicon_database_get_favicon):
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestReadCallback):
* UIProcess/API/gtk/WebKitWebView.cpp:
(gotFaviconCallback):
* UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
(WebKit::WebInspectorServer::platformResourceForPath):
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::scanPlugin):
* WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::getCacheDiskFreeSize):

Source/WTF:

GUniqueOutPtr is a simplified version of GOwnPtr for the cases
where we need the address of the contained pointer. GUniqueOutPtr
uses GUniquePtr to free the contained object and to release the
container pointer. The API is very simple to make sure this is
only used when outPtr() is needed. It can't be constructed with a
pointer, and there's not method to set a new pointer. Another
difference with the old GOwnPtr is that outPtr() can be used
multiple times, because it frees any pointer previously set.

* GNUmakefile.list.am:
* wtf/PlatformEfl.cmake:
* wtf/PlatformGTK.cmake:
* wtf/gobject/GOwnPtr.cpp: Removed.
* wtf/gobject/GOwnPtr.h: Removed.
* wtf/gobject/GUniquePtr.h:
(WTF::GUniqueOutPtr::GUniqueOutPtr):
(WTF::GUniqueOutPtr::~GUniqueOutPtr):
(WTF::GUniqueOutPtr::outPtr):
(WTF::GUniqueOutPtr::reset):
(WTF::GUniqueOutPtr::release):
(WTF::GUniqueOutPtr::operator*):
(WTF::GUniqueOutPtr::operator->):
(WTF::GUniqueOutPtr::get):
(WTF::GUniqueOutPtr::operator!):
(WTF::GUniqueOutPtr::operator UnspecifiedBoolType):

Tools:

Use GUniqueOutPtr instead of GOwnPtr.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
* DumpRenderTree/gtk/EventSender.cpp:
(createKeyPressEvent):
* TestWebKitAPI/Tests/WTF/gobject/GUniquePtr.cpp:
(TestWebKitAPI::returnOutChar):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit2Gtk/TestCookieManager.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestInspectorServer.cpp:
(testInspectorServerPageList):
(openRemoteDebuggingSession):
(sendIncompleteRequest):
* TestWebKitAPI/Tests/WebKit2Gtk/TestResources.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebExtensions.cpp:
(testWebExtensionWindowObjectCleared):
(testWebExtensionIsolatedWorld):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitFaviconDatabase.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewRunJavaScript):
(testWebViewSave):
(testWebViewPageVisibility):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebViewGroup.cpp:
(isStyleSheetInjectedForURLAtPath):
* TestWebKitAPI/Tests/WebKit2Gtk/TestWebViewEditor.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/WebExtensionTest.cpp:
* TestWebKitAPI/Tests/WebKit2Gtk/WebProcessTest.cpp:
* TestWebKitAPI/Tests/gtk/InputMethodFilter.cpp:
(TestWebKitAPI::TestInputMethodFilter::sendKeyEventToFilter):
* TestWebKitAPI/gtk/PlatformWebViewGtk.cpp:
(TestWebKitAPI::doKeyStroke):
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
* TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp:
(WebKitTestBus::run):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(resourceGetDataCallback):
(WebViewTest::keyStroke):
(onSnapshotReady):
* WebKitTestRunner/gtk/EventSenderProxyGtk.cpp:
(WTR::EventSenderProxy::keyDown):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163797 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r163660-r163664): js/dom/stack-trace.html fails
https://bugs.webkit.org/show_bug.cgi?id=128544

* TestExpectations: Marked as such (possibly passing on other platforms?)



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163798 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Create the inspector view using the same web process as the inspected page
https://bugs.webkit.org/show_bug.cgi?id=128539

Reviewed by Martin Robinson.

* UIProcess/API/C/gtk/WKView.cpp:
(WKViewCreate): Pass nullptr as the related page.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseCreate): Add related page argument and pass it
to webkitWebViewBaseCreateWebPage() instead of nullptr.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformCreateInspectorPage): Pass
m_page as related page to webkitWebViewBaseCreate().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163799 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add API for accessing session ephemerality from a page bundle
https://bugs.webkit.org/show_bug.cgi?id=128410

Patch by Martin Hock <mhock@apple.com> on 2014-02-10
Reviewed by Alexey Proskuryakov.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageIsUsingEphemeralSession):
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::isUsingEphemeralSession):
* WebProcess/WebPage/WebPage.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Add test expectations for crashing tests.

* platform/efl-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163801 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, roll out http://trac.webkit.org/changeset/163796

The change was not justified in any way and it has a net negative effect on the code.

* dfg/DFGAbstractInterpreter.h:
* dfg/DFGAbstractValue.h:
* dfg/DFGAdjacencyList.h:
* dfg/DFGArgumentPosition.h:
* dfg/DFGArgumentsSimplificationPhase.cpp:
* dfg/DFGArrayMode.cpp:
* dfg/DFGArrayifySlowPathGenerator.h:
* dfg/DFGAtTailAbstractState.h:
* dfg/DFGAvailability.h:
* dfg/DFGBackwardsPropagationPhase.cpp:
* dfg/DFGBasicBlock.h:
* dfg/DFGBasicBlockInlines.h:
* dfg/DFGByteCodeParser.cpp:
* dfg/DFGCFAPhase.cpp:
* dfg/DFGCFGSimplificationPhase.cpp:
* dfg/DFGCPSRethreadingPhase.cpp:
* dfg/DFGCSEPhase.cpp:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
* dfg/DFGCapabilities.cpp:
* dfg/DFGCapabilities.h:
* dfg/DFGClobberize.h:
* dfg/DFGCommonData.cpp:
* dfg/DFGConstantFoldingPhase.cpp:
* dfg/DFGCriticalEdgeBreakingPhase.cpp:
* dfg/DFGDCEPhase.cpp:
* dfg/DFGDominators.h:
* dfg/DFGDriver.cpp:
* dfg/DFGDriver.h:
* dfg/DFGFixupPhase.cpp:
* dfg/DFGFlushLivenessAnalysisPhase.cpp:
* dfg/DFGGenerationInfo.h:
* dfg/DFGGraph.cpp:
* dfg/DFGGraph.h:
* dfg/DFGInPlaceAbstractState.cpp:
* dfg/DFGInPlaceAbstractState.h:
* dfg/DFGInlineCacheWrapperInlines.h:
* dfg/DFGInvalidationPointInjectionPhase.cpp:
* dfg/DFGJITCode.h:
* dfg/DFGJITCompiler.cpp:
* dfg/DFGJITCompiler.h:
* dfg/DFGJITFinalizer.cpp:
* dfg/DFGJITFinalizer.h:
* dfg/DFGLICMPhase.cpp:
* dfg/DFGLivenessAnalysisPhase.cpp:
* dfg/DFGLoopPreHeaderCreationPhase.cpp:
* dfg/DFGMinifiedNode.h:
* dfg/DFGNaturalLoops.h:
* dfg/DFGNode.cpp:
* dfg/DFGNode.h:
* dfg/DFGOSRAvailabilityAnalysisPhase.cpp:
* dfg/DFGOSREntry.cpp:
* dfg/DFGOSREntrypointCreationPhase.cpp:
* dfg/DFGOSRExit.cpp:
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitBase.cpp:
* dfg/DFGOSRExitCompilationInfo.h:
* dfg/DFGOSRExitCompiler.cpp:
* dfg/DFGOSRExitCompiler32_64.cpp:
* dfg/DFGOSRExitCompiler64.cpp:
* dfg/DFGOSRExitJumpPlaceholder.cpp:
* dfg/DFGOperations.cpp:
* dfg/DFGPhase.h:
* dfg/DFGPlan.h:
* dfg/DFGPredictionInjectionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGResurrectionForValidationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
* dfg/DFGSSALoweringPhase.cpp:
* dfg/DFGSaneStringGetByValSlowPathGenerator.h:
* dfg/DFGSlowPathGenerator.h:
* dfg/DFGSpeculativeJIT.cpp:
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
* dfg/DFGSpeculativeJIT64.cpp:
* dfg/DFGStackLayoutPhase.cpp:
* dfg/DFGStoreBarrierElisionPhase.cpp:
* dfg/DFGStrengthReductionPhase.cpp:
* dfg/DFGThunks.cpp:
* dfg/DFGTierUpCheckInjectionPhase.cpp:
* dfg/DFGTypeCheckHoistingPhase.cpp:
* dfg/DFGUnificationPhase.cpp:
* dfg/DFGValidate.h:
* dfg/DFGValueSource.h:
* dfg/DFGVariableAccessData.h:
* dfg/DFGVariableAccessDataDump.cpp:
* dfg/DFGVariableEvent.h:
* dfg/DFGVariableEventStream.h:
* dfg/DFGVirtualRegisterAllocationPhase.cpp:
* dfg/DFGWatchpointCollectionPhase.cpp:
* dfg/DFGWorklist.cpp:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unbreak ChangeLog after r163802

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163803 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary spinLock in JSLock.
<https://webkit.org/b/128450>

Reviewed by Filip Pizlo.

The JSLock's mutex already provides protection for write access to
JSLock's internal state. The only JSLock state that needs to be read
from any thread including threads that don't own the JSLock is
m_ownerThread, which is used in currentThreadIsHoldingLock() to do an
ownership test on the lock.

It is safe for other threads to read from m_ownerThread because they
only need to know whether its value matches their own thread id
(provided by WTF::currentThread()).

Here are the scenarios for how the ownership test can go:

1. The JSLock has just been initialized and is not owned by any thread.

   In this case, m_ownerThread will be 0 and will not match any thread's
   thread id. The checking thread will know that it needs to lock the
   JSLock before using the VM.

2. The JSLock was previously locked, but now is unlocked.

   When we unlock it in JSLock::unlock(), the owner thread clears
   m_ownerThread to 0. Hence, this case is the same as (1) above.

3. The JSLock is locked by Thread A. Thread B is checking ownership.

   In this case, m_ownerThread will contains the Thread A's thread id.
   Thread B will see that the thread id does not match its own and will
   proceed to block on the JSLock's mutex to wait for its turn to use
   the VM.

   With Weak Memory Ordering architectures, Thread A's thread id may
   not get written out to memory before Thread B inspects m_ownerThread.
   However, though Thread B may not see Thread A's thread id in
   m_ownerThread, it will see 0 which is the last value written to it
   before the JSLock mutex was unlocked. The mutex unlock would have
   executed a memory fence which would have flushed the 0 to
   m_ownerThread in memory. Hence, Thread B will know that it does not
   own the lock.

Apart from removing the unneeded spin lock code, I also changed the
JSLock code to use currentThreadIsHoldingLock() and setOwnerThread()
instead of accessing m_ownerThread directly.

* runtime/JSLock.cpp:
(JSC::JSLock::JSLock):

(JSC::JSLock::lock):
- Removed spinLock but left the indentation as is to keep the diff to a
  minimum for better readability. Will unindent in a subsequent patch.

(JSC::JSLock::unlock):
- Before unlocking the mutex, clear m_ownerThread to indicate that the
  lock is no longer owned.

(JSC::JSLock::currentThreadIsHoldingLock):
- Removed the check of m_lockCount for determining ownership. Checking
  m_ownerThread is sufficient.

(JSC::JSLock::dropAllLocks):
(JSC::JSLock::dropAllLocksUnconditionally):
- Renamed local locksToDrop to the better name droppedLockCount.
- Clear m_ownerThread since we're unlocking the JSLock.

(JSC::JSLock::grabAllLocks):
- Removed unneeded lock ownership test for lock re-entry case because
  grabAllLocks() is never used to re-enter a locked JSLock.

(JSC::JSLock::DropAllLocks::DropAllLocks):
(JSC::JSLock::DropAllLocks::~DropAllLocks):

* runtime/JSLock.h:
(JSC::JSLock::setOwnerThread):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163804 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip indexeddb tests for now until somebody can explore 128341.
https://bugs.webkit.org/show_bug.cgi?id=128341

* platform/mac-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Handling of opaque roots is wrong in EdenCollections
https://bugs.webkit.org/show_bug.cgi?id=128210

Reviewed by Geoffrey Garen.

Forgot to svn add the regression tests for this bug.

* js/generational-opaque-roots-expected.txt: Added.
* js/script-tests/generational-opaque-roots.js: Added.


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