CodeBlock compilation and installation should be simplified and rationalized
https://bugs.webkit.org/show_bug.cgi?id=120326

Reviewed by Oliver Hunt.
        
Rolling r154804 back in after fixing no-LLInt build.
        
Previously Executable owned the code for generating JIT code; you always had
to go through Executable. But often you also had to go through CodeBlock,
because ScriptExecutable couldn't have virtual methods, but CodeBlock could.
So you'd ask CodeBlock to do something, which would dispatch through a
virtual method that would select the appropriate Executable subtype's method.
This all meant that the same code would often be duplicated, because most of
the work needed to compile something was identical regardless of code type.
But then we tried to fix this, by having templatized helpers in
ExecutionHarness.h and JITDriver.h. The result was that if you wanted to find
out what happened when you asked for something to be compiled, you'd go on a
wild ride that started with CodeBlock, touched upon Executable, and then
ricocheted into either ExecutionHarness or JITDriver (likely both).
        
Another awkwardness was that for concurrent compiles, the DFG::Worklist had
super-special inside knowledge of what JITStubs.cpp's cti_optimize would have
done once the compilation finished.
        
Also, most of the DFG JIT drivers assumed that they couldn't install the
JITCode into the CodeBlock directly - instead they would return it via a
reference, which happened to be a reference to the JITCode pointer in
Executable. This was super weird.
        
Finally, there was no notion of compiling code into a special CodeBlock that
wasn't used for handling calls into an Executable. I'd like this for FTL OSR
entry.
        
This patch solves these problems by reducing all of that complexity into just
three primitives:
        
- Executable::newCodeBlock(). This gives you a new code block, either for call
  or for construct, and either to serve as the baseline code or the optimized
  code. The new code block is then owned by the caller; Executable doesn't
  register it anywhere. The new code block has no JITCode and isn't callable,
  but it has all of the bytecode.
        
- CodeBlock::prepareForExecution(). This takes the CodeBlock's bytecode and
  produces a JITCode, and then installs the JITCode into the CodeBlock. This
  method takes a JITType, and always compiles with that JIT. If you ask for
  JITCode::InterpreterThunk then you'll get JITCode that just points to the
  LLInt entrypoints. Once this returns, it is possible to call into the
  CodeBlock if you do so manually - but the Executable still won't know about
  it so JS calls to that Executable will still be routed to whatever CodeBlock
  is associated with the Executable.
        
- Executable::installCode(). This takes a CodeBlock and makes it the code-for-
  entry for that Executable. This involves unlinking the Executable's last
  CodeBlock, if there was one. This also tells the GC about any effect on
  memory usage and does a bunch of weird data structure rewiring, since
  Executable caches some of CodeBlock's fields for the benefit of virtual call
  fast paths.
        
This functionality is then wrapped around three convenience methods:
        
- Executable::prepareForExecution(). If there is no code block for that
  Executable, then one is created (newCodeBlock()), compiled
  (CodeBlock::prepareForExecution()) and installed (installCode()).
        
- CodeBlock::newReplacement(). Asks the Executable for a new CodeBlock that
  can serve as an optimized replacement of the current one.
        
- CodeBlock::install(). Asks the Executable to install this code block.
        
This patch allows me to kill *a lot* of code and to remove a lot of
specializations for functions vs. not-functions, and a lot of places where we
pass around JITCode references and such. ExecutionHarness and JITDriver are
both gone. Overall this patch has more red than green.
        
It also allows me to work on FTL OSR entry and tier-up:
        
- FTL tier-up: this will involve DFGOperations.cpp asking the DFG::Worklist
  to do some compilation, but it will require the DFG::Worklist to do
  something different than what JITStubs.cpp would want, once the compilation
  finishes. This patch introduces a callback mechanism for that purpose.
        
- FTL OSR entry: this will involve creating a special auto-jettisoned
  CodeBlock that is used only for FTL OSR entry. The new set of primitives
  allows for this: Executable can vend you a fresh new CodeBlock, and you can
  ask that CodeBlock to compile itself with any JIT of your choosing. Or you
  can take that CodeBlock and compile it yourself. Previously the act of
  producing a CodeBlock-for-optimization and the act of compiling code for it
  were tightly coupled; now you can separate them and you can create such
  auto-jettisoned CodeBlocks that are used for a one-shot OSR entry.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::unlinkIncomingCalls):
