Move the setting up of callee's callFrame from pushFrame to callToJavaScript thunk
https://bugs.webkit.org/show_bug.cgi?id=123999

Reviewed by Filip Pizlo.

Changed LLInt and/or JIT enabled ports to allocate the stack frame in the
callToJavaScript stub.  Added an additional stub, callToNativeFunction that
allocates a stack frame in a similar way for calling native entry points
that take a single ExecState* argument.  These stubs are implemented
using common macros in LowLevelInterpreter{32_64,64}.asm.  There are also
Windows X86 and X86-64 versions in the corresponding JitStubsXX.h.
The stubs allocate and create a sentinel frame, then create the callee's
frame, populating  the header and arguments from the passed in ProtoCallFrame*.
It is assumed that the caller of either stub does a check for enough stack space
via JSStack::entryCheck().

For ports using the C-Loop interpreter, the prior method for allocating stack
frame and invoking functions is used, namely with JSStack::pushFrame() and
::popFrame().

Made spelling changes "sentinal" -> "sentinel".

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/CachedCall.h:
(JSC::CachedCall::CachedCall):
(JSC::CachedCall::setThis):
(JSC::CachedCall::setArgument):
* interpreter/CallFrameClosure.h:
(JSC::CallFrameClosure::resetCallFrame):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
* interpreter/Interpreter.h:
* interpreter/JSStack.h:
* interpreter/JSStackInlines.h:
(JSC::JSStack::entryCheck):
(JSC::JSStack::pushFrame):
(JSC::JSStack::popFrame):
* interpreter/ProtoCallFrame.cpp: Added.
(JSC::ProtoCallFrame::init):
* interpreter/ProtoCallFrame.h: Added.
(JSC::ProtoCallFrame::codeBlock):
(JSC::ProtoCallFrame::setCodeBlock):
(JSC::ProtoCallFrame::setScope):
(JSC::ProtoCallFrame::setCallee):
(JSC::ProtoCallFrame::argumentCountIncludingThis):
(JSC::ProtoCallFrame::argumentCount):
(JSC::ProtoCallFrame::setArgumentCountIncludingThis):
(JSC::ProtoCallFrame::setPaddedArgsCount):
(JSC::ProtoCallFrame::clearCurrentVPC):
(JSC::ProtoCallFrame::setThisValue):
(JSC::ProtoCallFrame::setArgument):
* jit/JITCode.cpp:
(JSC::JITCode::execute):
* jit/JITCode.h:
* jit/JITOperations.cpp:
* jit/JITStubs.h:
* jit/JITStubsMSVC64.asm:
* jit/JITStubsX86.h:
* llint/LLIntOffsetsExtractor.cpp:
* llint/LLIntThunks.h:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/ArgList.h:
(JSC::ArgList::data):
* runtime/JSArray.cpp:
(JSC::AVLTreeAbstractorForArrayCompare::compare_key_key):
* runtime/StringPrototype.cpp:
(JSC::replaceUsingRegExpSearch):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160094 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening. Updated expectations for GTK and share them with EFL.

* accessibility/multiselect-list-reports-active-option-expected.txt: Renamed from LayoutTests/platform/efl/multiselect-list-reports-active-option-expected.txt.
* platform/gtk/accessibility/multiselect-list-reports-active-option-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160095 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[texmap] Borders on rotating images are hidden/wrongly rendered with edge distance antialiasing
https://bugs.webkit.org/show_bug.cgi?id=124653

Patch by José Dapena Paz <jdapena@igalia.com> on 2013-12-04
Reviewed by Noam Rosenthal.

Texture mapper edge distance antialiasing texture sampling was causing
borders to be shaded (and made them almost disappear in some cases).
This was because calculation of sampling happened on vertex shader, so
the border of the texture would go to the border of the inflation area.

What algorithm should do is sampling the border pixel for all the
inflation area (it is the closest pixel to all the samples in
inflation area), and then use the standard sampling for the other
parts of the texture.

No new test because this is already covered by test
transforms/3d/point-mapping/3d-point-mapping.html

* platform/graphics/texmap/TextureMapperShaderProgram.cpp: fix edge
distance antialiasing texture sampling.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use All-iOS target when building WK2 on iOS
<rdar://problem/15574494>

