Ref-ify more stack guards.
<https://webkit.org/b/122360>

Reviewed by Anders Carlsson.

Make another pass turning RefPtr<T> into Ref<T> where possible.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156932 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Turn off FastMalloc on Windows
https://bugs.webkit.org/show_bug.cgi?id=122352

Reviewed by Darin Adler.

* wtf/Platform.h: Enable USE_SYSTEM_MALLOC when building on
Windows to stick to the MSVCRT allocator/deallocator.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156933 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Silence compiler warning when building 64-bit (on Windows)

Reviewed by Geoffrey Garen.

* jit/JSInterfaceJIT.h: Add a static cast for assignment.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove Qt definitions from Platform.h
https://bugs.webkit.org/show_bug.cgi?id=122349

Reviewed by Anders Carlsson.

* wtf/Platform.h: Remove unused PLATFORM(QT) stanzas from file.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change ScriptDebugServer to use DebuggerCallFrame instead of JavaScriptCallFrame.
https://bugs.webkit.org/show_bug.cgi?id=121969.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame.
   DebuggerCallFrame now tracks whether it is valid instead of needing
   JavaScriptCallFrame do it.
2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed
   just before it pauses and calls back to its client, and then invalidates
   it immediately when the callback returns. Every subsequent callback to
   the client will use a new instance of the DebuggerCallFrame.
3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when
   it "pauses".
4. DebuggerCallFrame only creates its caller DebuggerCallFrame when
   it is needed i.e. when the client calls callerFrame(). Similarly,
   JavaScriptCallFrame only creates its caller when it's requested.
5. DebuggerCallFrame's line() and column() now returns a base-zero int.
6. WebScriptDebugDelegate now only caches the functionName of the frame
   instead of the entire DebuggerCallFrame because that is all that is
   needed.
7. Also removed evaluateInGlobalCallFrame() which is not used anywhere.

* debugger/Debugger.cpp:
* debugger/Debugger.h:
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::DebuggerCallFrame):
(JSC::DebuggerCallFrame::callerFrame):
(JSC::DebuggerCallFrame::dynamicGlobalObject):
(JSC::DebuggerCallFrame::sourceId):
(JSC::DebuggerCallFrame::functionName):
(JSC::DebuggerCallFrame::scope):
(JSC::DebuggerCallFrame::type):
(JSC::DebuggerCallFrame::thisValue):
(JSC::DebuggerCallFrame::evaluate):
(JSC::DebuggerCallFrame::evaluateWithCallFrame):
(JSC::DebuggerCallFrame::invalidate):
(JSC::DebuggerCallFrame::positionForCallFrame):
(JSC::DebuggerCallFrame::sourceIdForCallFrame):
(JSC::DebuggerCallFrame::thisValueForCallFrame):
* debugger/DebuggerCallFrame.h:
(JSC::DebuggerCallFrame::create):
(JSC::DebuggerCallFrame::exec):
(JSC::DebuggerCallFrame::line):
(JSC::DebuggerCallFrame::column):
(JSC::DebuggerCallFrame::position):
(JSC::DebuggerCallFrame::isValid):
* interpreter/StackVisitor.cpp:

Source/WebCore: 

Tests: inspector-protocol/debugger/call-frame-function-name.html
       inspector-protocol/debugger/call-frame-this-host.html
       inspector-protocol/debugger/call-frame-this-nonstrict.html
       inspector-protocol/debugger/call-frame-this-strict.html

1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame.
   DebuggerCallFrame now tracks whether it is valid instead of needing
   JavaScriptCallFrame do it.
2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed
   just before it pauses and calls back to its client, and then invalidates
   it immediately when the callback returns. Every subsequent callback to
   the client will use a new instance of the DebuggerCallFrame.
3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when
   it "pauses".
4. DebuggerCallFrame only creates its caller DebuggerCallFrame when
   it is needed i.e. when the client calls callerFrame(). Similarly,
   JavaScriptCallFrame only creates its caller when it's requested.
5. DebuggerCallFrame's line() and column() now returns a base-zero int.
6. WebScriptDebugDelegate now only caches the functionName of the frame
   instead of the entire DebuggerCallFrame because that is all that is
   needed.
7. Also removed evaluateInGlobalCallFrame() which is not used anywhere.

