Skip to content

Commit 12b2b56

Browse files
yungstersfacebook-github-bot
authored andcommitted
RN: Enable Hermes GC on Memory Pressure Warning (iOS) (facebook#51271)
Summary: Pull Request resolved: facebook#51271 Deletes the feature flag that was gating the new logic to invoke Hermes GC when iOS emits a memory pressure warning. Changelog: [iOS][Changed] - Hermes GC is now triggered in response to iOS memory pressure warning. Reviewed By: fkgozali Differential Revision: D74605206 fbshipit-source-id: b0753b15f5a30f37ed17bfebff0b491c7e7a6b59
1 parent e30ba13 commit 12b2b56

21 files changed

+56
-175
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a9968341533b3d6347ee99ce117dc62c>>
7+
* @generated SignedSource<<255deaad99bac2448e0a11bad50a770b>>
88
*/
99

1010
/**
@@ -138,12 +138,6 @@ public object ReactNativeFeatureFlags {
138138
@JvmStatic
139139
public fun enableIOSViewClipToPaddingBox(): Boolean = accessor.enableIOSViewClipToPaddingBox()
140140

141-
/**
142-
* Trigger JS runtime GC on memory pressure event on iOS
143-
*/
144-
@JvmStatic
145-
public fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean = accessor.enableJSRuntimeGCOnMemoryPressureOnIOS()
146-
147141
/**
148142
* When enabled, LayoutAnimations API will animate state changes on Android.
149143
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<c0dbb15487fd85e3beff70699ce99882>>
7+
* @generated SignedSource<<de51ff5f161363975ef67549e717f010>>
88
*/
99

1010
/**
@@ -38,7 +38,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
3838
private var enableFixForParentTagDuringReparentingCache: Boolean? = null
3939
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
4040
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
41-
private var enableJSRuntimeGCOnMemoryPressureOnIOSCache: Boolean? = null
4241
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
4342
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
4443
private var enableMainQueueModulesOnIOSCache: Boolean? = null
@@ -231,15 +230,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
231230
return cached
232231
}
233232

234-
override fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean {
235-
var cached = enableJSRuntimeGCOnMemoryPressureOnIOSCache
236-
if (cached == null) {
237-
cached = ReactNativeFeatureFlagsCxxInterop.enableJSRuntimeGCOnMemoryPressureOnIOS()
238-
enableJSRuntimeGCOnMemoryPressureOnIOSCache = cached
239-
}
240-
return cached
241-
}
242-
243233
override fun enableLayoutAnimationsOnAndroid(): Boolean {
244234
var cached = enableLayoutAnimationsOnAndroidCache
245235
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<25a09b653b2094cb7b5399a44642cf0e>>
7+
* @generated SignedSource<<7a0e83bca17b862a0454985d75131959>>
88
*/
99

1010
/**
@@ -64,8 +64,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
6464

6565
@DoNotStrip @JvmStatic public external fun enableIOSViewClipToPaddingBox(): Boolean
6666

67-
@DoNotStrip @JvmStatic public external fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean
68-
6967
@DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnAndroid(): Boolean
7068

7169
@DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnIOS(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<86773a0948ff9dd3b150678f336e6ff4>>
7+
* @generated SignedSource<<918f59b35fc1af953f615a6e7eace76e>>
88
*/
99

1010
/**
@@ -59,8 +59,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
5959

6060
override fun enableIOSViewClipToPaddingBox(): Boolean = false
6161

62-
override fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean = false
63-
6462
override fun enableLayoutAnimationsOnAndroid(): Boolean = false
6563

6664
override fun enableLayoutAnimationsOnIOS(): Boolean = true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<a6fc25aa098ac76ba77e53c5a1dfec58>>
7+
* @generated SignedSource<<1b685268279bbfd65820e45f5028d4dd>>
88
*/
99

1010
/**
@@ -42,7 +42,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
4242
private var enableFixForParentTagDuringReparentingCache: Boolean? = null
4343
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
4444
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
45-
private var enableJSRuntimeGCOnMemoryPressureOnIOSCache: Boolean? = null
4645
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
4746
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
4847
private var enableMainQueueModulesOnIOSCache: Boolean? = null
@@ -253,16 +252,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
253252
return cached
254253
}
255254

256-
override fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean {
257-
var cached = enableJSRuntimeGCOnMemoryPressureOnIOSCache
258-
if (cached == null) {
259-
cached = currentProvider.enableJSRuntimeGCOnMemoryPressureOnIOS()
260-
accessedFeatureFlags.add("enableJSRuntimeGCOnMemoryPressureOnIOS")
261-
enableJSRuntimeGCOnMemoryPressureOnIOSCache = cached
262-
}
263-
return cached
264-
}
265-
266255
override fun enableLayoutAnimationsOnAndroid(): Boolean {
267256
var cached = enableLayoutAnimationsOnAndroidCache
268257
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<d3ac43cad11c74d7f7ee12e776f99282>>
7+
* @generated SignedSource<<e9d98230a39a243ea748105a77ebd1e0>>
88
*/
99

1010
/**
@@ -59,8 +59,6 @@ public interface ReactNativeFeatureFlagsProvider {
5959

6060
@DoNotStrip public fun enableIOSViewClipToPaddingBox(): Boolean
6161

62-
@DoNotStrip public fun enableJSRuntimeGCOnMemoryPressureOnIOS(): Boolean
63-
6462
@DoNotStrip public fun enableLayoutAnimationsOnAndroid(): Boolean
6563

6664
@DoNotStrip public fun enableLayoutAnimationsOnIOS(): Boolean

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<9a8d560adc9345a33b72f760f08628bd>>
7+
* @generated SignedSource<<7199b7c0c5d3b389e504f615a813b6c5>>
88
*/
99

1010
/**
@@ -147,12 +147,6 @@ class ReactNativeFeatureFlagsJavaProvider
147147
return method(javaProvider_);
148148
}
149149

150-
bool enableJSRuntimeGCOnMemoryPressureOnIOS() override {
151-
static const auto method =
152-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableJSRuntimeGCOnMemoryPressureOnIOS");
153-
return method(javaProvider_);
154-
}
155-
156150
bool enableLayoutAnimationsOnAndroid() override {
157151
static const auto method =
158152
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableLayoutAnimationsOnAndroid");
@@ -421,11 +415,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableIOSViewClipToPaddingBox(
421415
return ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
422416
}
423417

424-
bool JReactNativeFeatureFlagsCxxInterop::enableJSRuntimeGCOnMemoryPressureOnIOS(
425-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
426-
return ReactNativeFeatureFlags::enableJSRuntimeGCOnMemoryPressureOnIOS();
427-
}
428-
429418
bool JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnAndroid(
430419
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
431420
return ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid();
@@ -656,9 +645,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
656645
makeNativeMethod(
657646
"enableIOSViewClipToPaddingBox",
658647
JReactNativeFeatureFlagsCxxInterop::enableIOSViewClipToPaddingBox),
659-
makeNativeMethod(
660-
"enableJSRuntimeGCOnMemoryPressureOnIOS",
661-
JReactNativeFeatureFlagsCxxInterop::enableJSRuntimeGCOnMemoryPressureOnIOS),
662648
makeNativeMethod(
663649
"enableLayoutAnimationsOnAndroid",
664650
JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnAndroid),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<656fc82f692a639b7c08f289a7637507>>
7+
* @generated SignedSource<<3d383541d829ce105ac5e97a5d35ded1>>
88
*/
99

1010
/**
@@ -84,9 +84,6 @@ class JReactNativeFeatureFlagsCxxInterop
8484
static bool enableIOSViewClipToPaddingBox(
8585
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
8686

87-
static bool enableJSRuntimeGCOnMemoryPressureOnIOS(
88-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
89-
9087
static bool enableLayoutAnimationsOnAndroid(
9188
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
9289

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<42a15fd8d0ea1cfe23bc3f98627a9090>>
7+
* @generated SignedSource<<33afce4bb21ad12cb920eee24ba921b2>>
88
*/
99

1010
/**
@@ -98,10 +98,6 @@ bool ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox() {
9898
return getAccessor().enableIOSViewClipToPaddingBox();
9999
}
100100

101-
bool ReactNativeFeatureFlags::enableJSRuntimeGCOnMemoryPressureOnIOS() {
102-
return getAccessor().enableJSRuntimeGCOnMemoryPressureOnIOS();
103-
}
104-
105101
bool ReactNativeFeatureFlags::enableLayoutAnimationsOnAndroid() {
106102
return getAccessor().enableLayoutAnimationsOnAndroid();
107103
}

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<f14956751ac132ac58fcbd2dd2f331a9>>
7+
* @generated SignedSource<<b931e0ebaa1c91c42caf9dd6e56a7663>>
88
*/
99

1010
/**
@@ -129,11 +129,6 @@ class ReactNativeFeatureFlags {
129129
*/
130130
RN_EXPORT static bool enableIOSViewClipToPaddingBox();
131131

132-
/**
133-
* Trigger JS runtime GC on memory pressure event on iOS
134-
*/
135-
RN_EXPORT static bool enableJSRuntimeGCOnMemoryPressureOnIOS();
136-
137132
/**
138133
* When enabled, LayoutAnimations API will animate state changes on Android.
139134
*/

0 commit comments

Comments
 (0)