diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-07-11 13:45:28 +0200 |
commit | d6a599dbc9d824a462b2b206316e102bf8136446 (patch) | |
tree | ecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/JavaScriptCore/runtime/JSGlobalData.h | |
parent | 3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff) | |
download | qtwebkit-d6a599dbc9d824a462b2b206316e102bf8136446.tar.gz |
Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325)
New snapshot that should work with the latest Qt build system changes
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalData.h')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalData.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.h b/Source/JavaScriptCore/runtime/JSGlobalData.h index f8833104a..90925778b 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalData.h +++ b/Source/JavaScriptCore/runtime/JSGlobalData.h @@ -35,6 +35,7 @@ #include "Heap.h" #include "Intrinsic.h" #include "JITStubs.h" +#include "JSLock.h" #include "JSValue.h" #include "LLIntData.h" #include "NumericStrings.h" @@ -46,8 +47,8 @@ #include <wtf/BumpPointerAllocator.h> #include <wtf/Forward.h> #include <wtf/HashMap.h> -#include <wtf/RefCounted.h> #include <wtf/SimpleStats.h> +#include <wtf/ThreadSafeRefCounted.h> #include <wtf/ThreadSpecific.h> #include <wtf/WTFThreadData.h> #if ENABLE(REGEXP_TRACING) @@ -152,7 +153,7 @@ namespace JSC { }; #endif - class JSGlobalData : public RefCounted<JSGlobalData> { + class JSGlobalData : public ThreadSafeRefCounted<JSGlobalData> { public: // WebCore has a one-to-one mapping of threads to JSGlobalDatas; // either create() or createLeaked() should only be called once @@ -180,6 +181,10 @@ namespace JSC { void makeUsableFromMultipleThreads() { heap.machineThreads().makeUsableFromMultipleThreads(); } + private: + JSLock m_apiLock; + + public: Heap heap; // The heap is our first data member to ensure that it's destructed after all the objects that reference it. GlobalDataType globalDataType; @@ -390,6 +395,13 @@ namespace JSC { unsigned m_timeoutCount; #endif + unsigned m_newStringsSinceLastHashConst; + + static const unsigned s_minNumberOfNewStringsToHashConst = 100; + + bool haveEnoughNewStringsToHashConst() { return m_newStringsSinceLastHashConst > s_minNumberOfNewStringsToHashConst; } + void resetNewStringsSinceLastHashConst() { m_newStringsSinceLastHashConst = 0; } + #define registerTypedArrayFunction(type, capitalizedType) \ void registerTypedArrayDescriptor(const capitalizedType##Array*, const TypedArrayDescriptor& descriptor) \ { \ @@ -409,6 +421,8 @@ namespace JSC { registerTypedArrayFunction(float64, Float64); #undef registerTypedArrayFunction + JSLock& apiLock() { return m_apiLock; } + private: friend class LLIntOffsetsExtractor; |