It seems like Object.is has very poor performance; even polyfill performs much better than the built-in method (2x). Also for comparison "===" performs ~10x. See the following benchmarks: https://jsperf.com/string-object-is-performance https://jsperf.com/object-is-vs-polyfill You can see similar issue fixed for V8 here: https://bugs.chromium.org/p/v8/issues/detail?id=7007
<rdar://problem/39781064>
Created attachment 339081 [details] Patch WIP: 64bit works.
Created attachment 339084 [details] Patch
Created attachment 339085 [details] Patch
Ping?
Comment on attachment 339085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339085&action=review > Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:2643 > + if (argumentCountIncludingThis != 3) Why not < instead of !=? > Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:6383 > + m_jit.compareDouble(CCallHelpers::DoubleNotEqualOrUnordered, arg1FPR, arg1FPR, tempGPR); Since this code branches internally, it feels like we should only do it if the doubles aren’t bitwise equal
Comment on attachment 339085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339085&action=review >> Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp:2643 >> + if (argumentCountIncludingThis != 3) > > Why not < instead of !=? Fixed. >> Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:6383 >> + m_jit.compareDouble(CCallHelpers::DoubleNotEqualOrUnordered, arg1FPR, arg1FPR, tempGPR); > > Since this code branches internally, it feels like we should only do it if the doubles aren’t bitwise equal OK, fixed.
Committed r231224: <https://trac.webkit.org/changeset/231224>
The test added with this change is failing on the 32-bit JSC bot: stress/object-is.js.default: Exception: Error: bad value: true stress/object-is.js.default: shouldBe@object-is.js:3:24 stress/object-is.js.default: global code@object-is.js:67:13 stress/object-is.js.default: ERROR: Unexpected exit code: 3 FAIL: stress/object-is.js.default https://build.webkit.org/builders/Apple%20High%20Sierra%2032-bit%20JSC%20%28BuildAndTest%29/builds/1808
Committed r231284: <https://trac.webkit.org/changeset/231284>