RESOLVED FIXED Bug 163005
[DOMJIT] Implement Node accessors in DOMJIT
https://bugs.webkit.org/show_bug.cgi?id=163005
Summary [DOMJIT] Implement Node accessors in DOMJIT
Yusuke Suzuki
Reported 2016-10-06 03:33:06 PDT
Let's implement DOMJIT Patchpoints for firstChild, lastChild, nextSibling, previousSibling, parentNode.
Attachments
Patch (39.47 KB, patch)
2016-10-06 22:18 PDT, Yusuke Suzuki
no flags
Archive of layout-test-results from ews102 for mac-yosemite (961.96 KB, application/zip)
2016-10-06 23:33 PDT, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (948.78 KB, application/zip)
2016-10-06 23:38 PDT, Build Bot
no flags
Patch (42.14 KB, patch)
2016-10-07 00:06 PDT, Yusuke Suzuki
no flags
Patch (48.66 KB, patch)
2016-10-07 00:49 PDT, Yusuke Suzuki
no flags
Archive of layout-test-results from ews101 for mac-yosemite (822.20 KB, application/zip)
2016-10-07 02:07 PDT, Build Bot
no flags
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (935.78 KB, application/zip)
2016-10-07 02:10 PDT, Build Bot
no flags
Patch (47.97 KB, patch)
2016-10-07 10:42 PDT, Yusuke Suzuki
no flags
Patch (49.15 KB, patch)
2016-10-07 10:55 PDT, Yusuke Suzuki
no flags
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (1.10 MB, application/zip)
2016-10-07 12:23 PDT, Build Bot
no flags
Archive of layout-test-results from ews101 for mac-yosemite (1.03 MB, application/zip)
2016-10-07 12:33 PDT, Build Bot
no flags
Patch (51.67 KB, patch)
2016-10-07 13:12 PDT, Yusuke Suzuki
no flags
Patch (60.00 KB, patch)
2016-10-07 17:08 PDT, Yusuke Suzuki
fpizlo: review+
Patch for landing (59.02 KB, patch)
2016-10-10 12:19 PDT, Yusuke Suzuki
no flags
Yusuke Suzuki
Comment 1 2016-10-06 22:18:01 PDT
Created attachment 290894 [details] Patch WIP: initial working prototype
WebKit Commit Bot
Comment 2 2016-10-06 22:19:40 PDT
Attachment 290894 [details] did not pass style-queue: ERROR: Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] ERROR: Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] Total errors found: 2 in 23 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3 2016-10-06 23:33:53 PDT
Comment on attachment 290894 [details] Patch Attachment 290894 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2235633 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 4 2016-10-06 23:33:57 PDT
Created attachment 290902 [details] Archive of layout-test-results from ews102 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 5 2016-10-06 23:38:10 PDT
Comment on attachment 290894 [details] Patch Attachment 290894 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2235646 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 6 2016-10-06 23:38:13 PDT
Created attachment 290903 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Yusuke Suzuki
Comment 7 2016-10-07 00:06:39 PDT
WebKit Commit Bot
Comment 8 2016-10-07 00:18:05 PDT
Attachment 290907 [details] did not pass style-queue: ERROR: Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpoint.h:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] ERROR: Source/WebCore/ForwardingHeaders/domjit/DOMJITPatchpointParams.h:0: No copyright message found. You should have a line: "Copyright [year] <Copyright Owner>" [legal/copyright] [5] Total errors found: 2 in 25 files If any of these errors are false positives, please file a bug against check-webkit-style.
Yusuke Suzuki
Comment 9 2016-10-07 00:49:07 PDT
Build Bot
Comment 10 2016-10-07 02:07:21 PDT
Comment on attachment 290908 [details] Patch Attachment 290908 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2236277 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 11 2016-10-07 02:07:24 PDT
Created attachment 290914 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Build Bot
Comment 12 2016-10-07 02:10:40 PDT
Comment on attachment 290908 [details] Patch Attachment 290908 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2236285 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 13 2016-10-07 02:10:43 PDT
Created attachment 290915 [details] Archive of layout-test-results from ews107 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Yusuke Suzuki
Comment 14 2016-10-07 10:42:18 PDT
Yusuke Suzuki
Comment 15 2016-10-07 10:55:26 PDT
Build Bot
Comment 16 2016-10-07 12:23:09 PDT
Comment on attachment 290945 [details] Patch Attachment 290945 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/2239016 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 17 2016-10-07 12:23:13 PDT
Created attachment 290954 [details] Archive of layout-test-results from ews106 for mac-yosemite-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-yosemite-wk2 Platform: Mac OS X 10.10.5
Build Bot
Comment 18 2016-10-07 12:33:18 PDT
Comment on attachment 290945 [details] Patch Attachment 290945 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/2239060 New failing tests: imported/w3c/web-platform-tests/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-support.htm
Build Bot
Comment 19 2016-10-07 12:33:22 PDT
Created attachment 290956 [details] Archive of layout-test-results from ews101 for mac-yosemite The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-yosemite Platform: Mac OS X 10.10.5
Yusuke Suzuki
Comment 20 2016-10-07 13:12:36 PDT
Yusuke Suzuki
Comment 21 2016-10-07 17:08:53 PDT
Sam Weinig
Comment 22 2016-10-07 18:34:13 PDT
Cool!
Filip Pizlo
Comment 23 2016-10-10 11:05:38 PDT
Comment on attachment 290985 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290985&action=review > Source/JavaScriptCore/domjit/DOMJITPatchpoint.h:65 > + bool useTagMaskRegister { true }; > + bool useTagTypeNumberRegister { true }; Can we just make these always true and remove them? > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:8737 > + if (domJIT->useTagMaskRegister) > + patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister)); > + if (domJIT->useTagTypeNumberRegister) > + patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister)); It's relatively cheap to do this, so we could just do it all of the time. I think that's what the get_by_id/put_by_id patchpoints do, for example. Heck I think we also do it for ValueAdd and friends when emitting them in snippet (i.e. patchpoint) mode. Also, why are you making them late registers? I think it's correct, but stronger than what we need. If the result is Void then you don't have to worry about them interfering with result. If the result is not Void and you are already using SomeEarlyRegister for the result, then the result is already going to interfere with early uses. Also, early uses already interfere with scratches. It's OK to keep the code this way, since it's telling a sound truth, but I'm curious if you needed it to solve some bug! > Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:8784 > + if (domJIT->useTagMaskRegister) > + patchpoint->append(m_tagMask, ValueRep::lateReg(GPRInfo::tagMaskRegister)); > + if (domJIT->useTagTypeNumberRegister) > + patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister)); Ditto. > Source/WTF/wtf/StdLibExtras.h:71 > +#define CAST_OFFSET(from, to) (reinterpret_cast<uintptr_t>(static_cast<to>((reinterpret_cast<from>(0x4000)))) - 0x4000) Nice. That's so evil. > Source/WebCore/domjit/DOMJITHelpers.h:42 > +inline CCallHelpers::Jump branchIfNotWorldIsNormal(CCallHelpers& jit, GPRReg globalObject) I love this style. I wish that we had written CCallHelpers and AssemblyHelpers this way.
Yusuke Suzuki
Comment 24 2016-10-10 11:50:51 PDT
Comment on attachment 290985 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=290985&action=review >> Source/JavaScriptCore/domjit/DOMJITPatchpoint.h:65 >> + bool useTagTypeNumberRegister { true }; > > Can we just make these always true and remove them? OK. Dropped. >> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:8737 >> + patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister)); > > It's relatively cheap to do this, so we could just do it all of the time. I think that's what the get_by_id/put_by_id patchpoints do, for example. Heck I think we also do it for ValueAdd and friends when emitting them in snippet (i.e. patchpoint) mode. > > Also, why are you making them late registers? I think it's correct, but stronger than what we need. If the result is Void then you don't have to worry about them interfering with result. If the result is not Void and you are already using SomeEarlyRegister for the result, then the result is already going to interfere with early uses. Also, early uses already interfere with scratches. It's OK to keep the code this way, since it's telling a sound truth, but I'm curious if you needed it to solve some bug! Right. resultConstraint change is used to make the patchpoint environment in FTL closer to one in DFG: the result reg interferes with early uses. On the other hand, this change does not fix any bugs. The previous one just works. And you're right. This patchpoint already said that the result is SomeEarlyRegister. So we can just use ValueRep::reg() and they interfere with the other early uses and the result. Changed it to ValueRep::reg and always added this constraint. >> Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:8784 >> + patchpoint->append(m_tagTypeNumber, ValueRep::lateReg(GPRInfo::tagTypeNumberRegister)); > > Ditto. Fixed. >> Source/WebCore/domjit/DOMJITHelpers.h:42 >> +inline CCallHelpers::Jump branchIfNotWorldIsNormal(CCallHelpers& jit, GPRReg globalObject) > > I love this style. I wish that we had written CCallHelpers and AssemblyHelpers this way. Yeah, this allows us to extend helpers easily in everywhere (including outside of JSC like WebCore)
Yusuke Suzuki
Comment 25 2016-10-10 12:19:30 PDT
Created attachment 291136 [details] Patch for landing
Yusuke Suzuki
Comment 26 2016-10-10 13:00:34 PDT
Note You need to log in before you can comment on or make changes to this bug.