Add RCT_PROFILE define

Reviewed By: tadeuzagallo

Differential Revision: D3423593

fbshipit-source-id: cc04add1bee16fbb4c2491bd229f23244fe3e7bd
This commit is contained in:
Pieter De Baets 2016-06-13 04:16:19 -07:00 committed by Facebook Github Bot 5
parent f5b1f157ad
commit d7fc58f32c
9 changed files with 18 additions and 18 deletions

View File

@ -50,16 +50,16 @@
#define RCT_IF_DEV(...)
#endif
#ifndef RCT_PROFILE
#define RCT_PROFILE RCT_DEV
#endif
/**
* By default, only raise an NSAssertion in debug mode
* (custom assert functions will still be called).
*/
#ifndef RCT_NSASSERT
#if RCT_DEBUG
#define RCT_NSASSERT 1
#else
#define RCT_NSASSERT 0
#endif
#define RCT_NSASSERT RCT_DEBUG
#endif
/**

View File

@ -389,7 +389,7 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
return @(CACurrentMediaTime() * 1000);
}];
#if RCT_DEV
#if RCT_PROFILE
if (RCTProfileIsProfiling()) {
// Cheating, since it's not a "hook", but meh
[self addSynchronousHookWithName:@"__RCTProfileIsProfiling" usingBlock:@YES];
@ -468,7 +468,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context)
name:event
object:nil];
}
#endif
#if RCT_DEV
// Inject handler used by HMR
[self addSynchronousHookWithName:@"nativeInjectHMRUpdate" usingBlock:^(NSString *sourceCode, NSString *sourceCodeURL) {
RCTJSCExecutor *strongSelf = weakSelf;

View File

@ -8,15 +8,13 @@
*/
#import "RCTJSCProfiler.h"
#import "RCTLog.h"
#import <UIKit/UIKit.h>
#import "RCTLog.h"
#ifndef RCT_JSC_PROFILER
#if RCT_DEV
#define RCT_JSC_PROFILER 1
#else
#define RCT_JSC_PROFILER 0
#endif
#define RCT_JSC_PROFILER RCT_PROFILE
#endif
#if RCT_JSC_PROFILER

View File

@ -26,7 +26,7 @@ RCT_EXTERN NSString *const RCTProfileDidEndProfiling;
RCT_EXTERN const uint64_t RCTProfileTagAlways;
#if RCT_DEV
#if RCT_PROFILE
@class RCTBridge;

View File

@ -34,7 +34,7 @@ NSString *const RCTProfileDidEndProfiling = @"RCTProfileDidEndProfiling";
const uint64_t RCTProfileTagAlways = 1L << 0;
#if RCT_DEV
#if RCT_PROFILE
#pragma mark - Constants

View File

@ -10,7 +10,7 @@
#include "RCTDefines.h"
#include "RCTMacros.h"
#if RCT_DEV && defined(__arm__)
#if RCT_PROFILE && defined(__arm__)
.thumb
.thumb_func

View File

@ -10,7 +10,7 @@
#include "RCTDefines.h"
#include "RCTMacros.h"
#if RCT_DEV && defined(__arm64__)
#if RCT_PROFILE && defined(__arm64__)
.align 5
.globl SYMBOL_NAME(RCTProfileTrampoline)

View File

@ -10,7 +10,7 @@
#include "RCTDefines.h"
#include "RCTMacros.h"
#if RCT_DEV && defined(__i386__)
#if RCT_PROFILE && defined(__i386__)
.globl SYMBOL_NAME(RCTProfileTrampoline)
SYMBOL_NAME(RCTProfileTrampoline):

View File

@ -10,7 +10,7 @@
#include "RCTDefines.h"
#include "RCTMacros.h"
#if RCT_DEV && defined(__x86_64__)
#if RCT_PROFILE && defined(__x86_64__)
.globl SYMBOL_NAME(RCTProfileTrampoline)
SYMBOL_NAME(RCTProfileTrampoline):