(JSC::CodeBlock::prepareForExecutionImpl):
(JSC::CodeBlock::prepareForExecution):
(JSC::CodeBlock::prepareForExecutionAsynchronously):
(JSC::CodeBlock::install):
(JSC::CodeBlock::newReplacement):
(JSC::FunctionCodeBlock::jettisonImpl):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::hasBaselineJITProfiling):
* bytecode/DeferredCompilationCallback.cpp: Added.
(JSC::DeferredCompilationCallback::DeferredCompilationCallback):
(JSC::DeferredCompilationCallback::~DeferredCompilationCallback):
* bytecode/DeferredCompilationCallback.h: Added.
* dfg/DFGDriver.cpp:
(JSC::DFG::tryCompile):
* dfg/DFGDriver.h:
(JSC::DFG::tryCompile):
* dfg/DFGFailedFinalizer.cpp:
(JSC::DFG::FailedFinalizer::finalize):
(JSC::DFG::FailedFinalizer::finalizeFunction):
* dfg/DFGFailedFinalizer.h:
* dfg/DFGFinalizer.h:
* dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::finalize):
(JSC::DFG::JITFinalizer::finalizeFunction):
* dfg/DFGJITFinalizer.h:
* dfg/DFGOSRExitPreparation.cpp:
(JSC::DFG::prepareCodeOriginForOSRExit):
* dfg/DFGOperations.cpp:
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::Plan):
(JSC::DFG::Plan::compileInThreadImpl):
(JSC::DFG::Plan::notifyReady):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
(JSC::DFG::Plan::finalizeAndNotifyCallback):
* dfg/DFGPlan.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::completeAllReadyPlansForVM):
(JSC::DFG::Worklist::runThread):
* ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::finalize):
(JSC::FTL::JITFinalizer::finalizeFunction):
* ftl/FTLJITFinalizer.h:
* heap/Heap.h:
(JSC::Heap::isDeferred):
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
* jit/JITDriver.h: Removed.
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
(JSC::jitCompileFor):
(JSC::lazyLinkFor):
* jit/JITToDFGDeferredCompilationCallback.cpp: Added.
(JSC::JITToDFGDeferredCompilationCallback::JITToDFGDeferredCompilationCallback):
(JSC::JITToDFGDeferredCompilationCallback::~JITToDFGDeferredCompilationCallback):
(JSC::JITToDFGDeferredCompilationCallback::create):
(JSC::JITToDFGDeferredCompilationCallback::compilationDidBecomeReadyAsynchronously):
(JSC::JITToDFGDeferredCompilationCallback::compilationDidComplete):
* jit/JITToDFGDeferredCompilationCallback.h: Added.
* llint/LLIntEntrypoints.cpp:
(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
* llint/LLIntEntrypoints.h:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
(JSC::LLInt::setUpCall):
* runtime/ArrayPrototype.cpp:
(JSC::isNumericCompareFunction):
* runtime/CommonSlowPaths.cpp:
* runtime/CompilationResult.cpp:
(WTF::printInternal):
* runtime/CompilationResult.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::installCode):
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::ScriptExecutable::newReplacementCodeBlockFor):
(JSC::ScriptExecutable::prepareForExecutionImpl):
* runtime/Executable.h:
(JSC::ExecutableBase::offsetOfJITCodeWithArityCheckFor):
(JSC::ExecutableBase::offsetOfNumParametersFor):
(JSC::ScriptExecutable::prepareForExecution):
(JSC::FunctionExecutable::jettisonOptimizedCodeFor):
* runtime/ExecutionHarness.h: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed gardening. Add missing *.css files from project.

* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Positioned Replaced Elements That Aren't RenderReplaced get Incorrect Width
https://bugs.webkit.org/show_bug.cgi?id=93735

Reviewed by David Hyatt.

Source/WebCore:

