summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/runtime/JSGlobalData.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-07-11 13:45:28 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-07-11 13:45:28 +0200
commitd6a599dbc9d824a462b2b206316e102bf8136446 (patch)
treeecb257a5e55b2239d74b90fdad62fccd661cf286 /Source/JavaScriptCore/runtime/JSGlobalData.cpp
parent3ccc3a85f09a83557b391aae380d3bf5f81a2911 (diff)
downloadqtwebkit-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.cpp')
-rw-r--r--Source/JavaScriptCore/runtime/JSGlobalData.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalData.cpp b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
index 1fb90df40..dd05005c7 100644
--- a/Source/JavaScriptCore/runtime/JSGlobalData.cpp
+++ b/Source/JavaScriptCore/runtime/JSGlobalData.cpp
@@ -34,8 +34,10 @@
#include "CommonIdentifiers.h"
#include "DebuggerActivation.h"
#include "FunctionConstructor.h"
+#include "GCActivityCallback.h"
#include "GetterSetter.h"
#include "HostCallReturnValue.h"
+#include "IncrementalSweeper.h"
#include "Interpreter.h"
#include "JSActivation.h"
#include "JSAPIValueWrapper.h"
@@ -97,7 +99,7 @@ extern const HashTable stringConstructorTable;
#if ENABLE(ASSEMBLER) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
static bool enableAssembler(ExecutableAllocator& executableAllocator)
{
- if (!executableAllocator.isValid() || !Options::useJIT)
+ if (!executableAllocator.isValid() || !Options::useJIT())
return false;
#if USE(CF)
@@ -168,6 +170,7 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
#if CPU(X86) && ENABLE(JIT)
, m_timeoutCount(512)
#endif
+ , m_newStringsSinceLastHashConst(0)
#if ENABLE(ASSEMBLER) && (ENABLE(CLASSIC_INTERPRETER) || ENABLE(LLINT))
, m_canUseAssembler(enableAssembler(executableAllocator))
#endif
@@ -178,12 +181,9 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
{
interpreter = new Interpreter;
- if (isSharedInstance())
- turnOffVerifier();
-
// Need to be careful to keep everything consistent here
+ JSLockHolder lock(this);
IdentifierTable* existingEntryIdentifierTable = wtfThreadData().setCurrentIdentifierTable(identifierTable);
- JSLock lock(SilenceAssertionsOnly);
structureStructure.set(*this, Structure::createStructure(*this));
debuggerActivationStructure.set(*this, DebuggerActivation::createStructure(*this, 0, jsNull()));
activationStructure.set(*this, JSActivation::createStructure(*this, 0, jsNull()));
@@ -222,6 +222,9 @@ JSGlobalData::JSGlobalData(GlobalDataType globalDataType, ThreadStackType thread
JSGlobalData::~JSGlobalData()
{
+ ASSERT(!m_apiLock.currentThreadIsHoldingLock());
+ heap.activityCallback()->didStartVMShutdown();
+ heap.sweeper()->didStartVMShutdown();
heap.lastChanceToFinalize();
delete interpreter;
@@ -311,6 +314,7 @@ bool JSGlobalData::sharedInstanceExists()
JSGlobalData& JSGlobalData::sharedInstance()
{
+ GlobalJSLock globalLock;
JSGlobalData*& instance = sharedInstanceInternal();
if (!instance) {
instance = adoptRef(new JSGlobalData(APIShared, ThreadStackTypeSmall, SmallHeap)).leakRef();
@@ -321,7 +325,6 @@ JSGlobalData& JSGlobalData::sharedInstance()
JSGlobalData*& JSGlobalData::sharedInstanceInternal()
{
- ASSERT(JSLock::currentThreadIsHoldingLock());
static JSGlobalData* sharedInstance;
return sharedInstance;
}