Commit 34a9c0b
committed
[1.4>master] [MERGE #2298 @ThomsonTan] Remove downward lookup when searching shadowed property in prototype chain in for...in
Merge pull request #2298 from ThomsonTan:FixShadowPropertyInForIn
The previous fix of shadowing non-enumerable property for for...in (#2175) added downward lookup in prototype chain which could degrade performance in edge cases. This fix followed suggestion from Curtis and only ignores lookup in prototype chain if there is no enumerable properties in the whole chain, otherwise search from the first prototype.
The perf data for which we optimized for in enumerator looks flat.File tree
2 files changed
+6
-35
lines changed- lib/Runtime/Library
2 files changed
+6
-35
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | 17 | | |
20 | 18 | | |
21 | | - | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
53 | 50 | | |
54 | 51 | | |
55 | 52 | | |
56 | | - | |
| 53 | + | |
57 | 54 | | |
58 | 55 | | |
| 56 | + | |
59 | 57 | | |
60 | 58 | | |
61 | 59 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | | - | |
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 207 | + | |
236 | 208 | | |
237 | 209 | | |
238 | 210 | | |
| |||
244 | 216 | | |
245 | 217 | | |
246 | 218 | | |
247 | | - | |
| 219 | + | |
248 | 220 | | |
249 | 221 | | |
250 | | - | |
| 222 | + | |
251 | 223 | | |
252 | 224 | | |
253 | 225 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
0 commit comments