Ignore:
Timestamp:
Dec 8, 2008, 10:46:39 PM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Geoff Garen.

<rdar://problem/6166088> Give JSGlobalContextCreate a behavior that is concurrency aware,
and un-deprecate it

  • API/JSContextRef.cpp: (JSGlobalContextCreate):
  • API/JSContextRef.h: Use a unique context group for the context, unless the application was linked against old JavaScriptCore.
File:
1 edited

Legend:

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

    r38622 r39127  
    3535#include <wtf/Platform.h>
    3636
     37#if PLATFORM(DARWIN)
     38#include <mach-o/dyld.h>
     39
     40static const int32_t webkitFirstVersionWithConcurrentGlobalContexts = 0x2100500; // 528.5.0
     41#endif
     42
    3743using namespace JSC;
    3844
     
    5561JSGlobalContextRef JSGlobalContextCreate(JSClassRef globalObjectClass)
    5662{
    57     JSLock lock(true);
    58     return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
     63#if PLATFORM(DARWIN)
     64    if (NSVersionOfLinkTimeLibrary("JavaScriptCore") <= webkitFirstVersionWithConcurrentGlobalContexts) {
     65        JSLock lock(true);
     66        return JSGlobalContextCreateInGroup(toRef(&JSGlobalData::sharedInstance()), globalObjectClass);
     67    }
     68#endif
     69    return JSGlobalContextCreateInGroup(0, globalObjectClass);
    5970}
    6071
Note: See TracChangeset for help on using the changeset viewer.