Commit f997d62
[html] Better code for Element / _ChildrenElementList method
Two tricks let us compile this more efficiently:
e.children.addAll(cs);
Normally, get$children is inlined, returning a _ChildrenElementList
wrapper, generating:
new W._ChildrenElementList(e, e.children).addAll$1(0, cs);
The two tricks:
1. Split _ChildElementList.addAll into an 'unwrap' that then calls the
logic in '_addAll'
2. Add information about the properties of e.children that allow it to
be removed.
With these tricks, dart2js can optimize the code to this version that
avoids allocating a wrapper or accessing the 'children' property:
W._ChildrenElementList__addAll(e, cs);
Change-Id: Ifdf533ac4f9790f09f87302e67304b5696097266
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153904
Reviewed-by: Srujan Gaddam <[email protected]>
Commit-Queue: Stephen Adams <[email protected]>1 parent fdf4e36 commit f997d62
3 files changed
Lines changed: 44 additions & 8 deletions
File tree
- sdk/lib/html/dart2js
- tools/dom
- scripts
- templates/html/impl
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11722 | 11722 | | |
11723 | 11723 | | |
11724 | 11724 | | |
| 11725 | + | |
| 11726 | + | |
| 11727 | + | |
| 11728 | + | |
11725 | 11729 | | |
11726 | 11730 | | |
11727 | 11731 | | |
| |||
11775 | 11779 | | |
11776 | 11780 | | |
11777 | 11781 | | |
| 11782 | + | |
| 11783 | + | |
| 11784 | + | |
| 11785 | + | |
11778 | 11786 | | |
11779 | 11787 | | |
11780 | 11788 | | |
| |||
11823 | 11831 | | |
11824 | 11832 | | |
11825 | 11833 | | |
11826 | | - | |
| 11834 | + | |
| 11835 | + | |
| 11836 | + | |
| 11837 | + | |
11827 | 11838 | | |
11828 | 11839 | | |
11829 | 11840 | | |
| |||
12965 | 12976 | | |
12966 | 12977 | | |
12967 | 12978 | | |
| 12979 | + | |
| 12980 | + | |
| 12981 | + | |
| 12982 | + | |
| 12983 | + | |
| 12984 | + | |
| 12985 | + | |
| 12986 | + | |
| 12987 | + | |
| 12988 | + | |
12968 | 12989 | | |
12969 | 12990 | | |
12970 | 12991 | | |
| |||
14824 | 14845 | | |
14825 | 14846 | | |
14826 | 14847 | | |
14827 | | - | |
14828 | | - | |
14829 | | - | |
14830 | | - | |
14831 | | - | |
14832 | 14848 | | |
14833 | 14849 | | |
14834 | 14850 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
391 | 390 | | |
392 | 391 | | |
393 | 392 | | |
| |||
791 | 790 | | |
792 | 791 | | |
793 | 792 | | |
| 793 | + | |
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
| |||
149 | 157 | | |
150 | 158 | | |
151 | 159 | | |
152 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
153 | 164 | | |
154 | 165 | | |
155 | 166 | | |
| |||
667 | 678 | | |
668 | 679 | | |
669 | 680 | | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
670 | 690 | | |
671 | 691 | | |
672 | 692 | | |
| |||
0 commit comments