mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-06 22:38:37 +08:00
Fixing a crash caused by D4393955
Reviewed By: javache Differential Revision: D4403858 fbshipit-source-id: c930aa108d27c1bd1b36364530d2953bcd4664ad
This commit is contained in:
committed by
Facebook Github Bot
parent
d2de604721
commit
ad0493c6c2
@@ -540,7 +540,7 @@ RCT_EXPORT_MODULE()
|
||||
if (JSC_JSSamplingProfilerEnabled(self->_bridge.jsContext.JSGlobalContextRef)) {
|
||||
JSContext *context = self->_bridge.jsContext;
|
||||
// Allow to toggle the sampling profiler through RN's dev menu
|
||||
[self->_bridge.devMenu addItem:[RCTDevMenuItem buttonItemWithTitle:@"Start / Stop JS Sampling Profiler" handler:^{
|
||||
[items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Start / Stop JS Sampling Profiler" handler:^{
|
||||
JSGlobalContextRef globalContext = context.JSGlobalContextRef;
|
||||
// JSPokeSamplingProfiler() toggles the profiling process
|
||||
JSValueRef jsResult = JSC_JSPokeSamplingProfiler(globalContext);
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
#ifdef WITH_JSC_EXTRA_TRACING
|
||||
#include "JSCLegacyProfiler.h"
|
||||
#include "JSCLegacyTracing.h"
|
||||
#endif
|
||||
|
||||
#if !defined(__APPLE__) && defined(WITH_JSC_EXTRA_TRACING)
|
||||
#include <JavaScriptCore/API/JSProfilerPrivate.h>
|
||||
#endif
|
||||
|
||||
@@ -278,7 +281,11 @@ void JSCExecutor::initOnJSVMThread() throw(JSException) {
|
||||
PerfLogging::installNativeHooks(m_context);
|
||||
#endif
|
||||
|
||||
initSamplingProfilerOnMainJSCThread(m_context);
|
||||
#if defined(__APPLE__) || defined(WITH_JSC_EXTRA_TRACING)
|
||||
if (JSC_JSSamplingProfilerEnabled(m_context)) {
|
||||
initSamplingProfilerOnMainJSCThread(m_context);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_FB_MEMORY_PROFILING
|
||||
addNativeMemoryHooks(m_context);
|
||||
|
||||
Reference in New Issue
Block a user