Replaced elements that aren't RenderReplaced aren't |isReplaced| and don't have an
intrinsic height or width. This causes them to go down the wrong height and width computation
path in RenderBox when they are absolute positioned.

The notion of |isReplaced| is entwined with the notion of being |isInline| so it isn't really
possible to make them isReplaced without re-wiring a lot of code. So instead use an ad-hoc definition
of isReplacedElement in RenderBox to bring all replaced elements into the height and width calculation.
To make sure we get the right height and width in there, give non-RenderReplaced replaced renderers
the helpers for returning their approximation of intrinsic height and width.

The initial attempt at landing this patch had to be rolled out because it used LayoutUnit() for default
intrinsic height of some replaced elements and this made the layout of the elements unstable in some sites.
The fix for this issue is captured in intrinsic-button-and-input-height.html.

Tests: fast/replaced/intrinsic-button-and-input-height.html
       fast/replaced/width-and-height-of-positioned-replaced-elements.html

* rendering/RenderBox.cpp:
(WebCore::isReplacedElement):
(WebCore::RenderBox::computePositionedLogicalWidth):
(WebCore::RenderBox::computePositionedLogicalHeight):
* rendering/RenderBox.h:
(WebCore::RenderBox::intrinsicSize):
* rendering/RenderButton.h:
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::RenderListBox):
(WebCore::RenderListBox::computePreferredLogicalWidths):
(WebCore::RenderListBox::computeLogicalHeight):
* rendering/RenderListBox.h:
* rendering/RenderMenuList.h:
* rendering/RenderReplaced.h:
* rendering/RenderSlider.cpp:
(WebCore::RenderSlider::computePreferredLogicalWidths):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::RenderTextControl):
(WebCore::RenderTextControl::computeLogicalHeight):
* rendering/RenderTextControl.h:

LayoutTests:

* fast/replaced/intrinsic-button-and-input-height-expected.txt: Added.
* fast/replaced/intrinsic-button-and-input-height.html: Added.
* fast/replaced/width-and-height-of-positioned-replaced-elements.html: Added.
* platform/qt/fast/replaced/width-and-height-of-positioned-replaced-elements-expected.png: Added.
* platform/qt/fast/replaced/width-and-height-of-positioned-replaced-elements-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154826 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Gardening: fixed broken non-DFG build.
https://bugs.webkit.org/show_bug.cgi?id=120481.

Not reviewed.

* interpreter/StackIterator.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Download Web Archive of Inspected Page
https://bugs.webkit.org/show_bug.cgi?id=119774

Reviewed by Timothy Hatcher.

Source/WebCore:

Add PageAgent.archive which will return a Base-64 encoded web archive
when successful. In order to then allow saving non-string files, extend
InspectorFrontendHost.save to allow for Base-64 encoded data.

* inspector/Inspector.json:
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::archive):
* inspector/InspectorPageAgent.h:
Introduce and implement PageAgent.archive. Create a Web Archive of the
page's main frame.

* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::save):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::save):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Extend InspectorFrontendHost.save to include a base64Encoded param.

* inspector/front-end/FileManager.js:
* inspector/front-end/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.save):
Misc. updates to the old inspector for function changes.

Source/WebInspectorUI:

* UserInterface/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._saveDataToFile):
Allow a custom save handler which will do all the work.

* UserInterface/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView):
(WebInspector.DOMTreeContentView.prototype.get supportsSave):
(WebInspector.DOMTreeContentView.prototype.get saveData.saveHandler):
(WebInspector.DOMTreeContentView.prototype.get saveData):
Allow Save keyboard shortcut to download an archive viewing the DOM Tree.

* UserInterface/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype._updateStatus):
* UserInterface/FrameTreeElement.js:
(WebInspector.FrameTreeElement):
(WebInspector.FrameTreeElement.prototype.updateStatusForMainFrame):
(WebInspector.FrameTreeElement.prototype._mainResourceDidChange):
(WebInspector.FrameTreeElement.prototype._shouldGroupIntoFolders):
(WebInspector.FrameTreeElement.prototype._reloadPageClicked):
(WebInspector.FrameTreeElement.prototype._downloadButtonClicked):
(WebInspector.FrameTreeElement.prototype._updateDownloadButton):
(WebInspector.FrameTreeElement.prototype._pageArchiveStarted):
(WebInspector.FrameTreeElement.prototype._pageArchiveEnded):
Move handling of main frame TreeElement buttons to FrameTreeElement.
Add a Download button, and enable/disable it appropriately.

