Skip to content

Commit

Permalink
Bringing fbsystrace to iOS 8's JSC
Browse files Browse the repository at this point in the history
Reviewed By: michalgr

Differential Revision: D3163295

fb-gh-sync-id: 3cc2083accc4ba6947efc631f3574412022b1e1f
fbshipit-source-id: 3cc2083accc4ba6947efc631f3574412022b1e1f
  • Loading branch information
tadeuzagallo authored and Facebook Github Bot 3 committed Apr 25, 2016
1 parent 69c083b commit c5307a6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions ReactAndroid/src/main/jni/react/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ PREPROCESSOR_FLAGS = [
'-DLOG_TAG="ReactNative"',
'-DWITH_JSC_EXTRA_TRACING=1',
'-DWITH_FBSYSTRACE=1',
'-DWITH_JSC_MEMORY_PRESSURE=1',
# '-DWITH_JSC_INTERNAL=1', # Taken care of in D3163295
'-DWITH_REACT_INTERNAL_SETTINGS=1',
]

def react_library(**kwargs):
Expand Down
10 changes: 3 additions & 7 deletions ReactAndroid/src/main/jni/react/JSCExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void JSCExecutor::destroy() {
}

void JSCExecutor::initOnJSVMThread() {
#if defined(WITH_FB_JSC_TUNING) && !defined(WITH_JSC_INTERNAL)
#if defined(WITH_FB_JSC_TUNING)
configureJSCForAndroid(m_jscConfig);
#endif
m_context = JSGlobalContextCreateInGroup(nullptr, nullptr);
Expand All @@ -170,10 +170,6 @@ void JSCExecutor::initOnJSVMThread() {

installGlobalFunction(m_context, "nativeLoggingHook", JSLogging::nativeHook);

#if defined(WITH_JSC_INTERNAL) && defined(WITH_FB_JSC_TUNING)
configureJSCForAndroid();
#endif

#ifdef WITH_JSC_EXTRA_TRACING
addNativeTracingHooks(m_context);
addNativeProfilingHooks(m_context);
Expand All @@ -188,7 +184,7 @@ void JSCExecutor::initOnJSVMThread() {
addJSCPerfStatsHooks(m_context);
#endif

#if defined(WITH_FB_JSC_TUNING) && !defined(WITH_JSC_INTERNAL)
#if defined(WITH_FB_JSC_TUNING)
configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir);
#endif
}
Expand Down Expand Up @@ -345,7 +341,7 @@ bool JSCExecutor::supportsProfiling() {
void JSCExecutor::startProfiler(const std::string &titleString) {
#ifdef WITH_JSC_EXTRA_TRACING
JSStringRef title = JSStringCreateWithUTF8CString(titleString.c_str());
#if WITH_JSC_INTERNAL
#if WITH_REACT_INTERNAL_SETTINGS
JSStartProfiling(m_context, title, false);
#else
JSStartProfiling(m_context, title);
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/JSCLegacyProfiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static JSValueRef nativeProfilerStart(
}

JSStringRef title = JSValueToStringCopy(ctx, arguments[0], exception);
#if WITH_JSC_INTERNAL
#if WITH_REACT_INTERNAL_SETTINGS
JSStartProfiling(ctx, title, false);
#else
JSStartProfiling(ctx, title);
Expand Down
2 changes: 1 addition & 1 deletion ReactAndroid/src/main/jni/react/JSCTracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ static JSValueRef nativeTraceBeginLegacy(
}

JSStringRef title = JSStringCreateWithUTF8CString(ENABLED_FBSYSTRACE_PROFILE_NAME);
#if WITH_JSC_INTERNAL
#if WITH_REACT_INTERNAL_SETTINGS
JSStartProfiling(ctx, title, true);
#else
JSStartProfiling(ctx, title);
Expand Down

0 comments on commit c5307a6

Please sign in to comment.