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
This commit is contained in:
Tadeu Zagallo 2015-10-24 14:01:11 -07:00 committed by facebook-github-bot-4
parent 032c3641d0
commit a044ade333
1 changed files with 11 additions and 3 deletions

View File

@ -34,8 +34,16 @@ static BOOL RCTJSCSetOption(const char *option)
static dispatch_once_t onceToken; static dispatch_once_t onceToken;
dispatch_once(&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 = 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) { if (setOption) {
@ -117,8 +125,8 @@ RCT_EXPORT_MODULE()
__weak __typeof__(self) weakSelf = self; __weak __typeof__(self) weakSelf = self;
_devMenuItem = _devMenuItem =
[RCTDevMenuItem toggleItemWithKey:RCTPerfMonitorKey [RCTDevMenuItem toggleItemWithKey:RCTPerfMonitorKey
title:@"Show Monitor" title:@"Show Perf Monitor"
selectedTitle:@"Hide Monitor" selectedTitle:@"Hide Perf Monitor"
handler: handler:
^(BOOL selected) { ^(BOOL selected) {
if (selected) { if (selected) {