* UserInterface/ResourceTreeElement.css:
* UserInterface/TreeElementStatusButton.css: Copied from Source/WebInspectorUI/UserInterface/ResourceTreeElement.css.
(.item > .status > .status-button):
(.item > .status > .status-button > svg *):
(.item.selected > .status > .status-button > svg *):
(.item.selected > .status > .status-button:active > svg *):
(.item > .status > .status-button.disabled > svg *):
(.item.selected > .status > .status-button.disabled > svg *):
* UserInterface/TreeElementStatusButton.js: Added.
(WebInspector.TreeElementStatusButton):
(WebInspector.TreeElementStatusButton.prototype.get element):
(WebInspector.TreeElementStatusButton.prototype.get hidden):
(WebInspector.TreeElementStatusButton.prototype.set hidden):
(WebInspector.TreeElementStatusButton.prototype.get enabled):
(WebInspector.TreeElementStatusButton.prototype.set enabled):
(WebInspector.TreeElementStatusButton.prototype._clicked):
Make buttons in the TreeElement status a generic class to share styling
and handling of the buttons. New "disabled" state with even more
transparent is used when the page is downloading.

* UserInterface/Main.html:
* UserInterface/Main.js:
(WebInspector.archiveMainFrame):
(WebInspector.canArchiveMainFrame):
Generic API for archiving the page and determining if you can archive it.

* UserInterface/InspectorBackendCommands.js:
* UserInterface/InspectorFrontendHostStub.js:
(.WebInspector.InspectorFrontendHostStub.prototype.save):
* UserInterface/Images/DownloadArrow.svg: Added.
* Localizations/en.lproj/localizedStrings.js:
Misc. updates and new files.

Source/WebKit/mac:

Update to support InspectorFrontendHost.save's new base64Encoded
parameter. It means the incoming content is binary data, not a string.

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.mm:
(WebInspectorFrontendClient::save):

Source/WebKit2:

Update to support InspectorFrontendHost.save's new base64Encoded
parameter. It means the incoming content is binary data, not a string.

* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::save):
* UIProcess/WebInspectorProxy.h:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/efl/WebInspectorProxyEfl.cpp:
(WebKit::WebInspectorProxy::platformSave):
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformSave):
* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::platformSave):
* UIProcess/qt/WebInspectorProxyQt.cpp:
(WebKit::WebInspectorProxy::platformSave):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.cpp:
(WebKit::WebInspectorFrontendClient::save):
* WebProcess/WebCoreSupport/WebInspectorFrontendClient.h:
* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::save):
* WebProcess/WebPage/WebInspector.h:

LayoutTests:

* inspector-protocol/page/archive-expected.txt: Added.
* inspector-protocol/page/archive.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Consolidate inspector-protocol tests into domains
https://bugs.webkit.org/show_bug.cgi?id=120450

Reviewed by Timothy Hatcher.

Move around tests and clean them up in the process.

