Changeset 283332 in webkit
- Timestamp:
- Sep 30, 2021, 1:37:55 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/ai-typeof-needs-to-be-aware-of-proxy-2.js (added)
-
JSTests/stress/ai-typeof-needs-to-be-aware-of-proxy.js (added)
-
JSTests/stress/is-callable-in-ftl-needs-to-be-aware-of-proxy.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/bytecode/SpeculatedType.h (modified) (1 diff)
-
Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (modified) (3 diffs)
-
Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r283300 r283332 1 2021-09-30 Saam Barati <sbarati@apple.com> 2 3 The DFG/FTL need to be aware that Proxy's can produce "function" for typeof and might be callable 4 https://bugs.webkit.org/show_bug.cgi?id=230804 5 <rdar://problem/83543951> 6 7 Reviewed by Yusuke Suzuki. 8 9 * stress/ai-typeof-needs-to-be-aware-of-proxy-2.js: Added. 10 (assert): 11 (builtin.vm.createBuiltin): 12 (builtin2.vm.createBuiltin): 13 (let.p.new.Proxy): 14 * stress/ai-typeof-needs-to-be-aware-of-proxy.js: Added. 15 (assert): 16 (builtin.vm.createBuiltin): 17 (let.p.new.Proxy): 18 * stress/is-callable-in-ftl-needs-to-be-aware-of-proxy.js: Added. 19 (main): 20 1 21 2021-09-29 Mark Lam <mark.lam@apple.com> 2 22 -
trunk/Source/JavaScriptCore/ChangeLog
r283329 r283332 1 2021-09-30 Saam Barati <sbarati@apple.com> 2 3 The DFG/FTL need to be aware that Proxy's can produce "function" for typeof and might be callable 4 https://bugs.webkit.org/show_bug.cgi?id=230804 5 <rdar://problem/83543951> 6 7 Reviewed by Yusuke Suzuki. 8 9 This patch fixes a couple bugs: 10 - We were constant folding typeof on ProxyObject to "object" 11 even when ProxyObject might produce a callable Proxy, and hence, 12 should produce "function". This was a bug in AI. 13 - This also fixes a similar bug in IsCallable's implementation in 14 the FTL where we assumed that ProxyObject's type can't be callable. 15 16 * bytecode/SpeculatedType.h: 17 * dfg/DFGAbstractInterpreterInlines.h: 18 (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects): 19 * ftl/FTLLowerDFGToB3.cpp: 20 (JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq): 21 1 22 2021-09-30 Fujii Hironori <Hironori.Fujii@sony.com> 2 23 -
trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h
r282200 r283332 117 117 static constexpr SpeculatedType SpecFullTop = SpecBytecodeTop | SpecFullNumber; // It can be anything that bytecode could see plus exotic encodings of numbers. 118 118 119 static constexpr SpeculatedType SpecTypeofMightBeFunction = SpecFunction | SpecObjectOther | SpecProxyObject; // If you don't see these types, you can't be callable, and you can't have typeof produce "function". Inverse is not true, however. If you only see these types, you may produce more things than "function" in typeof, and you might not be callable. 120 119 121 // SpecCellCheck is the type set representing the values that can flow through a cell check. 120 122 // On 64-bit platforms, the empty value passes a cell check. Also, ~SpecCellCheck is the type -
trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h
r283098 r283332 1620 1620 // have masquaredes-as-undefined traps) and isn't a function? Then: we should fold 1621 1621 // this to true. 1622 if (!(child.m_type & ~(SpecObject - Spec ObjectOther - SpecFunction))) {1622 if (!(child.m_type & ~(SpecObject - SpecTypeofMightBeFunction))) { 1623 1623 setConstant(node, jsBoolean(true)); 1624 1624 constantWasSet = true; … … 1733 1733 } 1734 1734 1735 if (!(child.m_type & (SpecFunction | SpecObjectOther | SpecProxyObject))) {1735 if (!(child.m_type & SpecTypeofMightBeFunction)) { 1736 1736 setConstant(node, jsBoolean(false)); 1737 1737 constantWasSet = true; … … 1812 1812 // FIXME: We could use the masquerades-as-undefined watchpoint here. 1813 1813 // https://bugs.webkit.org/show_bug.cgi?id=144456 1814 if (!(abstractChild.m_type & ~(SpecObject - Spec ObjectOther - SpecFunction))) {1814 if (!(abstractChild.m_type & ~(SpecObject - SpecTypeofMightBeFunction))) { 1815 1815 setConstant(node, *m_graph.freeze(m_vm.smallStrings.objectString())); 1816 1816 break; -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r283207 r283332 19542 19542 LValue isExoticForTypeof(LValue cell, SpeculatedType type = SpecFullTop) 19543 19543 { 19544 if (!(type & SpecObjectOther))19544 if (!(type & (SpecObjectOther | SpecProxyObject))) 19545 19545 return m_out.booleanFalse; 19546 19546 return m_out.testNonZero32(
Note:
See TracChangeset
for help on using the changeset viewer.