* bindings/js/JSJavaScriptCallFrameCustom.cpp:
(WebCore::JSJavaScriptCallFrame::thisObject):
* bindings/js/JavaScriptCallFrame.cpp:
(WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
(WebCore::JavaScriptCallFrame::caller):
* bindings/js/JavaScriptCallFrame.h:
(WebCore::JavaScriptCallFrame::create):
(WebCore::JavaScriptCallFrame::sourceID):
(WebCore::JavaScriptCallFrame::position):
(WebCore::JavaScriptCallFrame::line):
(WebCore::JavaScriptCallFrame::column):
(WebCore::JavaScriptCallFrame::functionName):
(WebCore::JavaScriptCallFrame::type):
(WebCore::JavaScriptCallFrame::scopeChain):
(WebCore::JavaScriptCallFrame::dynamicGlobalObject):
(WebCore::JavaScriptCallFrame::thisValue):
(WebCore::JavaScriptCallFrame::evaluate):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::DebuggerCallFrameScope::DebuggerCallFrameScope):
(WebCore::DebuggerCallFrameScope::~DebuggerCallFrameScope):
(WebCore::ScriptDebugServer::ScriptDebugServer):
(WebCore::ScriptDebugServer::setBreakpoint):
(WebCore::ScriptDebugServer::removeBreakpoint):
(WebCore::ScriptDebugServer::hasBreakpoint):
(WebCore::ScriptDebugServer::evaluateBreakpointAction):
(WebCore::ScriptDebugServer::breakProgram):
(WebCore::ScriptDebugServer::stepOverStatement):
(WebCore::ScriptDebugServer::stepOutOfFunction):
(WebCore::ScriptDebugServer::currentDebuggerCallFrame):
(WebCore::ScriptDebugServer::dispatchDidPause):
(WebCore::ScriptDebugServer::updateCallFrame):
(WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
(WebCore::ScriptDebugServer::pauseIfNeeded):
(WebCore::ScriptDebugServer::callEvent):
(WebCore::ScriptDebugServer::returnEvent):
(WebCore::ScriptDebugServer::willExecuteProgram):
(WebCore::ScriptDebugServer::didExecuteProgram):
* bindings/js/ScriptDebugServer.h:
* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::willExecuteProgram):

Source/WebKit/mac: 

1. Make JavaScriptCallFrame a thin shell around the DebuggerCallFrame.
   DebuggerCallFrame now tracks whether it is valid instead of needing
   JavaScriptCallFrame do it.
2. ScriptDebugServer now only instantiates an DebuggerCallFrame when needed
   just before it pauses and calls back to its client, and then invalidates
   it immediately when the callback returns. Every subsequent callback to
   the client will use a new instance of the DebuggerCallFrame.
3. Similarly, ScriptDebugServer now only creates a JavaScriptCallFrame when
   it "pauses".
4. DebuggerCallFrame only creates its caller DebuggerCallFrame when
   it is needed i.e. when the client calls callerFrame(). Similarly,
   JavaScriptCallFrame only creates its caller when it's requested.
5. DebuggerCallFrame's line() and column() now returns a base-zero int.
6. WebScriptDebugDelegate now only caches the functionName of the frame
   instead of the entire DebuggerCallFrame because that is all that is
   needed.
7. Also removed evaluateInGlobalCallFrame() which is not used anywhere.

* WebView/WebScriptDebugDelegate.mm:
(-[WebScriptCallFramePrivate dealloc]):
(-[WebScriptCallFrame _initWithGlobalObject:functionName:exceptionValue:JSC::]):
(-[WebScriptCallFrame functionName]):
(-[WebScriptCallFrame exception]):
* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::exception):

LayoutTests: 

* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest):
* inspector-protocol/debugger/call-frame-function-name-expected.txt: Added.
* inspector-protocol/debugger/call-frame-function-name.html: Added.
* inspector-protocol/debugger/call-frame-this-host-expected.txt: Added.
* inspector-protocol/debugger/call-frame-this-host.html: Added.
* inspector-protocol/debugger/call-frame-this-nonstrict-expected.txt: Added.
* inspector-protocol/debugger/call-frame-this-nonstrict.html: Added.
* inspector-protocol/debugger/call-frame-this-strict-expected.txt: Added.
* inspector-protocol/debugger/call-frame-this-strict.html: Added.
* inspector/debugger/pause-in-internal-script-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156936 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Try to fix the Windows build after r156930.

* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::paintCharacter): Use ceilf and floorf to avoid issues
with overload collisions and implicit casts of LayoutUnits.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156937 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Editor should use reference-getting document() internally.
<https://webkit.org/b/122364>

Reviewed by Darin Adler.

Instead of grabbing at Editor::m_frame.document(), use the nice
Editor::document() helper that always returns a Document&.

Calling Editor methods on a Frame's editor() while there is no
Document in the Frame is a programming error and this is covered
by an assertion in document().

This removes a bunch of null checks and enables further cleanup.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156938 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: PolicyChecker backpointer to Frame should be a reference.
<https://webkit.org/b/122354>

Reviewed by Anders Carlsson.

PolicyChecker is tied to the lifetime of FrameLoader, which in turn
is tied to the lifetime of Frame.


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