Move the image controls setting to Settings.in
https://bugs.webkit.org/show_bug.cgi?id=129126

Reviewed by Tim Horton.

* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
* page/Settings.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164458 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG should do its own static estimates of execution frequency before it starts creating OSR entrypoints
https://bugs.webkit.org/show_bug.cgi?id=129129

Reviewed by Geoffrey Garen.
        
We estimate execution counts based on loop depth, and then use those to estimate branch
weights. These weights then get carried all the way down to LLVM prof branch_weights
meta-data.
        
This is better than letting LLVM do its own static estimates, since by the time we
generate LLVM IR, we may have messed up the CFG due to OSR entrypoint creation. Of
course, it would be even better if we just slurped in some kind of execution counts
from profiling, but we don't do that, yet.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGBasicBlock.cpp:
(JSC::DFG::BasicBlock::BasicBlock):
* dfg/DFGBasicBlock.h:
* dfg/DFGBlockInsertionSet.cpp:
(JSC::DFG::BlockInsertionSet::insert):
(JSC::DFG::BlockInsertionSet::insertBefore):
* dfg/DFGBlockInsertionSet.h:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleInlining):
(JSC::DFG::ByteCodeParser::parseCodeBlock):
* dfg/DFGCriticalEdgeBreakingPhase.cpp:
(JSC::DFG::CriticalEdgeBreakingPhase::breakCriticalEdge):
* dfg/DFGLoopPreHeaderCreationPhase.cpp:
(JSC::DFG::createPreHeader):
* dfg/DFGNaturalLoops.h:
(JSC::DFG::NaturalLoops::loopDepth):
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::compileInThreadImpl):
* dfg/DFGStaticExecutionCountEstimationPhase.cpp: Added.
(JSC::DFG::StaticExecutionCountEstimationPhase::StaticExecutionCountEstimationPhase):
(JSC::DFG::StaticExecutionCountEstimationPhase::run):
(JSC::DFG::StaticExecutionCountEstimationPhase::applyCounts):
(JSC::DFG::performStaticExecutionCountEstimation):
* dfg/DFGStaticExecutionCountEstimationPhase.h: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164459 268f45cc-cd09-0410-ab3c-d52691b4dbfc
We need something like WKPageUIClient in the Obj-C API
https://bugs.webkit.org/show_bug.cgi?id=129123
<rdar://problem/15338439>

Reviewed by Sam Weinig.

* UIProcess/API/APIUIClient.h:
* UIProcess/API/Cocoa/WKUIDelegate.h: Added.
* UIProcess/API/Cocoa/WKWebView.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
(-[WKWebView UIDelegate]):
(-[WKWebView setUIDelegate:]):
* UIProcess/Cocoa/UIClient.h: Added.
* UIProcess/Cocoa/UIClient.mm: Added.
(WebKit::UIClient::UIClient):
(WebKit::UIClient::~UIClient):
(WebKit::UIClient::delegate):
(WebKit::UIClient::setDelegate):
(WebKit::UIClient::runJavaScriptAlert):
(WebKit::UIClient::runJavaScriptConfirm):
(WebKit::UIClient::runJavaScriptPrompt):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::uiClient):
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164460 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Math.imul gives wrong results
https://bugs.webkit.org/show_bug.cgi?id=126345

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

Don't truncate non-int doubles to 0 -- that's just not how ToInt32 works.
Instead, take a slow path that will do the right thing.

* jit/ThunkGenerators.cpp:
(JSC::imulThunkGenerator):

LayoutTests: 

Test this edge case of a double just outside the int range.

* js/dom/imul-expected.txt:
* js/dom/script-tests/imul.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT on touches callbacks after r164409 on iOS.
https://bugs.webkit.org/show_bug.cgi?id=129135

Reviewed by Alexey Proskuryakov.

The change used incorrecly true and false in TouchesCallbacks and
ImageCallback. It also reintroduced isMainThread() which doesn't work
for iOS.

* UIProcess/GenericCallback.h:
(WebKit::CallbackBase::generateCallbackID):
(WebKit::ImageCallback::performCallbackWithReturnValue):
(WebKit::ImageCallback::invalidate):
* UIProcess/WebPageProxy.h:
(WebKit::TouchesCallback::performCallbackWithReturnValue):
(WebKit::TouchesCallback::invalidate):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164462 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DefaultGCActivityCallback::doWork() should reschedule if GC is deferred.
<https://webkit.org/b/129131>

Reviewed by Mark Hahnenberg.

Currently, DefaultGCActivityCallback::doWork() does not check if the GC
needs to be deferred before commencing. As a result, the GC may crash
and/or corrupt data because the VM is not in the consistent state needed
for the GC to run. With this fix, doWork() now checks if the GC is
supposed to be deferred and re-schedules if needed. It only commences
with GC'ing when it's safe to do so.

* runtime/GCActivityCallback.cpp:
(JSC::DefaultGCActivityCallback::doWork):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@164463 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix a build warning by moving some WKWebView methods from the private category to WKWebView itself.

Reviewed by Anders Carlsson.

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


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