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/JSObjectRef.cpp

    r157653 r159459  
    507507}
    508508
    509 bool JSObjectIsFunction(JSContextRef, JSObjectRef object)
     509bool JSObjectIsFunction(JSContextRef ctx, JSObjectRef object)
    510510{
    511511    if (!object)
    512512        return false;
     513    APIEntryShim entryShim(toJS(ctx));
    513514    CallData callData;
    514515    JSCell* cell = toJS(object);
     
    606607        return 0;
    607608    }
    608     JSObject* jsObject = toJS(object);
    609609    ExecState* exec = toJS(ctx);
    610610    APIEntryShim entryShim(exec);
     
    612612    VM* vm = &exec->vm();
    613613
     614    JSObject* jsObject = toJS(object);
    614615    JSPropertyNameArrayRef propertyNames = new OpaqueJSPropertyNameArray(vm);
    615616    PropertyNameArray array(vm);
Note: See TracChangeset for help on using the changeset viewer.