Reviewed by David Kilzer.

* Makefile:
Add -target All-iOS to OTHER_OPTIONS if iphoneos or iphonesimulator
is in the SDKROOT make option.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Add missing folders and files to Xcode project
https://bugs.webkit.org/show_bug.cgi?id=124802

Reviewed by Timothy Hatcher.

* WebCore.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Push Remote Inspector debugging connection management into JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=124613

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Move the ENABLE(REMOTE_INSPECTOR) remote debugger connection management
into JavaScriptCore (originally from WebKit/mac). Include enhancements:

  * allow for different types of remote debuggable targets,
    eventually at least a JSContext, WebView, WKView.
  * allow debuggables to be registered and debugged on any thread. Unlike
    WebViews, JSContexts may be run entirely off of the main thread.
  * move the remote connection (XPC connection) itself off of the main thread,
    it doesn't need to be on the main thread.

Make JSContext @class and JavaScriptCore::JSContextRef
"JavaScript" Remote Debuggables.

* inspector/remote/RemoteInspectorDebuggable.h: Added.
* inspector/remote/RemoteInspectorDebuggable.cpp: Added.
(Inspector::RemoteInspectorDebuggable::RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::~RemoteInspectorDebuggable):
(Inspector::RemoteInspectorDebuggable::init):
(Inspector::RemoteInspectorDebuggable::update):
(Inspector::RemoteInspectorDebuggable::setRemoteDebuggingAllowed):
(Inspector::RemoteInspectorDebuggable::info):
RemoteInspectorDebuggable defines a debuggable target. As long as
something creates a debuggable and is set to allow remote inspection
it will be listed in remote debuggers. For the different types of
debuggables (JavaScript and Web) there is different basic information
that may be listed.

* inspector/InspectorFrontendChannel.h: Added.
(Inspector::InspectorFrontendChannel::~InspectorFrontendChannel):
The only thing a debuggable needs for remote debugging is an
InspectorFrontendChannel a way to send messages to a remote frontend.
This class provides that method, and is vended to the
RemoteInspectorDebuggable when a remote connection is setup.

* inspector/remote/RemoteInspector.h: Added.
* inspector/remote/RemoteInspector.mm: Added.
Singleton, created at least when the first Debuggable is created.
This class manages the list of debuggables, any connection to a
remote debugger proxy (XPC service "com.apple.webinspector").

(Inspector::dispatchAsyncOnQueueSafeForAnyDebuggable):
(Inspector::RemoteInspector::shared):
(Inspector::RemoteInspector::RemoteInspector):
(Inspector::RemoteInspector::nextAvailableIdentifier):
(Inspector::RemoteInspector::registerDebuggable):
(Inspector::RemoteInspector::unregisterDebuggable):
(Inspector::RemoteInspector::updateDebuggable):
Debuggable management. When debuggables are added, removed, or updated
we stash a copy of the debuggable information and push an update to
debuggers. Stashing a copy of the information in the RemoteInspector
is a thread safe way to avoid walking over all debuggables to gather
the information when it is needed.

(Inspector::RemoteInspector::start):
(Inspector::RemoteInspector::stop):
Runtime API to enable / disable the feature.

(Inspector::RemoteInspector::listingForDebuggable):
(Inspector::RemoteInspector::pushListingNow):
(Inspector::RemoteInspector::pushListingSoon):
Pushing a listing to remote debuggers.

(Inspector::RemoteInspector::sendMessageToRemoteFrontend):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::xpcConnectionReceivedMessage):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::xpcConnectionUnhandledMessage):
XPC setup, send, and receive handling.

(Inspector::RemoteInspector::updateHasActiveDebugSession):
Applications being debugged may want to know when a debug
session is active. This provides that notification.

(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedDidCloseMessage):
(Inspector::RemoteInspector::receivedGetListingMessage):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedConnectionDiedMessage):
Dispatching incoming remote debugging protocol messages.
These are wrapping above the inspector protocol messages.

* inspector/remote/RemoteInspectorConstants.h: Added.
Protocol messages and dictionary keys inside the messages.

