mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
minor JavaScriptCore cleanup
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
5ca675af90
commit
1a47673bdf
21 changed files with 24 additions and 112 deletions
|
@ -113,7 +113,7 @@ namespace JSC {
|
|||
|
||||
void sample(CodeBlock*, Instruction*);
|
||||
|
||||
#if COMPILER(WINSCW) || COMPILER(ACC)
|
||||
#if COMPILER(ACC)
|
||||
ScriptExecutable* m_executable;
|
||||
#else
|
||||
RefPtr<ScriptExecutable> m_executable;
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
7
src/3rdparty/javascriptcore/runtime/Lookup.h
vendored
7
src/3rdparty/javascriptcore/runtime/Lookup.h
vendored
|
@ -29,13 +29,6 @@
|
|||
#include <stdio.h>
|
||||
#include <wtf/Assertions.h>
|
||||
|
||||
// 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.
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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*);
|
||||
|
||||
|
|
|
@ -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); }
|
||||
|
||||
|
|
12
src/3rdparty/javascriptcore/wtf/PassRefPtr.h
vendored
12
src/3rdparty/javascriptcore/wtf/PassRefPtr.h
vendored
|
@ -28,15 +28,9 @@ namespace WTF {
|
|||
template<typename T> class RefPtr;
|
||||
template<typename T> class PassRefPtr;
|
||||
template <typename T> PassRefPtr<T> adoptRef(T*);
|
||||
|
||||
// Remove inline for winscw compiler to prevent the compiler agressively resolving
|
||||
// T::deref(), which will fail compiling when PassRefPtr<T> is used as class member
|
||||
// or function arguments before T is defined.
|
||||
template<typename T>
|
||||
#if !COMPILER(WINSCW)
|
||||
inline
|
||||
#endif
|
||||
void derefIfNotNull(T* ptr)
|
||||
|
||||
template<typename T>
|
||||
inline void derefIfNotNull(T* ptr)
|
||||
{
|
||||
if (Q_UNLIKELY(ptr != 0))
|
||||
ptr->deref();
|
||||
|
|
5
src/3rdparty/javascriptcore/wtf/Platform.h
vendored
5
src/3rdparty/javascriptcore/wtf/Platform.h
vendored
|
@ -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
|
||||
|
|
12
src/3rdparty/javascriptcore/wtf/RefPtr.h
vendored
12
src/3rdparty/javascriptcore/wtf/RefPtr.h
vendored
|
@ -24,9 +24,6 @@
|
|||
#include <algorithm>
|
||||
#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<T>(ptr); }
|
||||
#else
|
||||
~RefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
|
||||
#endif
|
||||
|
||||
template <typename U> RefPtr(const RefPtr<U>& 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<T>(ptr); m_ptr = 0; }
|
||||
#else
|
||||
void clear() { if (T* ptr = m_ptr) ptr->deref(); m_ptr = 0; }
|
||||
#endif
|
||||
|
||||
PassRefPtr<T> release() { PassRefPtr<T> tmp = adoptRef(m_ptr); m_ptr = 0; return tmp; }
|
||||
|
||||
T& operator*() const { return *m_ptr; }
|
||||
|
|
45
src/3rdparty/javascriptcore/wtf/StringExtras.h
vendored
45
src/3rdparty/javascriptcore/wtf/StringExtras.h
vendored
|
@ -31,51 +31,6 @@
|
|||
|
||||
#if HAVE(STRINGS_H)
|
||||
#include <strings.h>
|
||||
#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)
|
||||
|
|
Loading…
Add table
Reference in a new issue