* http/tests/inspector-protocol/resources/protocol-test.js:
* inspector-protocol/css/getSupportedCSSProperties-expected.txt: Renamed from LayoutTests/inspector-protocol/css-getSupportedCSSProperties-expected.txt.
* inspector-protocol/css/getSupportedCSSProperties.html: Renamed from LayoutTests/inspector-protocol/css-getSupportedCSSProperties.html.
* inspector-protocol/dom/focus-expected.txt: Renamed from LayoutTests/inspector-protocol/dom-focus-expected.txt.
* inspector-protocol/dom/focus.html: Renamed from LayoutTests/inspector-protocol/dom-focus.html.
* inspector-protocol/dom/request-child-nodes-depth-expected.txt: Renamed from LayoutTests/inspector-protocol/dom-request-child-nodes-depth-expected.txt.
* inspector-protocol/dom/request-child-nodes-depth.html: Renamed from LayoutTests/inspector-protocol/dom-request-child-nodes-depth.html.
* inspector-protocol/heap-profiler/heap-snapshot-with-detached-dom-tree.html:
* inspector-protocol/heap-profiler/heap-snapshot-with-event-listener.html:
* inspector-protocol/heap-profiler/take-heap-snapshot.html:
* inspector-protocol/nmi-webaudio-expected.txt: Removed.
* inspector-protocol/nmi-webaudio-leak-test-expected.txt: Removed.
* inspector-protocol/nmi-webaudio-leak-test.html: Removed.
* inspector-protocol/nmi-webaudio.html: Removed.
* inspector-protocol/page/frameScheduledNavigation.html:
* inspector-protocol/page/frameStartedLoading.html:
* inspector-protocol/page/resources/blank.html: Renamed from LayoutTests/inspector-protocol/resources/blank.html.
* inspector-protocol/page/setEmulatedMedia-expected.txt: Renamed from LayoutTests/inspector-protocol/media-query-listener-exception-expected.txt.
* inspector-protocol/page/setEmulatedMedia.html: Renamed from LayoutTests/inspector-protocol/media-query-listener-exception.html.
* inspector-protocol/resources/audio-context.html: Removed.
* inspector-protocol/runtime/getProperties-expected.txt: Renamed from LayoutTests/inspector-protocol/runtime-getProperties-expected.txt.
* inspector-protocol/runtime/getProperties.html: Renamed from LayoutTests/inspector-protocol/runtime-getProperties.html.
* platform/efl/TestExpectations:
* platform/gtk-wk1/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Automake] libWebCoreDOM.la could use a better name
https://bugs.webkit.org/show_bug.cgi?id=120232

Reviewed by Martin Robinson.

Source/WebCore: 

* bindings/gobject/GNUmakefile.am: Rename the libWebCoreDOM library to libGObjectDOMBindings.

Source/WebKit/gtk: 

* GNUmakefile.am: libWebCoreDOM has a new name - libGObjectDOMBindings.

Source/WebKit2: 

* GNUmakefile.am: libWebCoreDOM has a new name - libGObjectDOMBindings.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a Command-R shortcut in MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=120442

Reviewed by Dean Jackson.

Add a "Reload Page" item to the View menu with a Command-R
shortcut.

* MiniBrowser/mac/MainMenu.xib:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154831 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix slider thumb event handling to use local, not absolute coordinates
https://bugs.webkit.org/show_bug.cgi?id=120480

Reviewed by Darin Adler.

SliderThumbElement::setPositionFromPoint() did all of its coordinate
math by mapping renderer rects into absolute coordinates, which was
unnecessary and expensive.

Fix by doing all the math in the coordinate space of the input's
renderer. This simplified the code. Also, currentPosition
was computed but unused, so was removed.

No behavior change. Tested by fast/forms/range/slider-transformed.html

* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::setPositionFromPoint):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeBlock::prepareForExecution() is silly
https://bugs.webkit.org/show_bug.cgi?id=120453

Reviewed by Oliver Hunt.
        
Instead of saying:
        
    codeBlock->prepareForExecution(stuff, BaselineJIT, more stuff)
        
we should just say:
        
    JIT::compile(stuff, codeBlock, more stuff);
        
And similarly for the LLInt and DFG.
        
