Ignore:
Timestamp:
Oct 7, 2009, 6:46:07 PM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore: Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
thread, permanently slowing down JavaScript

Patch by Geoffrey Garen <[email protected]> on 2009-10-07
Reviewed by Oliver Hunt.

Removed the optional lock from Heap::protect, Heap::unprotect, and friends,
since WebCore no longer uses it.

(JSC::Heap::protect):
(JSC::Heap::unprotect):
(JSC::Heap::markProtectedObjects):
(JSC::Heap::protectedGlobalObjectCount):
(JSC::Heap::protectedObjectCount):
(JSC::Heap::protectedObjectTypeCounts):

  • runtime/Collector.h:

WebCore: Fixed <rdar://problem/5751979> Database code takes JSLock on secondary
thread, permanently slowing down JavaScript

Patch by Geoffrey Garen <[email protected]> on 2009-10-07
Reviewed by Oliver Hunt.

Changed callback objects to use a standard helper object. The helper
object ASSERTs that it is deleted on the main thread, so no lock is
required when unprotecting its members. It also centralizes some previously
duplicated code.

Callback objects that might be deleted on a secondary thread use
callOnMainThread to delete their helper objects on the main thread.

  • WebCore.xcodeproj/project.pbxproj:
  • bindings/js/JSCallbackData.cpp: Copied from bindings/js/JSCustomSQLTransactionCallback.cpp.

(WebCore::JSCallbackData::deleteData):
(WebCore::JSCallbackData::invokeCallback):

  • bindings/js/JSCallbackData.h: Copied from bindings/js/JSCustomSQLTransactionCallback.cpp.

(WebCore::JSCallbackData::JSCallbackData):
(WebCore::JSCallbackData::~JSCallbackData):
(WebCore::JSCallbackData::callback):

  • bindings/js/JSCustomPositionCallback.cpp:

(WebCore::JSCustomPositionCallback::JSCustomPositionCallback):
(WebCore::JSCustomPositionCallback::handleEvent):

  • bindings/js/JSCustomPositionCallback.h:
  • bindings/js/JSCustomPositionErrorCallback.cpp:

(WebCore::JSCustomPositionErrorCallback::JSCustomPositionErrorCallback):
(WebCore::JSCustomPositionErrorCallback::handleEvent):

  • bindings/js/JSCustomPositionErrorCallback.h:
  • bindings/js/JSCustomSQLStatementCallback.cpp:

(WebCore::JSCustomSQLStatementCallback::JSCustomSQLStatementCallback):
(WebCore::JSCustomSQLStatementCallback::~JSCustomSQLStatementCallback):
(WebCore::JSCustomSQLStatementCallback::handleEvent):

  • bindings/js/JSCustomSQLStatementCallback.h:
  • bindings/js/JSCustomSQLStatementErrorCallback.cpp:

(WebCore::JSCustomSQLStatementErrorCallback::JSCustomSQLStatementErrorCallback):
(WebCore::JSCustomSQLStatementErrorCallback::~JSCustomSQLStatementErrorCallback):
(WebCore::JSCustomSQLStatementErrorCallback::handleEvent):

  • bindings/js/JSCustomSQLStatementErrorCallback.h:
  • bindings/js/JSCustomSQLTransactionCallback.cpp:

(WebCore::JSCustomSQLTransactionCallback::JSCustomSQLTransactionCallback):
(WebCore::JSCustomSQLTransactionCallback::~JSCustomSQLTransactionCallback):
(WebCore::JSCustomSQLTransactionCallback::handleEvent):

  • bindings/js/JSCustomSQLTransactionCallback.h:
  • bindings/js/JSCustomSQLTransactionErrorCallback.cpp:

(WebCore::JSCustomSQLTransactionErrorCallback::JSCustomSQLTransactionErrorCallback):
(WebCore::JSCustomSQLTransactionErrorCallback::~JSCustomSQLTransactionErrorCallback):
(WebCore::JSCustomSQLTransactionErrorCallback::handleEvent):

  • bindings/js/JSCustomSQLTransactionErrorCallback.h:
  • bindings/js/JSCustomVoidCallback.cpp:

(WebCore::JSCustomVoidCallback::JSCustomVoidCallback):
(WebCore::JSCustomVoidCallback::~JSCustomVoidCallback):
(WebCore::JSCustomVoidCallback::handleEvent):

  • bindings/js/JSCustomVoidCallback.h:
  • storage/Database.cpp:

(WebCore::Database::Database):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r49214 r49280  
    184184__ZN3JSC4Heap17globalObjectCountEv
    185185__ZN3JSC4Heap20protectedObjectCountEv
    186 __ZN3JSC4Heap24setGCProtectNeedsLockingEv
    187186__ZN3JSC4Heap25protectedObjectTypeCountsEv
    188187__ZN3JSC4Heap26protectedGlobalObjectCountEv
Note: See TracChangeset for help on using the changeset viewer.