mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Add option to start sampling profiler on app launch
Reviewed By: mhorowitz Differential Revision: D4415989 fbshipit-source-id: 30704c2b618656cb7cc0ccdf87dec315b30b62f3
This commit is contained in:
committed by
Facebook Github Bot
parent
5bb19a5bf5
commit
a407ff94ee
@@ -338,7 +338,9 @@ static NSThread *newJavaScriptThread(void)
|
||||
contextRef = context.JSGlobalContextRef;
|
||||
} else {
|
||||
if (self->_useCustomJSCLibrary) {
|
||||
JSC_configureJSCForIOS(true);
|
||||
JSC_configureJSCForIOS(true, RCTJSONStringify(@{
|
||||
@"StartSamplingProfilerOnInit": @(self->_bridge.devMenu.startSamplingProfilerOnLaunch)
|
||||
}, NULL).UTF8String);
|
||||
}
|
||||
contextRef = JSC_JSGlobalContextCreateInGroup(self->_useCustomJSCLibrary, nullptr, nullptr);
|
||||
context = [JSC_JSContext(contextRef) contextWithJSGlobalContextRef:contextRef];
|
||||
@@ -1028,7 +1030,7 @@ static NSData *loadRAMBundle(NSURL *sourceURL, NSError **error, RandomAccessBund
|
||||
- (void)_createContext
|
||||
{
|
||||
if (_useCustomJSCLibrary) {
|
||||
JSC_configureJSCForIOS(true);
|
||||
JSC_configureJSCForIOS(true, "{}");
|
||||
}
|
||||
JSGlobalContextRef ctx = JSC_JSGlobalContextCreateInGroup(_useCustomJSCLibrary, nullptr, nullptr);
|
||||
_context = [JSC_JSContext(ctx) contextWithJSGlobalContextRef:ctx];
|
||||
|
||||
Reference in New Issue
Block a user