DFG should trigger rage conversion from double to contiguous if it sees a GetByVal on Double being used in an integer context
https://bugs.webkit.org/show_bug.cgi?id=103858

Reviewed by Gavin Barraclough.

A rage conversion from double to contiguous is one where you try to convert each
double to an int32.

This is probably not the last we'll hear of rage conversion from double to contiguous.
It may be better to do this right during parsing, which will result in fewer cases of
Arrayification. But even so, this looks like a straight win already - 1% speed-up on
Kraken, no major regression anywhere else.

* dfg/DFGAbstractState.cpp:
(JSC::DFG::AbstractState::execute):
* dfg/DFGArrayMode.cpp:
(JSC::DFG::ArrayMode::refine):
(JSC::DFG::arrayConversionToString):
(JSC::DFG::ArrayMode::dump):
(WTF):
(WTF::printInternal):
* dfg/DFGArrayMode.h:
(JSC::DFG::ArrayMode::withConversion):
(ArrayMode):
(JSC::DFG::ArrayMode::doesConversion):
(WTF):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupBlock):
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::checkArray):
(FixupPhase):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGNodeFlags.h:
(DFG):
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::arrayify):
* dfg/DFGStructureCheckHoistingPhase.cpp:
(JSC::DFG::StructureCheckHoistingPhase::run):
* runtime/JSObject.cpp:
(JSC):
(JSC::JSObject::genericConvertDoubleToContiguous):
(JSC::JSObject::convertDoubleToContiguous):
(JSC::JSObject::rageConvertDoubleToContiguous):
(JSC::JSObject::ensureContiguousSlow):
(JSC::JSObject::rageEnsureContiguousSlow):
* runtime/JSObject.h:
(JSObject):
(JSC::JSObject::rageEnsureContiguous):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136372 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS Device Adaptation: window.innerWidth returns wrong value if CSS viewport descriptors are applied
https://bugs.webkit.org/show_bug.cgi?id=103737

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-12-03
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

ViewportStyleResolver used frame view visibleContentRect size as initial viewport size.
This however caused a problem when page enabled/disabled CSS stylesheets, having viewport
descriptors. Viewport descriptors from new stylesheet were applied to the visibleContentRect
affected already by the viewport descriptors from the previous stylesheet.

New 'initialViewportSize' property (http://dev.w3.org/csswg/css-device-adapt/#initial-viewport)
was added to frame view so that viewport descriptors can always be applied to the reliable
viewport size.

Test: css3/device-adapt/viewport-width-check-window-innerwidth-correct.html

* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::ViewportStyleResolver):
(WebCore::ViewportStyleResolver::getViewportArgumentValue):
* css/ViewportStyleResolver.h:
(ViewportStyleResolver):
* dom/Document.cpp:
(WebCore):
(WebCore::Document::initialViewportSize):
* dom/Document.h:
(Document):
* page/FrameView.h:
(FrameView):
(WebCore::FrameView::initialViewportSize):
(WebCore::FrameView::setInitialViewportSize):

Source/WebKit2:

ViewportStyleResolver used frame view visibleContentRect size as initial viewport size.
This however caused a problem when page enabled/disabled CSS stylesheets, having viewport
descriptors. Viewport descriptors from new stylesheet were applied to the visibleContentRect
affected already by the viewport descriptors from the previous stylesheet.

New 'initialViewportSize' property (http://dev.w3.org/csswg/css-device-adapt/#initial-viewport)
was added to frame view so that viewport descriptors can always be applied to the reliable
viewport size.

Both newly added 'initialViewportSize' property and 'fixedVisibleContentRect' property
are assigned appropriately now in WebPage::sendViewportAttributesChanged().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::sendViewportAttributesChanged):

LayoutTests:

Added new test css3/device-adapt/viewport-width-check-window-innerwidth-correct.html.

* css3/device-adapt/viewport-width-check-window-innerwidth-correct-expected.txt: Added.
* css3/device-adapt/viewport-width-check-window-innerwidth-correct.html: Added.

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