GCAssertions.h should use STL type traits and static_assert
https://bugs.webkit.org/show_bug.cgi?id=120785

Reviewed by Andreas Kling.

Source/JavaScriptCore:

There's no need to rely on compiler specific support to figure out if a class is trivially destructable,
we can just use type traits from STL. Do this, fix the assert macro to use static_assert directly and
rename it from ASSERT_HAS_TRIVIAL_DESTRUCTOR to STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE to clarify that
it's a static assert and to match the STL nomenclature.

* API/JSCallbackFunction.cpp:
* debugger/DebuggerActivation.cpp:
* heap/GCAssertions.h:
* runtime/ArrayConstructor.cpp:
* runtime/BooleanConstructor.cpp:
* runtime/BooleanObject.cpp:
* runtime/BooleanPrototype.cpp:
* runtime/DateConstructor.cpp:
* runtime/ErrorConstructor.cpp:
* runtime/ErrorInstance.cpp:
* runtime/ErrorPrototype.cpp:
* runtime/ExceptionHelpers.cpp:
* runtime/FunctionConstructor.cpp:
* runtime/FunctionPrototype.cpp:
* runtime/GetterSetter.cpp:
* runtime/InternalFunction.cpp:
* runtime/JSAPIValueWrapper.cpp:
* runtime/JSArray.cpp:
* runtime/JSCell.cpp:
* runtime/JSNotAnObject.cpp:
* runtime/JSONObject.cpp:
* runtime/JSObject.cpp:
* runtime/JSPromiseConstructor.cpp:
* runtime/JSPromisePrototype.cpp:
* runtime/JSPromiseResolverConstructor.cpp:
* runtime/JSPromiseResolverPrototype.cpp:
* runtime/JSProxy.cpp:
* runtime/JSScope.cpp:
* runtime/JSWrapperObject.cpp:
* runtime/MathObject.cpp:
* runtime/NameConstructor.cpp:
* runtime/NativeErrorConstructor.cpp:
* runtime/NumberConstructor.cpp:
* runtime/NumberObject.cpp:
* runtime/NumberPrototype.cpp:
* runtime/ObjectConstructor.cpp:
* runtime/ObjectPrototype.cpp:
* runtime/RegExpObject.cpp:
* runtime/StrictEvalActivation.cpp:
* runtime/StringConstructor.cpp:
* runtime/StringObject.cpp:
* runtime/StringPrototype.cpp:

Source/WebCore:

Update for JavaScriptCore changes.

* bindings/js/JSDOMBinding.cpp:
* bindings/js/JSImageConstructor.cpp:

Source/WebKit2:

Update for JavaScriptCore changes.

* WebProcess/Plugins/Netscape/JSNPMethod.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace uses of CLANG_PRAGMA with #pragma

Rubber-stamped by Andreas Kling.

This file is only compiled by clang anyway.

* WebProcess/InjectedBundle/mac/InjectedBundleMac.mm:
(WebKit::InjectedBundle::load):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix build bustage.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clean up wtf/Compiler.h
https://bugs.webkit.org/show_bug.cgi?id=120790

Reviewed by Andreas Kling.

- Get rid of the CLANG_PRAGMA define, it's not used anywhere.
- Remove a workaround for a bug in the version of clang that came with Xcode 4.2.
- Replace WTF_COMPILER_SUPPORTS_CXX_FINAL_CONTROL with a compiler quirk for versions of clang
  that have a buggy final implementation and fix a bug in the macro where final would be disabled
  for versions of clang where __clang_minor__ is less than 2, regardless of the major version.
- Fail if someone tries to compile the WebKit stack with a compiler that doesn't support rvalue
  references or static_assert.

* wtf/Compiler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BUILD FIX (r155108): Add SynchronousLoaderClientCFNet.cpp to Xcode project

* WebCore.xcodeproj/project.pbxproj: The iOS port defines
USE(CFNETWORK), so it needs to compile
SynchronousLoaderClientCFNet.cpp to build successfully.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add COMPILER_SUPPORTS(CXX_AUTO_TYPE) and #error if it's 0
https://bugs.webkit.org/show_bug.cgi?id=120794