This kills a bunch of code, since CodeBlock::prepareForExecution() is just a
wrapper that uses the JITType argument to call into the appropriate execution
engine, which is what the user wanted to do in the first place.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:
* dfg/DFGDriver.cpp:
(JSC::DFG::compileImpl):
(JSC::DFG::compile):
* dfg/DFGDriver.h:
(JSC::DFG::tryCompile):
* dfg/DFGOSRExitPreparation.cpp:
(JSC::DFG::prepareCodeOriginForOSRExit):
* dfg/DFGWorklist.cpp:
(JSC::DFG::globalWorklist):
* dfg/DFGWorklist.h:
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JIT.h:
(JSC::JIT::compile):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntEntrypoint.cpp: Copied from Source/JavaScriptCore/llint/LLIntEntrypoints.cpp.
(JSC::LLInt::setFunctionEntrypoint):
(JSC::LLInt::setEvalEntrypoint):
(JSC::LLInt::setProgramEntrypoint):
(JSC::LLInt::setEntrypoint):
* llint/LLIntEntrypoint.h: Copied from Source/JavaScriptCore/llint/LLIntEntrypoints.h.
* llint/LLIntEntrypoints.cpp: Removed.
* llint/LLIntEntrypoints.h: Removed.
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::jitCompileAndSetHeuristics):
* runtime/Executable.cpp:
(JSC::ScriptExecutable::prepareForExecutionImpl):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154833 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reverting a change that was made in https://bugs.webkit.org/show_bug.cgi?id=120472.

* media/track/track-cue-rendering-on-resize-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154834 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove code behind ENABLE(DIALOG_ELEMENT)
https://bugs.webkit.org/show_bug.cgi?id=120467

Reviewed by Darin Adler.

It is incomplete and no one is building it.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* DerivedSources.pri:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.xcodeproj/project.pbxproj:
* bindings/generic/RuntimeEnabledFeatures.cpp:
* bindings/generic/RuntimeEnabledFeatures.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/html.css:
* dom/ContextFeatures.cpp:
* dom/ContextFeatures.h:
* dom/Document.cpp:
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::removedFrom):
(WebCore::Element::setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries):
* dom/Element.h:
(WebCore::Element::isDisabledFormControl):
* dom/ElementRareData.h:
(WebCore::ElementRareData::ElementRareData):
* html/HTMLDialogElement.cpp: Removed.
* html/HTMLDialogElement.h: Removed.
* html/HTMLDialogElement.idl: Removed.
* html/HTMLElementsAllInOne.cpp:
* html/HTMLTagNames.in:
* rendering/RenderDialog.cpp: Removed.
* rendering/RenderDialog.h: Removed.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
* rendering/RenderLayer.h:
* rendering/RenderObject.h:
(WebCore::RenderObject::isCounter):
* rendering/RenderingAllInOne.cpp:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
* testing/InternalSettings.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154835 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pasteboard::writeSelection violates layering (first step, fixes it for Mac platform only)
https://bugs.webkit.org/show_bug.cgi?id=120483

Reviewed by Anders Carlsson.

* editing/Editor.cpp:
(WebCore::Editor::cut): Added some comments. Use the new writeSelectionToPasteboard
function on Mac instead of Pasteboard::writeSelection.
(WebCore::Editor::copy): Ditto.

* editing/Editor.h: Removed an old unused Mac-only writeSelectionToPasteboard function
that was a cover that called through to Pasteboard::writeSelectionForTypes. Added a new
Mac-only writeSelectionToPasteboard function that is destined to become cross-platform soon.

* editing/mac/EditorMac.mm:
(WebCore::Editor::writeSelectionToPasteboard): Added. Uses a new pattern where the Editor
puts all the data into a structure called PasteboardWebContent then calls the Pasteboard to
do the work. The platform-specific aspect of PasteboardWebContent is what formats are needed
for each platform.

* page/DragController.cpp:
(WebCore::DragController::startDrag): Added some comments. Use the new writeSelectionToPasteboard
function on Mac instead of Pasteboard::writeSelection.

* platform/Pasteboard.h: Remove some unneeded forward declarations. Added comments for all functions
that don't belong in this class because they are layering violations; this becomes the to do list for
the project we are beginning here. Added the new PasteboardWebContent structure, empty on all platforms
except for Mac for now. Removed writeSelectionForTypes, a Mac-only function that is no longer used.
Added setTypes and writeAfterSettingTypes, the two halves of the future function named writeWebContent.
Put the writeSelection function inside a "not Mac" if statement. Later to be deleted entirely.

* platform/mac/PasteboardMac.mm: Removed now-unneeded selectionPasteboardTypes,
Pasteboard::writeSelectionForTypes, and writeSelection functions.
(WebCore::Pasteboard::setTypes): Added. First half of writing web content to the pasteboard.
(WebCore::Pasteboard::writeAfterSettingTypes): Added. Second half of writing web content to the pasteboard.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154836 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CodeBlock's magic for scaling tier-up thresholds should be more reusable
https://bugs.webkit.org/show_bug.cgi?id=120486

