diff options
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/JavaScriptCore/runtime/JSObject.cpp | 6 | ||||
| -rw-r--r-- | Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp | 2 | ||||
| -rw-r--r-- | Source/JavaScriptCore/runtime/PropertyNameArray.h | 20 | ||||
| -rw-r--r-- | Source/WTF/wtf/Atomics.h | 24 | ||||
| -rw-r--r-- | Source/WebCore/WebCore.pri | 36 | ||||
| -rw-r--r-- | Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp | 1 | ||||
| -rw-r--r-- | Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp | 14 |
7 files changed, 48 insertions, 55 deletions
diff --git a/Source/JavaScriptCore/runtime/JSObject.cpp b/Source/JavaScriptCore/runtime/JSObject.cpp index 32adefd2f..e6f95bdfa 100644 --- a/Source/JavaScriptCore/runtime/JSObject.cpp +++ b/Source/JavaScriptCore/runtime/JSObject.cpp @@ -1423,6 +1423,7 @@ bool JSObject::getPropertySpecificValue(ExecState* exec, PropertyName propertyNa void JSObject::getPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { + propertyNames.setBaseObject(object); object->methodTable()->getOwnPropertyNames(object, exec, propertyNames, mode); if (object->prototype().isNull()) @@ -1513,7 +1514,12 @@ void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNa void JSObject::getOwnNonIndexPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified()); + + bool canCachePropertiesFromStructure = !propertyNames.size(); object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode); + + if (canCachePropertiesFromStructure) + propertyNames.setNumCacheableSlotsForObject(object, propertyNames.size()); } double JSObject::toNumber(ExecState* exec) const diff --git a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp index 225401fbd..496799501 100644 --- a/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp +++ b/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp @@ -54,7 +54,7 @@ JSPropertyNameIterator* JSPropertyNameIterator::create(ExecState* exec, JSObject size_t numCacheableSlots = 0; if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasGetterSetterProperties() && !o->structure()->isUncacheableDictionary() && !o->structure()->typeInfo().overridesGetPropertyNames()) - numCacheableSlots = o->structure()->totalStorageSize(); + numCacheableSlots = propertyNames.numCacheableSlots(); JSPropertyNameIterator* jsPropertyNameIterator = new (NotNull, allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots); jsPropertyNameIterator->finishCreation(exec, propertyNames.data(), o); diff --git a/Source/JavaScriptCore/runtime/PropertyNameArray.h b/Source/JavaScriptCore/runtime/PropertyNameArray.h index 89b1af00b..1cdac0049 100644 --- a/Source/JavaScriptCore/runtime/PropertyNameArray.h +++ b/Source/JavaScriptCore/runtime/PropertyNameArray.h @@ -55,12 +55,16 @@ namespace JSC { PropertyNameArray(JSGlobalData* globalData) : m_data(PropertyNameArrayData::create()) , m_globalData(globalData) + , m_numCacheableSlots(0) + , m_baseObject(0) { } PropertyNameArray(ExecState* exec) : m_data(PropertyNameArrayData::create()) , m_globalData(&exec->globalData()) + , m_numCacheableSlots(0) + , m_baseObject(0) { } @@ -83,12 +87,28 @@ namespace JSC { const_iterator begin() const { return m_data->propertyNameVector().begin(); } const_iterator end() const { return m_data->propertyNameVector().end(); } + size_t numCacheableSlots() const { return m_numCacheableSlots; } + void setNumCacheableSlotsForObject(JSObject* object, size_t numCacheableSlots) + { + if (object != m_baseObject) + return; + m_numCacheableSlots = numCacheableSlots; + } + void setBaseObject(JSObject* object) + { + if (m_baseObject) + return; + m_baseObject = object; + } + private: typedef HashSet<StringImpl*, PtrHash<StringImpl*> > IdentifierSet; RefPtr<PropertyNameArrayData> m_data; IdentifierSet m_set; JSGlobalData* m_globalData; + size_t m_numCacheableSlots; + JSObject* m_baseObject; }; } // namespace JSC diff --git a/Source/WTF/wtf/Atomics.h b/Source/WTF/wtf/Atomics.h index 750e1092a..d6cd88d88 100644 --- a/Source/WTF/wtf/Atomics.h +++ b/Source/WTF/wtf/Atomics.h @@ -65,18 +65,10 @@ #if OS(WINDOWS) #include <windows.h> -#elif OS(DARWIN) -#include <libkern/OSAtomic.h> #elif OS(QNX) #include <atomic.h> #elif OS(ANDROID) #include <sys/atomics.h> -#elif COMPILER(GCC) -#if ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))) && !defined(__LSB_VERSION__) -#include <ext/atomicity.h> -#else -#include <bits/atomicity.h> -#endif #endif namespace WTF { @@ -92,15 +84,6 @@ inline int atomicIncrement(int volatile* addend) { return InterlockedIncrement(r inline int atomicDecrement(int volatile* addend) { return InterlockedDecrement(reinterpret_cast<long volatile*>(addend)); } #endif -#elif OS(DARWIN) -#define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 - -inline int atomicIncrement(int volatile* addend) { return OSAtomicIncrement32Barrier(const_cast<int*>(addend)); } -inline int atomicDecrement(int volatile* addend) { return OSAtomicDecrement32Barrier(const_cast<int*>(addend)); } - -inline int64_t atomicIncrement(int64_t volatile* addend) { return OSAtomicIncrement64Barrier(const_cast<int64_t*>(addend)); } -inline int64_t atomicDecrement(int64_t volatile* addend) { return OSAtomicDecrement64Barrier(const_cast<int64_t*>(addend)); } - #elif OS(QNX) #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 @@ -118,8 +101,11 @@ inline int atomicDecrement(int volatile* addend) { return __atomic_dec(addend) - #elif COMPILER(GCC) && !CPU(SPARC64) // sizeof(_Atomic_word) != sizeof(int) on sparc64 gcc #define WTF_USE_LOCKFREE_THREADSAFEREFCOUNTED 1 -inline int atomicIncrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, 1) + 1; } -inline int atomicDecrement(int volatile* addend) { return __gnu_cxx::__exchange_and_add(addend, -1) - 1; } +inline int atomicIncrement(int volatile* addend) { return __sync_add_and_fetch(addend, 1); } +inline int atomicDecrement(int volatile* addend) { return __sync_sub_and_fetch(addend, 1); } + +inline int64_t atomicIncrement(int64_t volatile* addend) { return __sync_add_and_fetch(addend, 1); } +inline int64_t atomicDecrement(int64_t volatile* addend) { return __sync_sub_and_fetch(addend, 1); } #endif diff --git a/Source/WebCore/WebCore.pri b/Source/WebCore/WebCore.pri index b7cd93adf..cb9452356 100644 --- a/Source/WebCore/WebCore.pri +++ b/Source/WebCore/WebCore.pri @@ -177,41 +177,7 @@ use?(GSTREAMER) { } enable?(VIDEO) { - use?(QTKIT) { - INCLUDEPATH += $$SOURCE_DIR/platform/graphics/mac - - LIBS += -framework AppKit -framework AudioUnit \ - -framework AudioToolbox -framework CoreAudio \ - -framework QuartzCore -framework QTKit \ - -framework Security -framework IOKit - - DARWIN_VERSION = $$split(QMAKE_HOST.version, ".") - DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION) - - haveQt(5,1) { - equals(QMAKE_MAC_SDK_VERSION, 10.7): \ - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a - else:equals(QMAKE_MAC_SDK_VERSION, 10.8): \ - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a - } else { - # We first check if a specific SDK is set to be used for the build. - contains(QMAKE_MAC_SDK, ".*MacOSX10.7.sdk.*") { - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a - } else:contains(QMAKE_MAC_SDK, ".*MacOSX10.8.sdk.*") { - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a - } - - # If the previous check did not yield a result, we resort to the Darwin version. - isEmpty(SYSTEM_LIBRARY_PATH) { - equals(DARWIN_MAJOR_VERSION, "11") { - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceLion.a - } else:equals(DARWIN_MAJOR_VERSION, "12") { - SYSTEM_LIBRARY_PATH = $${ROOT_WEBKIT_DIR}/WebKitLibraries/libWebKitSystemInterfaceMountainLion.a - } - } - } - LIBS += $$SYSTEM_LIBRARY_PATH - } else:use?(GSTREAMER) { + use?(GSTREAMER) { INCLUDEPATH += $$SOURCE_DIR/platform/graphics/gstreamer } else:use?(QT_MULTIMEDIA) { QT *= multimedia diff --git a/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp b/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp index 470612c63..fc4b726fd 100644 --- a/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp +++ b/Source/WebCore/platform/qt/PlatformKeyboardEventQt.cpp @@ -602,6 +602,7 @@ static String keyTextForKeyEvent(const QKeyEvent* event) if (event->text().isNull()) return ASCIILiteral("\t"); break; + case Qt::Key_Return: case Qt::Key_Enter: if (event->text().isNull()) return ASCIILiteral("\r"); diff --git a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp index e5abf6b79..fe0332042 100644 --- a/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp +++ b/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp @@ -2322,6 +2322,20 @@ void tst_QWebPage::inputMethods() inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString(); QCOMPARE(inputValue2, QString("\n\nthird line")); + // Return Key without key text + page->mainFrame()->evaluateJavaScript("var inputEle = document.getElementById('input5'); inputEle.value = ''; inputEle.focus(); inputEle.select();"); + inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString(); + QCOMPARE(inputValue2, QString("")); + + QKeyEvent keyReturn(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); + page->event(&keyReturn); + page->event(&eventText); + page->event(&eventText2); + qApp->processEvents(); + + inputValue2 = page->mainFrame()->evaluateJavaScript("document.getElementById('input5').value").toString(); + QCOMPARE(inputValue2, QString("\n\nthird line")); + // END - Newline test for textarea delete container; |
