mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
dd12edf35f
* Implement mechanism to prevent ShadowTree commit exhaustion (#52645) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52645 Changelog: [internal] This add a new feature flag to test a fix for https://github.com/facebook/react-native/issues/51870 Reviewed By: cortinico, sammy-SC Differential Revision: D78418504 fbshipit-source-id: 2792026b6936393d196fd1e3162f8b2c61a38ed6 * Fix incorrect locking and attempts check in ShadowTree experiment (#52681) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52681 Changelog: [internal] In the original change I made in D78418504 / https://github.com/facebook/react-native/pull/52645 I made 2 mistakes: 1. Used a lock that would try to re-lock on itself without it being recursive (which would cause a deadlock). I didn't see that because when testing I didn't hit the case where we'd exhaust the options. 2. The `attemps` variable wasn't incremented, so we never left the loop in case of exhaustion. This propagates a flag to `tryCommit` to indicate we've already locked on the commitMutex_ so we don't need to lock again in that case and increases the counter, fixing the issue. Reviewed By: cortinico Differential Revision: D78497509 fbshipit-source-id: 546ccd0c84aed5416ce1aef47d79419b4fe06f66 * Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental (#52709) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52709 We want to make user for folks in OSS to try `preventShadowTreeCommitExhaustionWithLocking`. Therefore I'm updating the OSS release channel for this flag to experimental. Changelog: [Internal] [Changed] - Rollout `preventShadowTreeCommitExhaustionWithLocking` in experimental Reviewed By: rubennorte Differential Revision: D78558655 fbshipit-source-id: 02a9d216c7b2f8f7bdc1340213f82b70c5692dc7 --------- Co-authored-by: Rubén Norte <rubennorte@meta.com>
294 lines
8.9 KiB
C++
294 lines
8.9 KiB
C++
/*
|
|
* 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.
|
|
*
|
|
* @generated SignedSource<<0179ba45718903d6fec6dcc19b0e1aaa>>
|
|
*/
|
|
|
|
/**
|
|
* IMPORTANT: Do NOT modify this file directly.
|
|
*
|
|
* To change the definition of the flags, edit
|
|
* packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js.
|
|
*
|
|
* To regenerate this code, run the following script from the repo root:
|
|
* yarn featureflags --update
|
|
*/
|
|
|
|
#include "ReactNativeFeatureFlags.h"
|
|
|
|
namespace facebook::react {
|
|
|
|
#pragma GCC diagnostic push
|
|
#pragma GCC diagnostic ignored "-Wglobal-constructors"
|
|
std::unique_ptr<ReactNativeFeatureFlagsAccessor> accessor_;
|
|
#pragma GCC diagnostic pop
|
|
|
|
bool ReactNativeFeatureFlags::commonTestFlag() {
|
|
return getAccessor().commonTestFlag();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::animatedShouldSignalBatch() {
|
|
return getAccessor().animatedShouldSignalBatch();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() {
|
|
return getAccessor().cxxNativeAnimatedEnabled();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::cxxNativeAnimatedRemoveJsSync() {
|
|
return getAccessor().cxxNativeAnimatedRemoveJsSync();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::disableMainQueueSyncDispatchIOS() {
|
|
return getAccessor().disableMainQueueSyncDispatchIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::disableMountItemReorderingAndroid() {
|
|
return getAccessor().disableMountItemReorderingAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::disableTextLayoutManagerCacheAndroid() {
|
|
return getAccessor().disableTextLayoutManagerCacheAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableAccessibilityOrder() {
|
|
return getAccessor().enableAccessibilityOrder();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableAccumulatedUpdatesInRawPropsAndroid() {
|
|
return getAccessor().enableAccumulatedUpdatesInRawPropsAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableAndroidTextMeasurementOptimizations() {
|
|
return getAccessor().enableAndroidTextMeasurementOptimizations();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableBridgelessArchitecture() {
|
|
return getAccessor().enableBridgelessArchitecture();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableCppPropsIteratorSetter() {
|
|
return getAccessor().enableCppPropsIteratorSetter();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableCustomFocusSearchOnClippedElementsAndroid() {
|
|
return getAccessor().enableCustomFocusSearchOnClippedElementsAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableDestroyShadowTreeRevisionAsync() {
|
|
return getAccessor().enableDestroyShadowTreeRevisionAsync();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() {
|
|
return getAccessor().enableDoubleMeasurementFixAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() {
|
|
return getAccessor().enableEagerRootViewAttachment();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableFabricLogs() {
|
|
return getAccessor().enableFabricLogs();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableFabricRenderer() {
|
|
return getAccessor().enableFabricRenderer();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableFixForParentTagDuringReparenting() {
|
|
return getAccessor().enableFixForParentTagDuringReparenting();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout() {
|
|
return getAccessor().enableFontScaleChangesUpdatingLayout();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableIOSTextBaselineOffsetPerLine() {
|
|
return getAccessor().enableIOSTextBaselineOffsetPerLine();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox() {
|
|
return getAccessor().enableIOSViewClipToPaddingBox();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableInteropViewManagerClassLookUpOptimizationIOS() {
|
|
return getAccessor().enableInteropViewManagerClassLookUpOptimizationIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid() {
|
|
return getAccessor().enableLayoutAnimationsOnAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS() {
|
|
return getAccessor().enableLayoutAnimationsOnIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS() {
|
|
return getAccessor().enableMainQueueCoordinatorOnIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableMainQueueModulesOnIOS() {
|
|
return getAccessor().enableMainQueueModulesOnIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS() {
|
|
return getAccessor().enableModuleArgumentNSNullConversionIOS();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableNativeCSSParsing() {
|
|
return getAccessor().enableNativeCSSParsing();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableNetworkEventReporting() {
|
|
return getAccessor().enableNetworkEventReporting();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableNewBackgroundAndBorderDrawables() {
|
|
return getAccessor().enableNewBackgroundAndBorderDrawables();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enablePreparedTextLayout() {
|
|
return getAccessor().enablePreparedTextLayout();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enablePropsUpdateReconciliationAndroid() {
|
|
return getAccessor().enablePropsUpdateReconciliationAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableResourceTimingAPI() {
|
|
return getAccessor().enableResourceTimingAPI();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableSynchronousStateUpdates() {
|
|
return getAccessor().enableSynchronousStateUpdates();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableViewCulling() {
|
|
return getAccessor().enableViewCulling();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableViewRecycling() {
|
|
return getAccessor().enableViewRecycling();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableViewRecyclingForText() {
|
|
return getAccessor().enableViewRecyclingForText();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableViewRecyclingForView() {
|
|
return getAccessor().enableViewRecyclingForView();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableVirtualViewDebugFeatures() {
|
|
return getAccessor().enableVirtualViewDebugFeatures();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableVirtualViewRenderState() {
|
|
return getAccessor().enableVirtualViewRenderState();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::enableVirtualViewWindowFocusDetection() {
|
|
return getAccessor().enableVirtualViewWindowFocusDetection();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact() {
|
|
return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::fuseboxEnabledRelease() {
|
|
return getAccessor().fuseboxEnabledRelease();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::fuseboxNetworkInspectionEnabled() {
|
|
return getAccessor().fuseboxNetworkInspectionEnabled();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::hideOffscreenVirtualViewsOnIOS() {
|
|
return getAccessor().hideOffscreenVirtualViewsOnIOS();
|
|
}
|
|
|
|
double ReactNativeFeatureFlags::preparedTextCacheSize() {
|
|
return getAccessor().preparedTextCacheSize();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::preventShadowTreeCommitExhaustionWithLocking() {
|
|
return getAccessor().preventShadowTreeCommitExhaustionWithLocking();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::traceTurboModulePromiseRejectionsOnAndroid() {
|
|
return getAccessor().traceTurboModulePromiseRejectionsOnAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::updateRuntimeShadowNodeReferencesOnCommit() {
|
|
return getAccessor().updateRuntimeShadowNodeReferencesOnCommit();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useAlwaysAvailableJSErrorHandling() {
|
|
return getAccessor().useAlwaysAvailableJSErrorHandling();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useFabricInterop() {
|
|
return getAccessor().useFabricInterop();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode() {
|
|
return getAccessor().useNativeViewConfigsInBridgelessMode();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid() {
|
|
return getAccessor().useOptimizedEventBatchingOnAndroid();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useRawPropsJsiValue() {
|
|
return getAccessor().useRawPropsJsiValue();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useShadowNodeStateOnClone() {
|
|
return getAccessor().useShadowNodeStateOnClone();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useTurboModuleInterop() {
|
|
return getAccessor().useTurboModuleInterop();
|
|
}
|
|
|
|
bool ReactNativeFeatureFlags::useTurboModules() {
|
|
return getAccessor().useTurboModules();
|
|
}
|
|
|
|
double ReactNativeFeatureFlags::virtualViewPrerenderRatio() {
|
|
return getAccessor().virtualViewPrerenderRatio();
|
|
}
|
|
|
|
void ReactNativeFeatureFlags::override(
|
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> provider) {
|
|
getAccessor().override(std::move(provider));
|
|
}
|
|
|
|
void ReactNativeFeatureFlags::dangerouslyReset() {
|
|
accessor_ = std::make_unique<ReactNativeFeatureFlagsAccessor>();
|
|
}
|
|
|
|
std::optional<std::string> ReactNativeFeatureFlags::dangerouslyForceOverride(
|
|
std::unique_ptr<ReactNativeFeatureFlagsProvider> provider) {
|
|
auto accessor = std::make_unique<ReactNativeFeatureFlagsAccessor>();
|
|
accessor->override(std::move(provider));
|
|
|
|
std::swap(accessor_, accessor);
|
|
|
|
// Now accessor is the old accessor
|
|
return accessor == nullptr ? std::nullopt
|
|
: accessor->getAccessedFeatureFlagNames();
|
|
}
|
|
|
|
ReactNativeFeatureFlagsAccessor& ReactNativeFeatureFlags::getAccessor() {
|
|
if (accessor_ == nullptr) {
|
|
accessor_ = std::make_unique<ReactNativeFeatureFlagsAccessor>();
|
|
}
|
|
return *accessor_;
|
|
}
|
|
|
|
} // namespace facebook::react
|