Changeset 202936 in webkit
- Timestamp:
- Jul 7, 2016, 3:15:04 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dfg/DFGAbstractInterpreterInlines.h (modified) (1 diff)
-
tests/stress/to-this-on-constant-lexical-environment.js (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r202926 r202936 1 2016-07-07 Saam Barati <sbarati@apple.com> 2 3 ToThis constant folding in DFG is incorrect when the structure indicates that toThis is overridden 4 https://bugs.webkit.org/show_bug.cgi?id=159501 5 <rdar://problem/27109354> 6 7 Reviewed by Mark Lam. 8 9 We *cannot* constant fold ToThis when the structure of an object 10 indicates that toThis() is overridden. isToThisAnIdentity() inside 11 AbstractInterpreterInlines accidentally wrote the opposite rule. 12 The rule was written as we can constant fold ToThis only when 13 toThis() is overridden. To fix the bug, we must write the rule 14 as isToThisAnIdentity() can only be true as long as the structure 15 set indicates that no structures override toThis(). 16 17 We could probably get more clever in the future and notice 18 when we're dealing with a constant |this| values. For example, 19 a ToThis might occur on a constant JSLexicalEnvironment. We could 20 implement the rules of JSLexicalEnvironment's toThis() implementation 21 inside AI/constant folding. 22 23 * dfg/DFGAbstractInterpreterInlines.h: 24 (JSC::DFG::isToThisAnIdentity): 25 * tests/stress/to-this-on-constant-lexical-environment.js: Added. 26 (foo.bar): 27 (foo.inner): 28 (foo): 29 1 30 2016-07-07 Benjamin Poulain <benjamin@webkit.org> 2 31 -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r202680 r202936 168 168 overridesToThis = true; 169 169 }); 170 return overridesToThis;170 return !overridesToThis; 171 171 } 172 172
Note:
See TracChangeset
for help on using the changeset viewer.