Allow implicit conversion from Ref<T> to T&
https://bugs.webkit.org/show_bug.cgi?id=138331

Reviewed by Andreas Kling.

Source/WebCore:

Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
converted implicitly to a T&.

No new tests, no behavior change.

Source/WebKit2:

Remove unnecessary calls to Ref<T>::get() now that a Ref<T> can be
converted implicitly to a T&.

Source/WTF:

Allow implicit conversion from Ref<T> to T& to reduce the amount of
Ref<>::get() calls in the code and increase readability. Unlike for
RefPtr, doing this for Ref should not be error prone.

* wtf/Ref.h:
(WTF::Ref::operator T&):
(WTF::Ref::operator const T&):
* wtf/RunLoop.cpp:
(WTF::RunLoop::Holder::runLoop):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Workaround for Cortex-A53 erratum 835769
https://bugs.webkit.org/show_bug.cgi?id=138315

Patch by Akos Kiss <akiss@inf.u-szeged.hu> on 2014-11-03
Reviewed by Filip Pizlo.

This patch introduces CMake variable and preprocessor macro
WTF_CPU_ARM64_CORTEXA53 with the aim of enabling Cortex-A53-specific
.:

code paths, if set true.

* Source/cmake/OptionsCommon.cmake:
Add -mfix-cortex-a53-835769 to the compiler flags if compiler supports
it.
* Source/cmakeconfig.h.cmake:
#cmakedefine01 for WTF_CPU_ARM64_CORTEXA53

Source/JavaScriptCore:

code paths, if set true. The patch also implements one case where such
code paths are needed: the workaround for Cortex-A53 erratum 835769. If
WTF_CPU_ARM64_CORTEXA53 is set then:
- CMake checks whether the compiler already has support for a workaround
  and adds -mfix-cortex-a53-835769 to the compiler flags if so,
- the ARM64 backend of offlineasm inserts a nop between memory and
  multiply-accumulate instructions, and
- the ARM64 assembler also inserts a nop between memory and (64-bit)
  multiply-accumulate instructions.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::madd):
Call nopCortexA53Fix835769() to insert a nop if CPU(ARM64_CORTEXA53) and
if necessary.
(JSC::ARM64Assembler::msub): Likewise.
(JSC::ARM64Assembler::smaddl): Likewise.
(JSC::ARM64Assembler::smsubl): Likewise.
(JSC::ARM64Assembler::umaddl): Likewise.
(JSC::ARM64Assembler::umsubl): Likewise.
(JSC::ARM64Assembler::nopCortexA53Fix835769):
Added. Insert a nop if the previously emitted instruction was a load, a
store, or a prefetch, and if the current instruction is 64-bit.
* offlineasm/arm64.rb:
Add the arm64CortexA53Fix835769 phase and call it from
getModifiedListARM64 to insert nopCortexA53Fix835769 between appropriate
macro instructions. Also, lower nopCortexA53Fix835769 to nop if
CPU(ARM64_CORTEXA53), to nothing otherwise.
* offlineasm/instructions.rb:
Define macro instruction nopFixCortexA53Err835769.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dictionary lookup panel pops up at random when clicking on selected text
https://bugs.webkit.org/show_bug.cgi?id=138353
<rdar://problem/18861406>

Reviewed by Andreas Kling.

* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::rangeForDictionaryLookupForSelection):
(WebKit::rangeForDictionaryLookupAtHitTestResult):
Factor rangeForDictionaryLookupForSelection out of performDictionaryLookupForSelection.

Make use of rangeForDictionaryLookupForSelection in rangeForDictionaryLookupAtHitTestResult,
returning the selection-based range if the hit test intersects the selected text.
Previously, we were just going forward with performDictionaryLookupForSelection,
which would actually *do* the lookup, even if we just wanted to retrieve the range.

Make rangeForDictionaryLookup* static.

(WebKit::WebPage::performDictionaryLookupForSelection):
Make use of rangeForDictionaryLookupForSelection.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@175517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Dictionary lookup panel pops up at random when clicking on selected text
https://bugs.webkit.org/show_bug.cgi?id=138353
<rdar://problem/18861406>

* WebProcess/WebPage/WebPage.h:
Fix the build; this needs to be public.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::rangeForDictionaryLookupAtHitTestResult):
Use the right selection (the one we just tested) in the change from r175517.


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