From 5231a7dc595468bc89e454403e42688567e98aa8 Mon Sep 17 00:00:00 2001 From: Michael Goderbauer Date: Mon, 29 Mar 2021 13:34:04 -0700 Subject: [PATCH] Inline some element methods for better stack overflow affinity (#78269) --- packages/flutter/lib/src/widgets/framework.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index d3b343caf3..886accd388 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -3310,6 +3310,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { /// /// See the [RenderObjectElement] documentation for more information on slots. @protected + @pragma('vm:prefer-inline') Element? updateChild(Element? child, Widget? newWidget, Object? newSlot) { if (newWidget == null) { if (child != null) @@ -3583,6 +3584,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { /// The element returned by this function will already have been mounted and /// will be in the "active" lifecycle state. @protected + @pragma('vm:prefer-inline') Element inflateWidget(Widget newWidget, Object? newSlot) { assert(newWidget != null); final Key? key = newWidget.key; @@ -4236,6 +4238,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext { /// Called by the [BuildOwner] when [BuildOwner.scheduleBuildFor] has been /// called to mark this element dirty, by [mount] when the element is first /// built, and by [update] when the widget has changed. + @pragma('vm:prefer-inline') void rebuild() { assert(_lifecycleState != _ElementLifecycle.initial); if (_lifecycleState != _ElementLifecycle.active || !_dirty)