From 1a47673bdf912ca67d2b6598a309ed1fa022a020 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Tue, 25 Apr 2017 11:38:55 +0000 Subject: [PATCH] minor JavaScriptCore cleanup Signed-off-by: Ivailo Monev --- .../javascriptcore/bytecode/SamplingTool.h | 2 +- src/3rdparty/javascriptcore/create_hash_table | 2 +- .../generated/ArrayPrototype.lut.h | 2 +- .../generated/DatePrototype.lut.h | 2 +- .../javascriptcore/generated/JSONObject.lut.h | 2 +- .../javascriptcore/generated/Lexer.lut.h | 2 +- .../javascriptcore/generated/MathObject.lut.h | 2 +- .../generated/NumberConstructor.lut.h | 2 +- .../generated/RegExpConstructor.lut.h | 2 +- .../generated/RegExpObject.lut.h | 2 +- .../generated/StringPrototype.lut.h | 2 +- .../javascriptcore/runtime/JSGlobalData.cpp | 16 +++---- src/3rdparty/javascriptcore/runtime/Lookup.h | 7 --- .../javascriptcore/runtime/Structure.h | 7 --- .../javascriptcore/runtime/UStringImpl.h | 2 +- .../javascriptcore/runtime/WeakGCPtr.h | 4 -- src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h | 4 -- src/3rdparty/javascriptcore/wtf/PassRefPtr.h | 12 ++--- src/3rdparty/javascriptcore/wtf/Platform.h | 5 --- src/3rdparty/javascriptcore/wtf/RefPtr.h | 12 +---- .../javascriptcore/wtf/StringExtras.h | 45 ------------------- 21 files changed, 24 insertions(+), 112 deletions(-) diff --git a/src/3rdparty/javascriptcore/bytecode/SamplingTool.h b/src/3rdparty/javascriptcore/bytecode/SamplingTool.h index 12741ee0a..b68cfbad5 100644 --- a/src/3rdparty/javascriptcore/bytecode/SamplingTool.h +++ b/src/3rdparty/javascriptcore/bytecode/SamplingTool.h @@ -113,7 +113,7 @@ namespace JSC { void sample(CodeBlock*, Instruction*); -#if COMPILER(WINSCW) || COMPILER(ACC) +#if COMPILER(ACC) ScriptExecutable* m_executable; #else RefPtr m_executable; diff --git a/src/3rdparty/javascriptcore/create_hash_table b/src/3rdparty/javascriptcore/create_hash_table index 4184500ed..9a3ac9fb4 100755 --- a/src/3rdparty/javascriptcore/create_hash_table +++ b/src/3rdparty/javascriptcore/create_hash_table @@ -268,7 +268,7 @@ sub output() { } print " { 0, 0, 0, 0 }\n"; print "};\n\n"; - print "extern JSC_CONST_HASHTABLE HashTable $name =\n"; + print "extern const HashTable $name =\n"; print " \{ $compactSize, $compactHashSizeMask, $nameEntries, 0 \};\n"; print "} // namespace\n"; } diff --git a/src/3rdparty/javascriptcore/generated/ArrayPrototype.lut.h b/src/3rdparty/javascriptcore/generated/ArrayPrototype.lut.h index 98b309d18..eb066f192 100644 --- a/src/3rdparty/javascriptcore/generated/ArrayPrototype.lut.h +++ b/src/3rdparty/javascriptcore/generated/ArrayPrototype.lut.h @@ -29,6 +29,6 @@ static const struct HashTableValue arrayTableValues[22] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable arrayTable = +extern const HashTable arrayTable = { 65, 63, arrayTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/DatePrototype.lut.h b/src/3rdparty/javascriptcore/generated/DatePrototype.lut.h index 7f0d39690..121051ce8 100644 --- a/src/3rdparty/javascriptcore/generated/DatePrototype.lut.h +++ b/src/3rdparty/javascriptcore/generated/DatePrototype.lut.h @@ -54,6 +54,6 @@ static const struct HashTableValue dateTableValues[47] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable dateTable = +extern const HashTable dateTable = { 134, 127, dateTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/JSONObject.lut.h b/src/3rdparty/javascriptcore/generated/JSONObject.lut.h index 5513e11bd..7c6dcf513 100644 --- a/src/3rdparty/javascriptcore/generated/JSONObject.lut.h +++ b/src/3rdparty/javascriptcore/generated/JSONObject.lut.h @@ -10,6 +10,6 @@ static const struct HashTableValue jsonTableValues[3] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable jsonTable = +extern const HashTable jsonTable = { 4, 3, jsonTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/Lexer.lut.h b/src/3rdparty/javascriptcore/generated/Lexer.lut.h index 7edf514f6..196986c0b 100644 --- a/src/3rdparty/javascriptcore/generated/Lexer.lut.h +++ b/src/3rdparty/javascriptcore/generated/Lexer.lut.h @@ -42,6 +42,6 @@ static const struct HashTableValue mainTableValues[37] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable mainTable = +extern const HashTable mainTable = { 133, 127, mainTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/MathObject.lut.h b/src/3rdparty/javascriptcore/generated/MathObject.lut.h index a244a863e..6b0d2e1d5 100644 --- a/src/3rdparty/javascriptcore/generated/MathObject.lut.h +++ b/src/3rdparty/javascriptcore/generated/MathObject.lut.h @@ -26,6 +26,6 @@ static const struct HashTableValue mathTableValues[19] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable mathTable = +extern const HashTable mathTable = { 67, 63, mathTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/NumberConstructor.lut.h b/src/3rdparty/javascriptcore/generated/NumberConstructor.lut.h index 5d1027dd3..39c84c31f 100644 --- a/src/3rdparty/javascriptcore/generated/NumberConstructor.lut.h +++ b/src/3rdparty/javascriptcore/generated/NumberConstructor.lut.h @@ -13,6 +13,6 @@ static const struct HashTableValue numberTableValues[6] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable numberTable = +extern const HashTable numberTable = { 16, 15, numberTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/RegExpConstructor.lut.h b/src/3rdparty/javascriptcore/generated/RegExpConstructor.lut.h index f3aff7b36..d46316227 100644 --- a/src/3rdparty/javascriptcore/generated/RegExpConstructor.lut.h +++ b/src/3rdparty/javascriptcore/generated/RegExpConstructor.lut.h @@ -29,6 +29,6 @@ static const struct HashTableValue regExpConstructorTableValues[22] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable regExpConstructorTable = +extern const HashTable regExpConstructorTable = { 65, 63, regExpConstructorTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/RegExpObject.lut.h b/src/3rdparty/javascriptcore/generated/RegExpObject.lut.h index 789604c08..95795b74e 100644 --- a/src/3rdparty/javascriptcore/generated/RegExpObject.lut.h +++ b/src/3rdparty/javascriptcore/generated/RegExpObject.lut.h @@ -13,6 +13,6 @@ static const struct HashTableValue regExpTableValues[6] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable regExpTable = +extern const HashTable regExpTable = { 17, 15, regExpTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/generated/StringPrototype.lut.h b/src/3rdparty/javascriptcore/generated/StringPrototype.lut.h index 2c0f40df0..2326dadd8 100644 --- a/src/3rdparty/javascriptcore/generated/StringPrototype.lut.h +++ b/src/3rdparty/javascriptcore/generated/StringPrototype.lut.h @@ -43,6 +43,6 @@ static const struct HashTableValue stringTableValues[36] = { { 0, 0, 0, 0 } }; -extern JSC_CONST_HASHTABLE HashTable stringTable = +extern const HashTable stringTable = { 133, 127, stringTableValues, 0 }; } // namespace diff --git a/src/3rdparty/javascriptcore/runtime/JSGlobalData.cpp b/src/3rdparty/javascriptcore/runtime/JSGlobalData.cpp index e2e4e53b2..d42365582 100644 --- a/src/3rdparty/javascriptcore/runtime/JSGlobalData.cpp +++ b/src/3rdparty/javascriptcore/runtime/JSGlobalData.cpp @@ -53,14 +53,14 @@ using namespace WTF; namespace JSC { -extern JSC_CONST_HASHTABLE HashTable arrayTable; -extern JSC_CONST_HASHTABLE HashTable jsonTable; -extern JSC_CONST_HASHTABLE HashTable dateTable; -extern JSC_CONST_HASHTABLE HashTable mathTable; -extern JSC_CONST_HASHTABLE HashTable numberTable; -extern JSC_CONST_HASHTABLE HashTable regExpTable; -extern JSC_CONST_HASHTABLE HashTable regExpConstructorTable; -extern JSC_CONST_HASHTABLE HashTable stringTable; +extern const HashTable arrayTable; +extern const HashTable jsonTable; +extern const HashTable dateTable; +extern const HashTable mathTable; +extern const HashTable numberTable; +extern const HashTable regExpTable; +extern const HashTable regExpConstructorTable; +extern const HashTable stringTable; void* JSGlobalData::jsArrayVPtr; void* JSGlobalData::jsByteArrayVPtr; diff --git a/src/3rdparty/javascriptcore/runtime/Lookup.h b/src/3rdparty/javascriptcore/runtime/Lookup.h index 712269cc2..b8c6902f8 100644 --- a/src/3rdparty/javascriptcore/runtime/Lookup.h +++ b/src/3rdparty/javascriptcore/runtime/Lookup.h @@ -29,13 +29,6 @@ #include #include -// Bug #26843: Work around Metrowerks compiler bug -#if COMPILER(WINSCW) -#define JSC_CONST_HASHTABLE -#else -#define JSC_CONST_HASHTABLE const -#endif - namespace JSC { // Hash table generated by the create_hash_table script. diff --git a/src/3rdparty/javascriptcore/runtime/Structure.h b/src/3rdparty/javascriptcore/runtime/Structure.h index 27f66f1ef..945df437c 100644 --- a/src/3rdparty/javascriptcore/runtime/Structure.h +++ b/src/3rdparty/javascriptcore/runtime/Structure.h @@ -214,14 +214,7 @@ namespace JSC { bool m_isPinnedPropertyTable : 1; bool m_hasGetterSetterProperties : 1; bool m_hasNonEnumerableProperties : 1; -#if COMPILER(WINSCW) - // Workaround for Symbian WINSCW compiler that cannot resolve unsigned type of the declared - // bitfield, when used as argument in make_pair() function calls in structure.ccp. - // This bitfield optimization is insignificant for the Symbian emulator target. - unsigned m_attributesInPrevious; -#else unsigned m_attributesInPrevious : 7; -#endif unsigned m_anonymousSlotsInPrevious : 6; unsigned m_specificFunctionThrashCount : 2; // 4 free bits diff --git a/src/3rdparty/javascriptcore/runtime/UStringImpl.h b/src/3rdparty/javascriptcore/runtime/UStringImpl.h index 1bbbeeb53..3ccab3eb2 100644 --- a/src/3rdparty/javascriptcore/runtime/UStringImpl.h +++ b/src/3rdparty/javascriptcore/runtime/UStringImpl.h @@ -221,7 +221,7 @@ private: #if OS(SOLARIS) && COMPILER(SUNCC) public: // Otherwise the compiler complains about operator new not being accessible. #endif -#if COMPILER(WINSCW) || COMPILER(XLC) +#if COMPILER(XLC) void* operator new(size_t size) { return Noncopyable::operator new(size); } #else using Noncopyable::operator new; diff --git a/src/3rdparty/javascriptcore/runtime/WeakGCPtr.h b/src/3rdparty/javascriptcore/runtime/WeakGCPtr.h index 86537211f..9a5fe5ae4 100644 --- a/src/3rdparty/javascriptcore/runtime/WeakGCPtr.h +++ b/src/3rdparty/javascriptcore/runtime/WeakGCPtr.h @@ -52,12 +52,8 @@ public: bool operator!() const { return !get(); } // This conversion operator allows implicit conversion to bool but not to other integer types. -#if COMPILER(WINSCW) - operator bool() const { return m_ptr; } -#else typedef T* WeakGCPtr::*UnspecifiedBoolType; operator UnspecifiedBoolType() const { return get() ? &WeakGCPtr::m_ptr : 0; } -#endif WeakGCPtr& operator=(T*); diff --git a/src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h b/src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h index 850ca84af..2b55aa9c1 100644 --- a/src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h +++ b/src/3rdparty/javascriptcore/wtf/OwnArrayPtr.h @@ -46,12 +46,8 @@ namespace WTF { bool operator!() const { return !m_ptr; } // This conversion operator allows implicit conversion to bool but not to other integer types. -#if COMPILER(WINSCW) - operator bool() const { return m_ptr; } -#else typedef T* OwnArrayPtr::*UnspecifiedBoolType; operator UnspecifiedBoolType() const { return m_ptr ? &OwnArrayPtr::m_ptr : 0; } -#endif void swap(OwnArrayPtr& o) { std::swap(m_ptr, o.m_ptr); } diff --git a/src/3rdparty/javascriptcore/wtf/PassRefPtr.h b/src/3rdparty/javascriptcore/wtf/PassRefPtr.h index 5b31e3952..f22053999 100644 --- a/src/3rdparty/javascriptcore/wtf/PassRefPtr.h +++ b/src/3rdparty/javascriptcore/wtf/PassRefPtr.h @@ -28,15 +28,9 @@ namespace WTF { template class RefPtr; template class PassRefPtr; template PassRefPtr adoptRef(T*); - - // Remove inline for winscw compiler to prevent the compiler agressively resolving - // T::deref(), which will fail compiling when PassRefPtr is used as class member - // or function arguments before T is defined. - template -#if !COMPILER(WINSCW) - inline -#endif - void derefIfNotNull(T* ptr) + + template + inline void derefIfNotNull(T* ptr) { if (Q_UNLIKELY(ptr != 0)) ptr->deref(); diff --git a/src/3rdparty/javascriptcore/wtf/Platform.h b/src/3rdparty/javascriptcore/wtf/Platform.h index 8502d438f..d639203c8 100644 --- a/src/3rdparty/javascriptcore/wtf/Platform.h +++ b/src/3rdparty/javascriptcore/wtf/Platform.h @@ -109,11 +109,6 @@ #define WTF_COMPILER_SUNCC 1 #endif -/* COMPILER(WINSCW) - CodeWarrior for Symbian emulator */ -#if defined(__WINSCW__) -#define WTF_COMPILER_WINSCW 1 -#endif - /* COMPILER(INTEL) - Intel C++ Compiler */ #if defined(__INTEL_COMPILER) #define WTF_COMPILER_INTEL 1 diff --git a/src/3rdparty/javascriptcore/wtf/RefPtr.h b/src/3rdparty/javascriptcore/wtf/RefPtr.h index 198f6d3ac..480d56707 100644 --- a/src/3rdparty/javascriptcore/wtf/RefPtr.h +++ b/src/3rdparty/javascriptcore/wtf/RefPtr.h @@ -24,9 +24,6 @@ #include #include "AlwaysInline.h" #include "FastAllocBase.h" -#if COMPILER(WINSCW) -#include "PassRefPtr.h" -#endif namespace WTF { @@ -53,21 +50,14 @@ namespace WTF { RefPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue(); } -#if COMPILER(WINSCW) - ~RefPtr() { if (T* ptr = m_ptr) derefIfNotNull(ptr); } -#else ~RefPtr() { if (T* ptr = m_ptr) ptr->deref(); } -#endif template RefPtr(const RefPtr& o) : m_ptr(o.get()) { if (T* ptr = m_ptr) ptr->ref(); } T* get() const { return m_ptr; } -#if COMPILER(WINSCW) - void clear() { if (T* ptr = m_ptr) derefIfNotNull(ptr); m_ptr = 0; } -#else void clear() { if (T* ptr = m_ptr) ptr->deref(); m_ptr = 0; } -#endif + PassRefPtr release() { PassRefPtr tmp = adoptRef(m_ptr); m_ptr = 0; return tmp; } T& operator*() const { return *m_ptr; } diff --git a/src/3rdparty/javascriptcore/wtf/StringExtras.h b/src/3rdparty/javascriptcore/wtf/StringExtras.h index 8c53bc0a0..6bde6dca9 100644 --- a/src/3rdparty/javascriptcore/wtf/StringExtras.h +++ b/src/3rdparty/javascriptcore/wtf/StringExtras.h @@ -31,51 +31,6 @@ #if HAVE(STRINGS_H) #include -#endif - -#if COMPILER(MSVC) -// FIXME: why a COMPILER check instead of OS? also, these should be HAVE checks - -# if _MSC_VER < 1900 -inline int snprintf(char* buffer, size_t count, const char* format, ...) -{ - int result; - va_list args; - va_start(args, format); - result = _vsnprintf(buffer, count, format, args); - va_end(args); - return result; -} -# endif // _MSC_VER < 1900 - -#if COMPILER(MSVC7) || OS(WINCE) - -inline int vsnprintf(char* buffer, size_t count, const char* format, va_list args) -{ - return _vsnprintf(buffer, count, format, args); -} - -#endif - -#if OS(WINCE) - -inline int strnicmp(const char* string1, const char* string2, size_t count) -{ - return _strnicmp(string1, string2, count); -} - -inline int stricmp(const char* string1, const char* string2) -{ - return _stricmp(string1, string2); -} - -inline char* strdup(const char* strSource) -{ - return _strdup(strSource); -} - -#endif - #endif #if OS(WINDOWS) || OS(LINUX) || OS(SOLARIS)