mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 01:25:39 +00:00
da7873563b
Reviewed By: fkgozali Differential Revision: D8065619 fbshipit-source-id: 719c303b40c96950bab8e5dde9a75f449b2956c6
32 lines
896 B
C++
32 lines
896 B
C++
// Copyright (c) 2004-present, Facebook, Inc.
|
|
|
|
// This source code is licensed under the MIT license found in the
|
|
// LICENSE file in the root directory of this source tree.
|
|
|
|
#include "JSCSamplingProfiler.h"
|
|
|
|
#include <jschelpers/JSCHelpers.h>
|
|
|
|
static JSValueRef pokeSamplingProfiler(
|
|
JSContextRef ctx,
|
|
JSObjectRef function,
|
|
JSObjectRef thisObject,
|
|
size_t argumentCount,
|
|
const JSValueRef arguments[],
|
|
JSValueRef* exception) {
|
|
return JSC_JSPokeSamplingProfiler(ctx);
|
|
}
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
void initSamplingProfilerOnMainJSCThread(JSGlobalContextRef ctx) {
|
|
JSC_JSStartSamplingProfilingOnMainJSCThread(ctx);
|
|
|
|
// Allow the profiler to be poked from JS as well
|
|
// (see SamplingProfiler.js for an example of how it could be used with the JSCSamplingProfiler module).
|
|
installGlobalFunction(ctx, "pokeSamplingProfiler", pokeSamplingProfiler);
|
|
}
|
|
|
|
} }
|