(Inspector::RemoteInspectorDebuggableInfo::RemoteInspectorDebuggableInfo):
* inspector/remote/RemoteInspectorDebuggableConnection.h: Added.
* inspector/remote/RemoteInspectorDebuggableConnection.mm: Added.
This is a connection between the RemoteInspector singleton and a RemoteInspectorDebuggable.

(Inspector::RemoteInspectorDebuggableConnection::RemoteInspectorDebuggableConnection):
(Inspector::RemoteInspectorDebuggableConnection::~RemoteInspectorDebuggableConnection):
Allow for dispatching messages on JavaScript debuggables on a dispatch_queue
instead of the main queue.

(Inspector::RemoteInspectorDebuggableConnection::destination):
(Inspector::RemoteInspectorDebuggableConnection::connectionIdentifier):
Needed in the remote debugging protocol to identify the remote debugger.

(Inspector::RemoteInspectorDebuggableConnection::dispatchSyncOnDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::dispatchAsyncOnDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::setup):
(Inspector::RemoteInspectorDebuggableConnection::closeFromDebuggable):
(Inspector::RemoteInspectorDebuggableConnection::close):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToBackend):
(Inspector::RemoteInspectorDebuggableConnection::sendMessageToFrontend):
The connection is a thin channel between the two sides that can be closed
from either side, so there is some logic around multi-threaded access.

* inspector/remote/RemoteInspectorXPCConnection.h: Added.
(Inspector::RemoteInspectorXPCConnection::Client::~Client):
* inspector/remote/RemoteInspectorXPCConnection.mm: Added.
(Inspector::RemoteInspectorXPCConnection::RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::~RemoteInspectorXPCConnection):
(Inspector::RemoteInspectorXPCConnection::close):
(Inspector::RemoteInspectorXPCConnection::deserializeMessage):
(Inspector::RemoteInspectorXPCConnection::handleEvent):
(Inspector::RemoteInspectorXPCConnection::sendMessage):
This is a connection between the RemoteInspector singleton and an XPC service
named "com.apple.webinspector". This handles serialization of the dictionary
messages to and from the service. The receiving is done on a non-main queue.

* API/JSContext.h:
* API/JSContext.mm:
(-[JSContext name]):
(-[JSContext setName:]):
ObjC API to enable/disable JSContext remote inspection and give a name.

* API/JSContextRef.h:
* API/JSContextRef.cpp:
(JSGlobalContextGetName):
(JSGlobalContextSetName):
C API to give a JSContext a name.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::setName):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::name):
Shared handling of the APIs above.

* runtime/JSGlobalObjectDebuggable.cpp: Added.
(JSC::JSGlobalObjectDebuggable::JSGlobalObjectDebuggable):
(JSC::JSGlobalObjectDebuggable::name):
(JSC::JSGlobalObjectDebuggable::connect):
(JSC::JSGlobalObjectDebuggable::disconnect):
(JSC::JSGlobalObjectDebuggable::dispatchMessageFromRemoteFrontend):
* runtime/JSGlobalObjectDebuggable.h: Added.
Stub for the actual remote debugging implementation. We will push
down the appropriate WebCore/inspector peices suitable for debugging
just a JavaScript context.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* GNUmakefile.am:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
Update build files.

Source/WebCore:

Make a WebCore::Page a "Web" Remote Debuggable.

* bindings/js/JSDOMGlobalObject.cpp:
Disable JavaScript context inspection on JSGlobalObjects inside WebCore::Page's.

* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::remoteInspectionAllowed):
(WebCore::Page::setRemoteInspectionAllowed):
(WebCore::Page::remoteInspectorInformationDidChange):
* page/Page.h:
* page/PageDebuggable.h:
* page/PageDebuggable.cpp: Added.
(WebCore::PageDebuggable::PageDebuggable):
(WebCore::PageDebuggable::name):
(WebCore::PageDebuggable::url):
(WebCore::PageDebuggable::hasLocalDebugger):
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
(WebCore::PageDebuggable::dispatchMessageFromRemoteFrontend):
(WebCore::PageDebuggable::setIndicating):
Make a page a "Web" debuggable.

* GNUmakefile.list.am:
* WebCore.exp.in:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Misc.

