diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:23:55 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-04-27 17:07:03 +0100 |
commit | 692e5dbf12901edacf14812a6fae25462920af42 (patch) | |
tree | d62802373a429e0a9dc093b6046c166b2c514285 /JavaScriptCore/API | |
parent | e24bea4efef1c414137d36a9778aa4e142e10c7d (diff) | |
download | external_webkit-692e5dbf12901edacf14812a6fae25462920af42.zip external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.gz external_webkit-692e5dbf12901edacf14812a6fae25462920af42.tar.bz2 |
Merge webkit.org at r55033 : Initial merge by git
Change-Id: I98a4af828067cc243ec3dc5e5826154dd88074b5
Diffstat (limited to 'JavaScriptCore/API')
-rw-r--r-- | JavaScriptCore/API/APIShims.h | 2 | ||||
-rw-r--r-- | JavaScriptCore/API/JSClassRef.cpp | 12 | ||||
-rw-r--r-- | JavaScriptCore/API/JSContextRef.cpp | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/JavaScriptCore/API/APIShims.h b/JavaScriptCore/API/APIShims.h index d7276ec..9a6cacb 100644 --- a/JavaScriptCore/API/APIShims.h +++ b/JavaScriptCore/API/APIShims.h @@ -80,12 +80,10 @@ public: , m_globalData(&exec->globalData()) { resetCurrentIdentifierTable(); - m_globalData->timeoutChecker.start(); } ~APICallbackShim() { - m_globalData->timeoutChecker.stop(); setCurrentIdentifierTable(m_globalData->identifierTable); } diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp index 747aa16..717488f 100644 --- a/JavaScriptCore/API/JSClassRef.cpp +++ b/JavaScriptCore/API/JSClassRef.cpp @@ -82,7 +82,9 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* if (!valueName.isNull()) { // Use a local variable here to sidestep an RVCT compiler bug. StaticValueEntry* entry = new StaticValueEntry(staticValue->getProperty, staticValue->setProperty, staticValue->attributes); - m_staticValues->add(valueName.rep()->ref(), entry); + UStringImpl* impl = valueName.rep(); + impl->ref(); + m_staticValues->add(impl, entry); } ++staticValue; } @@ -95,7 +97,9 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* if (!functionName.isNull()) { // Use a local variable here to sidestep an RVCT compiler bug. StaticFunctionEntry* entry = new StaticFunctionEntry(staticFunction->callAsFunction, staticFunction->attributes); - m_staticFunctions->add(functionName.rep()->ref(), entry); + UStringImpl* impl = functionName.rep(); + impl->ref(); + m_staticFunctions->add(impl, entry); } ++staticFunction; } @@ -167,7 +171,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) ASSERT(!it->first->isIdentifier()); // Use a local variable here to sidestep an RVCT compiler bug. StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes); - staticValues->add(UString::Rep::create(it->first->data(), it->first->size()), entry); + staticValues->add(UString::Rep::create(it->first->data(), it->first->length()), entry); } } else staticValues = 0; @@ -179,7 +183,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) ASSERT(!it->first->isIdentifier()); // Use a local variable here to sidestep an RVCT compiler bug. StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes); - staticFunctions->add(UString::Rep::create(it->first->data(), it->first->size()), entry); + staticFunctions->add(UString::Rep::create(it->first->data(), it->first->length()), entry); } } else diff --git a/JavaScriptCore/API/JSContextRef.cpp b/JavaScriptCore/API/JSContextRef.cpp index 6bdc3c8..2c76338 100644 --- a/JavaScriptCore/API/JSContextRef.cpp +++ b/JavaScriptCore/API/JSContextRef.cpp @@ -120,11 +120,13 @@ JSGlobalContextRef JSGlobalContextRetain(JSGlobalContextRef ctx) void JSGlobalContextRelease(JSGlobalContextRef ctx) { ExecState* exec = toJS(ctx); - APIEntryShim entryShim(exec, false); + JSLock lock(exec); + + JSGlobalData& globalData = exec->globalData(); + IdentifierTable* savedIdentifierTable = setCurrentIdentifierTable(globalData.identifierTable); gcUnprotect(exec->dynamicGlobalObject()); - JSGlobalData& globalData = exec->globalData(); if (globalData.refCount() == 2) { // One reference is held by JSGlobalObject, another added by JSGlobalContextRetain(). // The last reference was released, this is our last chance to collect. globalData.heap.destroy(); @@ -132,6 +134,8 @@ void JSGlobalContextRelease(JSGlobalContextRef ctx) globalData.heap.collectAllGarbage(); globalData.deref(); + + setCurrentIdentifierTable(savedIdentifierTable); } JSObjectRef JSContextGetGlobalObject(JSContextRef ctx) |