Fully remove usage of timed runtime

Summary: Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D42923921

fbshipit-source-id: 33024a43269fd5b1512421f13c141350aa619732
This commit is contained in:
Pieter De Baets
2023-02-08 08:59:48 -08:00
committed by Facebook GitHub Bot
parent 4128df20de
commit 1c8179b9b1
3 changed files with 9 additions and 39 deletions
+3 -1
View File
@@ -123,6 +123,9 @@ rn_xplat_cxx_library(
for header in CXXREACT_PUBLIC_HEADERS
]),
compiler_flags_pedantic = True,
exported_preprocessor_flags = [
"-DWITH_FBSYSTRACE=1",
],
fbandroid_preprocessor_flags = get_android_inspector_flags(),
fbobjc_compiler_flags = get_apple_compiler_flags(),
fbobjc_force_static = True,
@@ -134,7 +137,6 @@ rn_xplat_cxx_library(
platforms = (ANDROID, APPLE, CXX),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DWITH_FBSYSTRACE=1",
],
tests = [
react_native_xplat_target("cxxreact/tests:tests"),
@@ -27,12 +27,6 @@ namespace react {
namespace {
std::unique_ptr<HermesRuntime> makeHermesRuntimeSystraced(
const ::hermes::vm::RuntimeConfig &runtimeConfig) {
SystraceSection s("HermesExecutorFactory::makeHermesRuntimeSystraced");
return hermes::makeHermesRuntime(runtimeConfig);
}
class HermesExecutorRuntimeAdapter
: public facebook::hermes::inspector::RuntimeAdapter {
public:
@@ -189,8 +183,12 @@ void HermesExecutorFactory::setDebuggerName(const std::string &debuggerName) {
std::unique_ptr<JSExecutor> HermesExecutorFactory::createJSExecutor(
std::shared_ptr<ExecutorDelegate> delegate,
std::shared_ptr<MessageQueueThread> jsQueue) {
std::unique_ptr<HermesRuntime> hermesRuntime =
makeHermesRuntimeSystraced(runtimeConfig_);
std::unique_ptr<HermesRuntime> hermesRuntime;
{
SystraceSection s("makeHermesRuntime");
hermesRuntime = hermes::makeHermesRuntime(runtimeConfig_);
}
HermesRuntime &hermesRuntimeRef = *hermesRuntime;
auto decoratedRuntime = std::make_shared<DecoratedRuntime>(
std::move(hermesRuntime),
-30
View File
@@ -1,30 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
* @format
*/
// Declarations for functionality exposed by Hermes' TimerStats decorator.
//
// For backwards-compatibility, code that uses such functionality must also
// check explicitly at run-time whether the object(s) and method(s) exist, and
// fail safely if not.
/**
* JSITimerInternalType is the global object installed by Hermes' TimedRuntime
* decorator, and it is used to extract runtime timing information.
*/
declare type $JSITimerInternalType = {
/**
* Returns the counters that TimedRuntime keep track.
* There are no guarantees about what keys exist in it, but they can be
* printed for informational purposes.
* @return An object that maps strings to various types of performance
* statistics.
*/
+getTimes?: () => {[string]: number | string, ...},
};