* inspector/InspectorClient.h:
(WebCore::InspectorClient::indicate):
(WebCore::InspectorClient::hideIndicate):
Forward indicate methods to WebKit clients.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didChangeTitle):
(WebCore::FrameLoader::dispatchDidCommitLoad):
Push updates when remote debuggable information like the Page's
URL or title change.

* ForwardingHeaders/inspector/InspectorFrontendChannel.h:
* inspector/InspectorForwarding.h:
Re-export Inspector::InspectorFrontendChannel as WebCore::InspectorFrontendChannel
to avoid needlessly updating code all over the place.

* inspector/CodeGeneratorInspectorStrings.py:
* inspector/InspectorWorkerAgent.cpp:
* inspector/WorkerInspectorController.cpp:
* testing/Internals.cpp:
Update include names.

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::populate):
Make the "Inspect Element" context menu work correctly when there is a
remote inspector instead of a local inspector.

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit/blackberry:

* WebCoreSupport/InspectorClientBlackBerry.h:

Source/WebKit/cf:

* WebCoreSupport/WebInspectorClientCF.cpp:
(WebInspectorClient::sendMessageToFrontend):

Source/WebKit/efl:

* WebCoreSupport/InspectorClientEfl.h:

Source/WebKit/gtk:

* WebCoreSupport/InspectorClientGtk.h:

Source/WebKit/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorClient::WebInspectorClient):
(WebInspectorClient::inspectorDestroyed):

Source/WebKit/mac:

Remove the old ENABLE(REMOTE_INSPECTOR) connection management implementation.

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::indicate):
(WebInspectorClient::hideIndicate):
Hook up WebView indication through this new path.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidReceiveTitle):
* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorClient::WebInspectorClient):
(WebInspectorClient::inspectorDestroyed):
* WebInspector/remote/WebInspectorClientRegistry.h: Removed.
* WebInspector/remote/WebInspectorClientRegistry.mm: Removed.
* WebInspector/remote/WebInspectorRelayDefinitions.h: Removed.
* WebInspector/remote/WebInspectorRemoteChannel.h: Removed.
* WebInspector/remote/WebInspectorRemoteChannel.mm: Removed.
* WebInspector/remote/WebInspectorServer.h: Removed.
* WebInspector/remote/WebInspectorServer.mm: Removed.
* WebInspector/remote/WebInspectorServerWebViewConnection.h: Removed.
* WebInspector/remote/WebInspectorServerWebViewConnection.mm: Removed.
* WebInspector/remote/WebInspectorServerWebViewConnectionController.h: Removed.
* WebInspector/remote/WebInspectorServerWebViewConnectionController.mm: Removed.
* WebInspector/remote/WebInspectorXPCWrapper.h: Removed.
* WebInspector/remote/WebInspectorXPCWrapper.m: Removed.
* WebKit.exp:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(+[WebView _enableRemoteInspector]):
(+[WebView _disableRemoteInspector]):
(+[WebView _disableAutoStartRemoteInspector]):
(+[WebView _isRemoteInspectorEnabled]):
(+[WebView _hasRemoteInspectorSession]):
(-[WebView allowsRemoteInspection]):
(-[WebView setAllowsRemoteInspection:]):
(-[WebView setIndicatingForRemoteInspector:]):
(-[WebView setHostApplicationBundleId:name:]):
(-[WebView _didCommitLoadForFrame:]):
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate init]):
(-[WebViewPrivate dealloc]):
* WebView/WebViewInternal.h:
* WebView/WebViewPrivate.h:
Remove old REMOTE_INSPECTOR.

Source/WebKit/win:

* WebCoreSupport/WebInspectorClient.h:

Source/WebKit/wince:

* WebCoreSupport/InspectorClientWinCE.h:

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
* WebProcess/com.apple.WebProcess.sb.in:
Allow the WebProcess to access the "com.apple.webinspector" named
XPC service to expose its WebCore::Page's to remote debuggers.

Source/WTF:

* wtf/ios/WebCoreThread.cpp:
* wtf/ios/WebCoreThread.h:
Expose WebThreadRun/WebThreadRunSync iOS methods defined in WebCore through
WTF so that JavaScriptCore can use it. Another such method already existed.

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