[V8] String wrappers should be marked Independent
https://bugs.webkit.org/show_bug.cgi?id=91251

Reviewed by Adam Barth.

Currently V8 String wrappers are not marked Independent.
By marking them Independent, they can be reclaimed by the scavenger GC.
Although I couldn't find a case where this change reduces memory usage,
this change would be important for upcoming changes in string conversion
between V8 and WebKit (https://bugs.webkit.org/show_bug.cgi?id=91850).

'm_lastStringImpl = 0' in StringCache::remove() is important.
Look at the following code:

    static void cachedStringCallback(v8::Persistent<v8::Value> wrapper, void* parameter)
    {
        ...;
        stringCache()->remove(stringImpl);
        wrapper.Dispose();
    }

    void StringCache::remove(StringImpl* stringImpl)
    {
        ...
        if (m_lastStringImpl.get() == stringImpl)
            m_lastStringImpl = 0;
    }

    v8::Local<v8::String> v8ExternalString(StringImpl* stringImpl, v8::Isolate* isolate)
    {
        if (m_lastStringImpl.get() == stringImpl) {
            return v8::Local<v8::String>::New(m_lastV8String); // m_lastV8String points to a wrapper object that was accessed most recently.
        }
        return v8ExternalStringSlow(stringImpl, isolate);
    }

Without 'm_lastStringImpl = 0', already disposed m_lastV8String can be used
in v8ExternalString(). This was a cause of the crashes of r122614.

Tests: At the initial commit of this patch (r122614),
       the following tests had been broken due to missing 'm_lastStringImpl = 0'.
       fast/workers/worker-location.html
       Dromaeo/cssquery-jquery.html
       Dromaeo/jslib-event-jquery.html
       Dromaeo/jslib-style-jquery.html
       Dromaeo/jslib-style-prototype.html

* bindings/v8/V8Binding.cpp:
(WebCore::StringCache::remove):
(WebCore::StringCache::v8ExternalStringSlow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Re-skip failing tests for Qt 4.8 platform
https://bugs.webkit.org/show_bug.cgi?id=92119

Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-07-24
Reviewed by Alexis Menard.

The following tests, after unskipping, are now passing on Qt-5.0 build bot
variations, but still failing for Qt-4.8 ones:

Regressions: Unexpected text diff mismatch : (1)
  http/tests/misc/acid3.html = TEXT

Regressions: Unexpected image mismatch : (2)
  fast/css/tab-size.html = IMAGE
  fast/text/international/bdi-dir-default-to-auto.html = IMAGE

This patch adds these to Skipped list of qt-4.8 platform.

* platform/qt-4.8/Skipped: Added 3 layout tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123502 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WIN] Build fix after r123417.

* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Do not perform 8 to 16bits characters conversion when converting a WTFString to NSString/CFString
https://bugs.webkit.org/show_bug.cgi?id=90720

Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-07-24
Reviewed by Geoffrey Garen.

In most String to CFString conversion, we should be able to use the "NoCopy" constructor and have
a relatively cheap conversion from WTF::String to CFString.

When the String is 8 bits, it was converted to 16 bits by getData16SlowCase() because of the call
to String::characters().

This patch adds a path for creating a CFString from a 8bits string using CFStringCreateWithBytes.

This is covered by existing tests.

* platform/text/cf/StringCF.cpp:
(WTF::String::createCFString): CFSTR() create static CFString, it is unecessary to retain it.
* platform/text/cf/StringImplCF.cpp:
(WTF::StringImpl::createCFString): The logic to avoid the StringWrapperCFAllocator has also been simplified.
The allocator creation is now closer to where it is useful.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Store the full year in GregorianDateTime
https://bugs.webkit.org/show_bug.cgi?id=92067

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Use the full year instead of the offset from year 1900
for the year member variable of GregorianDateTime.

* runtime/DateConstructor.cpp:
(JSC::constructDate):
(JSC::dateUTC):
* runtime/DateConversion.cpp:
(JSC::formatDate):
(JSC::formatDateUTCVariant):
* runtime/DatePrototype.cpp:
(JSC::formatLocaleDate):
(JSC::fillStructuresUsingDateArgs):
(JSC::dateProtoFuncToISOString):
(JSC::dateProtoFuncGetFullYear):
(JSC::dateProtoFuncGetUTCFullYear):
(JSC::dateProtoFuncSetYear):
* runtime/JSDateMath.cpp:
(JSC::gregorianDateTimeToMS):
(JSC::msToGregorianDateTime):

Source/WebCore:

Use the full year instead of the offset from year 1900
for the year member variable of GregorianDateTime.

* bridge/qt/qt_runtime.cpp:
(JSC::Bindings::convertValueToQVariant):
(JSC::Bindings::convertQVariantToValue):
* bridge/qt/qt_runtime_qt4.cpp:
(JSC::Bindings::convertValueToQVariant):
(JSC::Bindings::convertQVariantToValue):

Source/WTF:

Use the full year instead of the offset from year 1900
for the year member variable of GregorianDateTime.

* wtf/GregorianDateTime.h:
(WTF::GregorianDateTime::operator tm):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WTR][EFL] Multiple mouse clicks are not emitted in EventSenderProxyEfl
https://bugs.webkit.org/show_bug.cgi?id=92107

Patch by Alexander Shalamov <alexander.shalamov@intel.com> on 2012-07-24
Reviewed by Kenneth Rohde Christiansen.

Fixes mouse click events in EventSenderProxyEfl.

* WebKitTestRunner/efl/EventSenderProxyEfl.cpp:
(WTR::dispatchMouseDownEvent):
(WTR::EventSenderProxy::dispatchEvent):

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