haikuwebkit/LayoutTests/js/dom/document-all-strict-eq.html

11 lines
235 B
HTML
Raw Permalink Normal View History

Strict Equality on objects should only check that one of the two sides is an object. https://bugs.webkit.org/show_bug.cgi?id=145992 Source/JavaScriptCore: This patch adds a new optimization for checking strict equality on objects. If we speculate that a strict equality comparison has an object on one side we only need to type check that side. Equality is then determined by a pointer comparison between the two values (although in the 32-bit case we must also check that the other side is a cell). Once LICM hoists type checks out of a loop we can be cleverer about how we choose the operand we type check if both are speculated to be objects. For testing I added the addressOf function, which returns the address of a Cell to the runtime. Patch by Keith Miller <keith_miller@apple.com> on 2015-06-24 Reviewed by Mark Lam. * dfg/DFGFixupPhase.cpp: (JSC::DFG::FixupPhase::fixupNode): * dfg/DFGSpeculativeJIT.cpp: (JSC::DFG::SpeculativeJIT::compileStrictEq): * dfg/DFGSpeculativeJIT.h: * dfg/DFGSpeculativeJIT32_64.cpp: (JSC::DFG::SpeculativeJIT::compileObjectStrictEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectStrictEquality): * dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::compileObjectStrictEquality): (JSC::DFG::SpeculativeJIT::compilePeepHoleObjectStrictEquality): * ftl/FTLCapabilities.cpp: (JSC::FTL::canCompile): * ftl/FTLLowerDFGToLLVM.cpp: (JSC::FTL::DFG::LowerDFGToLLVM::compileCompareStrictEq): * jsc.cpp: (GlobalObject::finishCreation): (functionAddressOf): * tests/stress/equality-type-checking.js: Added. (Foo): (checkStrictEq): (checkStrictEqOther): LayoutTests: Patch by Keith Miller <keith_miller@apple.com> on 2015-06-24 Reviewed by Mark Lam. Adds a test that checks if strict equality checks with objects properly exit out of DFG code when dealing with document.all, which is an object that masquerades as undefined. * js/dom/document-all-strict-eq-expected.txt: Added. * js/dom/document-all-strict-eq.html: Added. * js/dom/script-tests/document-all-strict-eq.js: Added. (f): Canonical link: https://commits.webkit.org/164359@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-06-24 19:13:54 +00:00
<!DOCTYPE HTML>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<script src="script-tests/document-all-strict-eq.js"></script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>