Reviewed by Oliver Hunt.
        
Removed the counterValueForBlah() methods and exposed the reusable scaling logic
as a adjustedCounterValue() method.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::adjustedCounterValue):
(JSC::CodeBlock::optimizeAfterWarmUp):
(JSC::CodeBlock::optimizeAfterLongWarmUp):
(JSC::CodeBlock::optimizeSoon):
* bytecode/CodeBlock.h:
* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::handleExitCounts):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Kill code that became dead after http://trac.webkit.org/changeset/154833

Rubber stamped by Oliver Hunt.

* dfg/DFGDriver.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154838 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r153222, 32-bit): NULL JSValue() seen when running peacekeeper benchmark.
https://bugs.webkit.org/show_bug.cgi?id=120080

Patch by Julien Brianceau <jbriance@cisco.com> on 2013-08-29
Reviewed by Michael Saboff.

* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_get_argument_by_val): Revert changes introduced by r153222 in this function.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154839 268f45cc-cd09-0410-ab3c-d52691b4dbfc
According to DOM4, all DocType nodes should have a document
https://bugs.webkit.org/show_bug.cgi?id=99244

Reviewed by Darin Adler.

Source/WebCore:

Doctypes now always have a node document and can be moved across document boundaries as per
the latest DOM4 specification:
http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
http://dom.spec.whatwg.org/#dom-node-ownerdocument

This means that DOMImplementation.createDocumentType() now sets the ownerDocument of the
new DocumentType Node to the associated document of the current "context" object. In
DOM4, all nodes have a document at all times. DocumentType nodes can now be moved across
document boundaries so that the node can be added to a Document after being created.

This means we will no longer need to special case DocumentType nodes in the code and
Node::document() can no longer return NULL, which means that we'll be able to remove
NULL checks in call sites.

Firefox stable and since recently Blink already follow DOM4 here while IE10 does not (yet).

Test: fast/dom/createDocumentType-ownerDocument.html

* dom/ContainerNode.cpp:
(WebCore::checkAcceptChild):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocumentType):
(WebCore::DOMImplementation::createDocument):
* dom/Node.h:
(WebCore::Node::document):

LayoutTests:

Add layout test to check that DocumentType Nodes have a document after being
created. Also update a few existing test cases to reflect this change.

* fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt:
* fast/dom/DOMImplementation/createDocument-with-used-doctype.html:
* fast/dom/DOMImplementation/resources/createDocument-with-used-doctype-frame.html:
* fast/dom/XMLSerializer-doctype2-expected.txt:
* fast/dom/XMLSerializer-doctype2.html:
* fast/dom/createDocumentType-ownerDocument-expected.txt: Added.
* fast/dom/createDocumentType-ownerDocument.html: Added.
* fast/dom/move-nodes-across-documents.html:
* fast/dom/node-iterator-with-doctype-root-expected.txt:
* fast/dom/node-iterator-with-doctype-root.html:
* fast/events/dispatch-event-no-document-expected.txt:
* fast/events/dispatch-event-no-document.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Should enable WebGL by default on MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=120420

Patch by Andre Moreira Magalhaes <andre.magalhaes@collabora.co.uk> on 2013-08-29
Reviewed by Gustavo Noronha Silva.

Enable WebGL by default on MiniBrowser.

* MiniBrowser/gtk/main.c:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154841 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XMLSerializer-attribute-namespace-prefix-conflicts can't produce reliable results
https://bugs.webkit.org/show_bug.cgi?id=120490

Marking as [ Pass Failure ] for the moment.

* TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154842 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Inspector: Use a bit of RefPtr::release() in generated code.
<https://webkit.org/b/120485>

Reviewed by Darin Adler.

Just something I spotted while reading InspectorBackendDispatcher.cpp.
Avoid 3 cases of reference count churnery.

* inspector/CodeGeneratorInspectorStrings.py:


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