diff --git a/React/Base/RCTBridgeDelegate.h b/React/Base/RCTBridgeDelegate.h index c5f0cdb40..65f823c96 100644 --- a/React/Base/RCTBridgeDelegate.h +++ b/React/Base/RCTBridgeDelegate.h @@ -82,6 +82,15 @@ */ - (BOOL)shouldBridgeInitializeNativeModulesSynchronously:(RCTBridge *)bridge; +/** + * Configure whether the JSCExecutor created should use the system JSC API or + * alternative hooks provided. When returning YES from this method, you must have + * previously called facebook::react::setCustomJSCWrapper. + * + * @experimental + */ +- (BOOL)shouldBridgeUseCustomJSC:(RCTBridge *)bridge; + /** * The bridge will automatically attempt to load the JS source code from the * location specified by the `sourceURLForBridge:` method, however, if you want diff --git a/ReactCommon/cxxreact/JSCExecutor.cpp b/ReactCommon/cxxreact/JSCExecutor.cpp index 564ab65c1..680e6bbf0 100644 --- a/ReactCommon/cxxreact/JSCExecutor.cpp +++ b/ReactCommon/cxxreact/JSCExecutor.cpp @@ -216,7 +216,15 @@ void JSCExecutor::setContextName(const std::string& name) { void JSCExecutor::initOnJSVMThread() throw(JSException) { SystraceSection s("JSCExecutor.initOnJSVMThread"); + #if defined(__APPLE__) + const bool useCustomJSC = m_jscConfig.getDefault("UseCustomJSC", false).getBool(); + if (useCustomJSC) { + JSC_configureJSCForIOS(true); + } + #else const bool useCustomJSC = false; + #endif + #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSCForAndroid(m_jscConfig); #endif