Changeset 257605 in webkit
- Timestamp:
- Feb 27, 2020, 5:34:05 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/delete-property-poly-proto.js (added)
-
JSTests/stress/poly-proto-setter-adds-setter-in-middle.js (added)
-
JSTests/stress/poly-proto-setter-changes-setter-2.js (added)
-
JSTests/stress/poly-proto-setter-changes-setter.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/jit/Repatch.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r257590 r257605 1 2020-02-27 Justin Michaud <justin_michaud@apple.com> 2 3 Poly proto should work with property delete transitions 4 https://bugs.webkit.org/show_bug.cgi?id=208261 5 6 Reviewed by Saam Barati. 7 8 * stress/delete-property-poly-proto.js: Added. 9 (A.prototype.set x): 10 (A): 11 (B): 12 1 13 2020-02-27 Ross Kirsling <ross.kirsling@sony.com> 2 14 -
trunk/Source/JavaScriptCore/ChangeLog
r257598 r257605 1 2020-02-27 Justin Michaud <justin_michaud@apple.com> 2 3 Poly proto should work with property delete transitions 4 https://bugs.webkit.org/show_bug.cgi?id=208261 5 6 Reviewed by Saam Barati. 7 8 This patch fixes a bug where the combination of inline caching 9 and poly proto cause us to cache a setter call along a prototype chain that 10 is no longer the correct setter to call. This is exposed as a result of 11 https://bugs.webkit.org/show_bug.cgi?id=206430 since DefineOwnProperty used 12 to transition to uncacheable dictionary. 13 14 The case looks like this: 15 A - setter for x redefines x 16 | 17 B 18 | 19 C 20 21 We set (new C).x 22 23 Right now, we first call A's setter, then we try to figure out what the state of things 24 were before it was called in order to cache it. We just assume that A's setter still exists, and we cache it 25 without ever checking, In this patch, we ensure that the property exists and the attributes match in order to prevent crashing. 26 27 In the code, A = target, C = base. 28 29 Get is correct because it collects caching information before any calls. 30 31 The bug https://bugs.webkit.org/show_bug.cgi?id=208337 tracks the remaining semantic bugs around this code. 32 33 * jit/Repatch.cpp: 34 (JSC::tryCachePutByID): 35 1 36 2020-02-27 Basuke Suzuki <basuke.suzuki@sony.com> 2 37 -
trunk/Source/JavaScriptCore/jit/Repatch.cpp
r257399 r257605 689 689 if (!prototypeAccessChain) 690 690 return GiveUpOnCache; 691 offset = prototypeAccessChain->slotBaseStructure(vm, baseCell->structure(vm))->get(vm, ident.impl()); 691 unsigned attributes; 692 offset = prototypeAccessChain->slotBaseStructure(vm, baseCell->structure(vm))->get(vm, ident.impl(), attributes); 693 if (!isValidOffset(offset) || !(attributes & PropertyAttribute::Accessor)) 694 return RetryCacheLater; 692 695 } else { 693 696 prototypeAccessChain = nullptr;
Note:
See TracChangeset
for help on using the changeset viewer.