Inline some element methods for better stack overflow affinity (#78269)
This commit is contained in:
parent
c4ba26e31b
commit
5231a7dc59
@ -3310,6 +3310,7 @@ abstract class Element extends DiagnosticableTree implements BuildContext {
|
|||||||
///
|
///
|
||||||
/// See the [RenderObjectElement] documentation for more information on slots.
|
/// See the [RenderObjectElement] documentation for more information on slots.
|
||||||
@protected
|
@protected
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
Element? updateChild(Element? child, Widget? newWidget, Object? newSlot) {
|
Element? updateChild(Element? child, Widget? newWidget, Object? newSlot) {
|
||||||
if (newWidget == null) {
|
if (newWidget == null) {
|
||||||
if (child != 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
|
/// The element returned by this function will already have been mounted and
|
||||||
/// will be in the "active" lifecycle state.
|
/// will be in the "active" lifecycle state.
|
||||||
@protected
|
@protected
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
Element inflateWidget(Widget newWidget, Object? newSlot) {
|
Element inflateWidget(Widget newWidget, Object? newSlot) {
|
||||||
assert(newWidget != null);
|
assert(newWidget != null);
|
||||||
final Key? key = newWidget.key;
|
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 by the [BuildOwner] when [BuildOwner.scheduleBuildFor] has been
|
||||||
/// called to mark this element dirty, by [mount] when the element is first
|
/// called to mark this element dirty, by [mount] when the element is first
|
||||||
/// built, and by [update] when the widget has changed.
|
/// built, and by [update] when the widget has changed.
|
||||||
|
@pragma('vm:prefer-inline')
|
||||||
void rebuild() {
|
void rebuild() {
|
||||||
assert(_lifecycleState != _ElementLifecycle.initial);
|
assert(_lifecycleState != _ElementLifecycle.initial);
|
||||||
if (_lifecycleState != _ElementLifecycle.active || !_dirty)
|
if (_lifecycleState != _ElementLifecycle.active || !_dirty)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user