Skip to content
Permalink
Browse files
Update the compatibility version check for the ObjC API's InitConstru…
…ctorSupport 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):



Canonical link: https://commits.webkit.org/175169@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mark Lam committed Apr 27, 2016
1 parent 39807cb commit f62bfb66e4167ab8e2f77c0a783c799f02b238c7
Showing with 26 additions and 6 deletions.
  1. +15 −6 Source/JavaScriptCore/API/JSWrapperMap.mm
  2. +11 −0 Source/JavaScriptCore/ChangeLog
@@ -44,7 +44,16 @@

#include <mach-o/dyld.h>

static const int32_t webkitFirstVersionWithInitConstructorSupport = 0x21A0400; // 538.4.0
#if __has_include(<mach-o/dyld_priv.h>)
#include <mach-o/dyld_priv.h>
#endif
extern "C" uint32_t dyld_get_program_sdk_version();

#if PLATFORM(IOS)
static const uint32_t webkitFirstSDKVersionWithInitConstructorSupport = 0x80000; // iOS 8.0.0
#elif PLATFORM(MAC)
static const uint32_t webkitFirstSDKVersionWithInitConstructorSupport = 0xA0A00; // OSX 10.10.0
#endif

@class JSObjCClassInfo;

@@ -650,12 +659,12 @@ bool supportsInitMethodConstructors()
#if PLATFORM(APPLETV)
// There are no old clients on Apple TV, so there's no need for backwards compatibility.
return true;
#else
static uint32_t programSDKVersion = 0;
if (!programSDKVersion)
programSDKVersion = dyld_get_program_sdk_version();
return programSDKVersion >= webkitFirstSDKVersionWithInitConstructorSupport;
#endif

static int32_t versionOfLinkTimeLibrary = 0;
if (!versionOfLinkTimeLibrary)
versionOfLinkTimeLibrary = NSVersionOfLinkTimeLibrary("JavaScriptCore");
return versionOfLinkTimeLibrary >= webkitFirstVersionWithInitConstructorSupport;
}

Protocol *getJSExportProtocol()
@@ -1,3 +1,14 @@
2016-04-26 Mark Lam <mark.lam@apple.com>

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):

2016-04-26 Benjamin Poulain <bpoulain@apple.com>

[JSC] GetByVal on Undecided use its children before its OSR Exit

0 comments on commit f62bfb6

Please sign in to comment.