Ignore:
Timestamp:
Nov 18, 2013, 3:07:03 PM (12 years ago)
Author:
[email protected]
Message:

APIEntryShims need some love
https://bugs.webkit.org/show_bug.cgi?id=124540

Reviewed by Filip Pizlo.

We were missing them in key places which some other hacking revealed. These could have manifested as
race conditions for VMs being used in multithreaded environments.

  • API/JSContext.mm:

(-[JSContext setException:]):
(-[JSContext wrapperForObjCObject:]):
(-[JSContext wrapperForJSObject:]):

  • API/JSContextRef.cpp:

(JSContextGroupRelease):
(JSGlobalContextRelease):

  • API/JSManagedValue.mm:

(-[JSManagedValue initWithValue:]):
(-[JSManagedValue value]):

  • API/JSObjectRef.cpp:

(JSObjectIsFunction):
(JSObjectCopyPropertyNames):

  • API/JSValue.mm:

(containerValueToObject):

  • API/JSWrapperMap.mm:

(tryUnwrapObjcObject):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r157688 r159459  
    6969void JSContextGroupRelease(JSContextGroupRef group)
    7070{
    71     IdentifierTable* savedIdentifierTable;
    7271    VM& vm = *toJS(group);
    73 
    74     {
    75         JSLockHolder lock(vm);
    76         savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(vm.identifierTable);
    77         vm.deref();
    78     }
    79 
    80     wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable);
     72    APIEntryShim entryShim(&vm);
     73    vm.deref();
    8174}
    8275
     
    166159    ExecState* exec = toJS(ctx);
    167160    {
    168         JSLockHolder lock(exec);
     161        APIEntryShim entryShim(exec);
    169162
    170163        VM& vm = exec->vm();
Note: See TracChangeset for help on using the changeset viewer.