Reviewed by Andreas Kling.

People have already begun using C++11 auto in WebCore, so let's make it a prerequisite.

* wtf/Compiler.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(149636, merged in 153145): ToThis conversion doesn't work in the DFG
https://bugs.webkit.org/show_bug.cgi?id=120781

Reviewed by Mark Hahnenberg.
        
- Use some method table hacks to detect if the CheckStructure optimization is
  valid for to_this.
        
- Introduce a FinalObjectUse and use it for ToThis->Identity conversion.
        
This looks like it might be perf-neutral on the major benchmarks, but it
introduces some horrible performance cliffs. For example if you add methods to
the Array prototype, you'll get horrible performance cliffs. As in virtual calls
to C++ every time you call a JS function even if it's inlined.
LongSpider/3d-cube appears to hit this.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::SafeToExecuteEdge::operator()):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculateFinalObject):
(JSC::DFG::SpeculativeJIT::speculate):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGUseKind.cpp:
(WTF::printInternal):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
(JSC::DFG::isCell):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Cached Page and Frame don't need to be ref-counted.
<https://webkit.org/b/120710>

Reviewed by Anders Carlsson.

- CachedPage is owned by HistoryItem.
- CachedFrame is owned by CachedPage.

Remove the ref counting from these objects to make the code less confusing.

Added a new method:

- PassOwnPtr<CachedPage> PageCache::take(HistoryItem*)

..which is what it looks like - a combined get() and remove() that transfers
ownership of the CachedPage to the caller.

This is used by commitProvisionalLoad() and invalidateCurrentItemCachedPage()
to accomplish in one swoop what they used to do in awkwardly spaced steps.

* history/CachedFrame.h:
(WebCore::CachedFrame::create):
* history/CachedPage.cpp:
(WebCore::CachedPage::create):
* history/CachedPage.h:
* history/HistoryItem.h:
* history/PageCache.cpp:
(WebCore::PageCache::take):
* history/PageCache.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::transitionToCommitted):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::invalidateCurrentItemCachedPage):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move all Vector tests into Vector.cpp
https://bugs.webkit.org/show_bug.cgi?id=120797

Reviewed by Andreas Kling.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WTF/VectorBasic.cpp: Removed.
* TestWebKitAPI/Tests/WTF/VectorReverse.cpp: Removed.
* TestWebKitAPI/Tests/WTF/WTF.pro:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make Vector::uncheckedAppend work with move-only types
https://bugs.webkit.org/show_bug.cgi?id=120799

Reviewed by Andreas Kling.

Source/WTF:

* wtf/Vector.h:
(WTF::::uncheckedAppend):
Use std::forward to invoke the move constructor when possible.

Tools:

* TestWebKitAPI/Tests/WTF/Vector.cpp:
(TestWebKitAPI::MoveOnly):
Add a move-only class.

(TestWebKitAPI::TEST):
Add a test for Vector<MoveOnly>::uncheckedAppend.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        WKFullScreenWindowController extends lifetime of WKView, deleting it at a wrong time
        https://bugs.webkit.org/show_bug.cgi?id=120792
        <rdar://problem/14884666>

        Reviewed by Jer Noble.

        * UIProcess/API/mac/WKView.mm: (-[WKView fullScreenWindowController]):
        Use a newly minted initializer for the controller.

        * UIProcess/mac/WKFullScreenWindowController.h: Removed unused web view accessors.
        Changed the class to take web view at initialization time.

        * UIProcess/mac/WKFullScreenWindowController.mm:
        (-[WKFullScreenWindowController initWithWindow:webView:]): Initialize the controller
        inone step.
        (-[WKFullScreenWindowController dealloc]): WebView is now a raw pointer, no need
        to zero it.
        (-[WKFullScreenWindowController close]): Make sure to not leave a dangling WKView
        pointer (this method is indirectly but inevitably called when WKView is deallocated).



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Remove harmless assert, triggered hitting breakpoint in auto prettyprinted code on reload
https://bugs.webkit.org/show_bug.cgi?id=120332

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2013-09-05
Reviewed by Timothy Hatcher.

* UserInterface/TextEditor.js:

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