12015-11-19 Chris Dumez <cdumez@apple.com>
2
3 Caching of properties on objects that have named property getters is sometimes incorrect
4 https://bugs.webkit.org/show_bug.cgi?id=151453
5 <rdar://problem/23049343>
6
7 Reviewed by NOBODY (OOPS!).
8
9 In r188590, we dropped the JSC::GetOwnPropertySlotIsImpure TypeInfo flag for
10 interfaces that have a non-'OverrideBuiltins' named property getter in order
11 to allow caching of properties returns by GetOwnPropertySlot(). We assumed
12 this was safe as it was no longer possible for named properties to override
13 own properties (or properties on the prototype).
14
15 However, there is an issue when we cache the non-existence of a property.
16 Even though at one point the property did not exist, a named property with
17 this name may later become available. In such case, caching would cause us
18 to wrongly report a property as missing.
19
20 To address the problem, this patch introduces a new
21 GetOwnPropertySlotIsImpureForPropertyAbsence TypeInfo flag and uses it for
22 interfaces that have a non-'OverrideBuiltins' named property getter. This
23 will cause us to not cache the fact that a property is missing on such
24 objects, while maintaining the performance win from r188590 in the common
25 case.
26
27 Test: fast/dom/NamedNodeMap-named-getter-caching.html
28
29 * bindings/scripts/CodeGeneratorJS.pm:
30 (GenerateHeader):
31 * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
32 * bindings/scripts/test/JS/JSTestEventTarget.h:
33 * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
34