From d6a599dbc9d824a462b2b206316e102bf8136446 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 11 Jul 2012 13:45:28 +0200 Subject: Imported WebKit commit 8ff1f22783a32de82fee915abd55bd1b298f2644 (http://svn.webkit.org/repository/webkit/trunk@122325) New snapshot that should work with the latest Qt build system changes --- Source/JavaScriptCore/runtime/JSGlobalData.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSGlobalData.cpp') 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; } -- cgit v1.2.1