Changeset 200114 in webkit


Ignore:
Timestamp:
Apr 26, 2016, 5:30:18 PM (9 years ago)
Author:
mark.lam@apple.com
Message:

Update the compatibility version check for the ObjC API's InitConstructorSupport to use dyld_get_program_sdk_version().
https://bugs.webkit.org/show_bug.cgi?id=157048

Reviewed by Geoffrey Garen.

  • API/JSWrapperMap.mm:

(supportsInitMethodConstructors):
(getJSExportProtocol):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSWrapperMap.mm

    r197467 r200114  
    4545#include <mach-o/dyld.h>
    4646
    47 static const int32_t webkitFirstVersionWithInitConstructorSupport = 0x21A0400; // 538.4.0
     47#if __has_include(<mach-o/dyld_priv.h>)
     48#include <mach-o/dyld_priv.h>
     49#endif
     50extern "C" uint32_t dyld_get_program_sdk_version();
     51
     52#if PLATFORM(IOS)
     53static const uint32_t webkitFirstSDKVersionWithInitConstructorSupport = 0x80000; // iOS 8.0.0
     54#elif PLATFORM(MAC)
     55static const uint32_t webkitFirstSDKVersionWithInitConstructorSupport = 0xA0A00; // OSX 10.10.0
     56#endif
    4857
    4958@class JSObjCClassInfo;
     
    651660    // There are no old clients on Apple TV, so there's no need for backwards compatibility.
    652661    return true;
     662#else
     663    static uint32_t programSDKVersion = 0;
     664    if (!programSDKVersion)
     665        programSDKVersion = dyld_get_program_sdk_version();
     666    return programSDKVersion >= webkitFirstSDKVersionWithInitConstructorSupport;
    653667#endif
    654 
    655     static int32_t versionOfLinkTimeLibrary = 0;
    656     if (!versionOfLinkTimeLibrary)
    657         versionOfLinkTimeLibrary = NSVersionOfLinkTimeLibrary("JavaScriptCore");
    658     return versionOfLinkTimeLibrary >= webkitFirstVersionWithInitConstructorSupport;
    659668}
    660669
  • trunk/Source/JavaScriptCore/ChangeLog

    r200113 r200114  
     12016-04-26  Mark Lam  <mark.lam@apple.com>
     2
     3        Update the compatibility version check for the ObjC API's InitConstructorSupport to use dyld_get_program_sdk_version().
     4        https://bugs.webkit.org/show_bug.cgi?id=157048
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * API/JSWrapperMap.mm:
     9        (supportsInitMethodConstructors):
     10        (getJSExportProtocol):
     11
    1122016-04-26  Benjamin Poulain  <bpoulain@apple.com>
    213
Note: See TracChangeset for help on using the changeset viewer.