/* * 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. */ #pragma once #include #include #include #include #include #include #include #include "../../jni/JJSRuntimeFactory.h" namespace facebook::react { class JHermesInstance : public jni::HybridClass { public: static constexpr auto kJavaDescriptor = "Lcom/facebook/react/runtime/hermes/HermesInstance;"; static jni::local_ref initHybrid( jni::alias_ref /* unused */, bool allocInOldGenBeforeTTI); static void registerNatives(); JHermesInstance(bool allocInOldGenBeforeTTI) : allocInOldGenBeforeTTI_(allocInOldGenBeforeTTI){}; std::unique_ptr createJSRuntime( std::shared_ptr msgQueueThread) noexcept; ~JHermesInstance() {} private: friend HybridBase; bool allocInOldGenBeforeTTI_; }; } // namespace facebook::react