Support JS Systrace on all platforms

Reviewed By: tadeuzagallo

Differential Revision: D3234830

fbshipit-source-id: 94cc870d47d620c8bd8d35f83d0b017e5ddba90d
This commit is contained in:
Marc Horowitz
2016-05-13 17:15:03 -07:00
committed by Facebook Github Bot 8
parent b7fe8e68be
commit 86f2eb18e5
6 changed files with 127 additions and 72 deletions

View File

@@ -18,9 +18,13 @@
#include "Platform.h"
#include "Value.h"
#ifdef WITH_JSC_EXTRA_TRACING
#if defined(WITH_JSC_EXTRA_TRACING) || DEBUG
#include "JSCTracing.h"
#endif
#ifdef WITH_JSC_EXTRA_TRACING
#include "JSCLegacyProfiler.h"
#include "JSCLegacyTracing.h"
#include <JavaScriptCore/API/JSProfilerPrivate.h>
#endif
@@ -204,9 +208,13 @@ void JSCExecutor::initOnJSVMThread() {
installGlobalFunction(m_context, "nativeLoggingHook", JSNativeHooks::loggingHook);
installGlobalFunction(m_context, "nativePerformanceNow", JSNativeHooks::nowHook);
#ifdef WITH_JSC_EXTRA_TRACING
#if defined(WITH_JSC_EXTRA_TRACING) || DEBUG
addNativeTracingHooks(m_context);
#endif
#ifdef WITH_JSC_EXTRA_TRACING
addNativeProfilingHooks(m_context);
addNativeTracingLegacyHooks(m_context);
PerfLogging::installNativeHooks(m_context);
#endif
@@ -301,6 +309,8 @@ void JSCExecutor::invokeCallback(const double callbackId, const folly::dynamic&
}
void JSCExecutor::setGlobalVariable(const std::string& propName, const std::string& jsonValue) {
// TODO mhorowitz: systrace this.
auto globalObject = JSContextGetGlobalObject(m_context);
String jsPropertyName(propName.c_str());