react-native/ReactCommon/cxxreact/JSCSamplingProfiler.cpp
Pieter De Baets 3f50a887d9 Move JSC API usage in ReactCommon to our wrapper methods
Reviewed By: bnham

Differential Revision: D4197374

fbshipit-source-id: 107a129cff35dddfe06104b607441ad412f83d90
2016-11-22 06:13:33 -08:00

36 lines
817 B
C++

// Copyright 2004-present Facebook. All Rights Reserved.
#ifdef WITH_JSC_EXTRA_TRACING
#include "JSCSamplingProfiler.h"
#include <stdio.h>
#include <string.h>
#include <JavaScriptCore/API/JSProfilerPrivate.h>
#include <jschelpers/JSCHelpers.h>
#include <jschelpers/Value.h>
namespace facebook {
namespace react {
namespace {
static JSValueRef pokeSamplingProfiler(
JSContextRef ctx,
JSObjectRef function,
JSObjectRef thisObject,
size_t argumentCount,
const JSValueRef arguments[],
JSValueRef* exception) {
return JSC_JSPokeSamplingProfiler(ctx);
}
}
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {
JSC_JSStartSamplingProfilingOnMainJSCThread(ctx);
installGlobalFunction(ctx, "pokeSamplingProfiler", pokeSamplingProfiler);
}
}
}
#endif // WITH_JSC_EXTRA_TRACING