From a044ade333072069be6d5ec5b0f60297f380949e Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Sat, 24 Oct 2015 14:01:11 -0700 Subject: [PATCH] Update button and add comments to Perf Monitor Summary: public Rename the dev menu button and add comments to the private method used. Reviewed By: ndfred Differential Revision: D2576599 fb-gh-sync-id: cd5cde7562dcbc243663ac68d2b9cac5c0a984ab --- React/Profiler/RCTPerfMonitor.m | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/React/Profiler/RCTPerfMonitor.m b/React/Profiler/RCTPerfMonitor.m index cebc89ac3..285806a3b 100644 --- a/React/Profiler/RCTPerfMonitor.m +++ b/React/Profiler/RCTPerfMonitor.m @@ -34,8 +34,16 @@ static BOOL RCTJSCSetOption(const char *option) static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ + /** + * JSC private C++ static method to toggle options at runtime + * + * JSC::Options::setOptions - JavaScriptCore/runtime/Options.h + */ setOption = dlsym(RTLD_DEFAULT, "_ZN3JSC7Options9setOptionEPKc"); - setOption("logGC=1"); + + if (RCT_DEBUG && setOption == NULL) { + RCTLogWarn(@"The symbol used to enable JSC runtime options is not available in this iOS version"); + } }); if (setOption) { @@ -117,8 +125,8 @@ RCT_EXPORT_MODULE() __weak __typeof__(self) weakSelf = self; _devMenuItem = [RCTDevMenuItem toggleItemWithKey:RCTPerfMonitorKey - title:@"Show Monitor" - selectedTitle:@"Hide Monitor" + title:@"Show Perf Monitor" + selectedTitle:@"Hide Perf Monitor" handler: ^(BOOL selected) { if (selected) {