devirtualize calls to GetText() / TextLength() when we know we have a Text node

RESOLVED FIXED in Firefox 69

Status

()

task
RESOLVED FIXED
Last month
27 days ago

People

(Reporter: heycam, Assigned: heycam)

Tracking

unspecified
mozilla69
Points:
---

Firefox Tracking Flags

(firefox69 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

Last month

We have many calls to nsIContent::{GetText,TextLength} when we know we have a Text node. Unfortunately we can't make CharacterData::GetText final, since DocumentType overrides it, and I'm not in the mood for extricating DocumentType from CharacterData right now.

Comment 4

28 days ago
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/82b18d61da00
Devirtualize calls to GetText() / TextLength() when we know we have a Text node. r=smaug,jfkthame

Comment 5

28 days ago

Backed out for build bustages.

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&revision=82b18d61da0017c61a072f20d2928de0e6ba1b87&selectedJob=248115325

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=248115325&repo=autoland&lineNumber=20886

03:48:49 INFO - In file included from z:/build/build/src/obj-firefox/dom/events/Unified_cpp_dom_events0.cpp:74:
03:48:49 INFO - z:/build/build/src/dom/events/ContentEventHandler.cpp(616,13): error: no matching function for call to 'CountNewlinesInXPLength'
03:48:49 INFO - ? CountNewlinesInXPLength(aContent, aMaxLength)
03:48:49 INFO - ^~~~~~~~~~~~~~~~~~~~~~~
03:48:49 INFO - z:/build/build/src/dom/events/ContentEventHandler.cpp(520,17): note: candidate function not viable: cannot convert from base class pointer 'nsIContent *' to derived class pointer 'mozilla::dom::Text ' for 1st argument
03:48:49 INFO - static uint32_t CountNewlinesInXPLength(Text
aText, uint32_t aXPLength) {
03:48:49 INFO - ^
03:48:49 INFO - z:/build/build/src/dom/events/ContentEventHandler.cpp(637,26): error: no matching function for call to 'CountNewlinesInNativeLength'
03:48:49 INFO - return aNativeOffset - CountNewlinesInNativeLength(aContent, aNativeOffset);
03:48:49 INFO - ^~~~~~~~~~~~~~~~~~~~~~~~~~~
03:48:49 INFO - z:/build/build/src/dom/events/ContentEventHandler.cpp(535,17): note: candidate function not viable: cannot convert from base class pointer 'nsIContent *' to derived class pointer 'mozilla::dom::Text ' for 1st argument
03:48:49 INFO - static uint32_t CountNewlinesInNativeLength(Text
aText,
03:48:49 INFO - ^
03:48:49 INFO - 2 errors generated.
03:48:49 INFO - z:/build/build/src/config/rules.mk:814: recipe for target 'Unified_cpp_dom_events0.obj' failed
03:48:49 INFO - mozmake.EXE[4]: *** [Unified_cpp_dom_events0.obj] Error 1
03:48:49 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/events'
03:48:49 INFO - mozmake.EXE[4]: *** Waiting for unfinished jobs....
03:48:49 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:49 INFO - dom/base/Unified_cpp_dom_base6.obj
03:48:49 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:49 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/events'
03:48:49 INFO - z:/build/build/src/sccache/sccache.exe z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -FoEventStateManager.obj -c -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DDEBUG=1 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/dom/events -Iz:/build/build/src/obj-firefox/dom/events -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/docshell/base -Iz:/build/build/src/dom/base -Iz:/build/build/src/dom/html -Iz:/build/build/src/dom/storage -Iz:/build/build/src/dom/svg -Iz:/build/build/src/dom/xml -Iz:/build/build/src/dom/xul -Iz:/build/build/src/js/xpconnect/wrappers -Iz:/build/build/src/layout/forms -Iz:/build/build/src/layout/generic -Iz:/build/build/src/layout/xul -Iz:/build/build/src/layout/xul/tree -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -Gw -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -Xclang -MP -Xclang -dependency-file -Xclang .deps/EventStateManager.obj.pp -Xclang -MT -Xclang EventStateManager.obj z:/build/build/src/dom/events/EventStateManager.cpp
03:48:49 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/events'
03:48:50 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file/ipc'
03:48:50 INFO - mkdir -p '.deps/'
03:48:50 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file/ipc'
03:48:50 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file/ipc'
03:48:50 INFO - dom/file/ipc/Unified_cpp_dom_file_ipc0.obj
03:48:50 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file/ipc'
03:48:50 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/bindings'
03:48:50 INFO - z:/build/build/src/sccache/sccache.exe z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -FoUnifiedBindings1.obj -c -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DDEBUG=1 -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DHAVE_SIDEBAR -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/dom/bindings -Iz:/build/build/src/obj-firefox/dom/bindings -Iz:/build/build/src/obj-firefox/dist/include/mozilla/dom -Iz:/build/build/src/dom/base -Iz:/build/build/src/dom/battery -Iz:/build/build/src/dom/canvas -Iz:/build/build/src/dom/geolocation -Iz:/build/build/src/dom/html -Iz:/build/build/src/dom/indexedDB -Iz:/build/build/src/dom/media/webaudio -Iz:/build/build/src/dom/media/webspeech/recognition -Iz:/build/build/src/dom/svg -Iz:/build/build/src/dom/xbl -Iz:/build/build/src/dom/xml -Iz:/build/build/src/dom/xslt/base -Iz:/build/build/src/dom/xslt/xpath -Iz:/build/build/src/dom/xul -Iz:/build/build/src/js/xpconnect/src -Iz:/build/build/src/js/xpconnect/wrappers -Iz:/build/build/src/layout/generic -Iz:/build/build/src/layout/style -Iz:/build/build/src/layout/xul/tree -Iz:/build/build/src/media/mtransport -Iz:/build/build/src/media/webrtc -Iz:/build/build/src/media/webrtc/signaling/src/common/time_profiling -Iz:/build/build/src/media/webrtc/signaling/src/peerconnection -Iz:/build/build/src/media/webrtc/trunk -Iz:/build/build/src/third_party/msgpack/include -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -Gw -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -Xclang -MP -Xclang -dependency-file -Xclang .deps/UnifiedBindings1.obj.pp -Xclang -MT -Xclang UnifiedBindings1.obj z:/build/build/src/obj-firefox/dom/bindings/UnifiedBindings1.cpp
03:48:50 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/bindings'
03:48:50 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file'
03:48:50 INFO - dom/file/Unified_cpp_dom_file1.obj
03:48:50 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file'
03:48:51 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file'
03:48:51 INFO - z:/build/build/src/sccache/sccache.exe z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -FoUnified_cpp_dom_file1.obj -c -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DDEBUG=1 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/dom/file -Iz:/build/build/src/obj-firefox/dom/file -Iz:/build/build/src/dom/file/ipc -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -Gw -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_dom_file1.obj.pp -Xclang -MT -Xclang Unified_cpp_dom_file1.obj z:/build/build/src/obj-firefox/dom/file/Unified_cpp_dom_file1.cpp
03:48:51 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file'
03:48:51 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:51 INFO - dom/base/Unified_cpp_dom_base7.obj
03:48:51 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:52 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:52 INFO - z:/build/build/src/sccache/sccache.exe z:/build/build/src/clang/bin/clang.exe --driver-mode=cl -FoUnified_cpp_dom_base3.obj -c -Iz:/build/build/src/obj-firefox/dist/stl_wrappers -DDEBUG=1 -DWIN32_LEAN_AND_MEAN -D_WIN32 -DWIN32 -D_CRT_RAND_S -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DOS_WIN=1 -D_UNICODE -DCHROMIUM_BUILD -DU_STATIC_IMPLEMENTATION -DUNICODE -D_WINDOWS -D_SECURE_ATL -DCOMPILER_MSVC -DHAVE_SIDEBAR -DSTATIC_EXPORTABLE_JS_API -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -Iz:/build/build/src/dom/base -Iz:/build/build/src/obj-firefox/dom/base -Iz:/build/build/src/dom/battery -Iz:/build/build/src/dom/events -Iz:/build/build/src/dom/media -Iz:/build/build/src/dom/network -Iz:/build/build/src/caps -Iz:/build/build/src/docshell/base -Iz:/build/build/src/dom/base -Iz:/build/build/src/dom/file -Iz:/build/build/src/dom/geolocation -Iz:/build/build/src/dom/html -Iz:/build/build/src/dom/ipc -Iz:/build/build/src/dom/storage -Iz:/build/build/src/dom/svg -Iz:/build/build/src/dom/u2f -Iz:/build/build/src/dom/xbl -Iz:/build/build/src/dom/xml -Iz:/build/build/src/dom/xslt/xpath -Iz:/build/build/src/dom/xul -Iz:/build/build/src/gfx/2d -Iz:/build/build/src/image -Iz:/build/build/src/js/xpconnect/loader -Iz:/build/build/src/js/xpconnect/src -Iz:/build/build/src/js/xpconnect/wrappers -Iz:/build/build/src/layout/base -Iz:/build/build/src/layout/forms -Iz:/build/build/src/layout/generic -Iz:/build/build/src/layout/style -Iz:/build/build/src/layout/svg -Iz:/build/build/src/layout/xul -Iz:/build/build/src/netwerk/base -Iz:/build/build/src/netwerk/url-classifier -Iz:/build/build/src/security/manager/ssl -Iz:/build/build/src/widget -Iz:/build/build/src/xpcom/ds -Iz:/build/build/src/netwerk/sctp/datachannel -Iz:/build/build/src/obj-firefox/ipc/ipdl/_ipdlheaders -Iz:/build/build/src/ipc/chromium/src -Iz:/build/build/src/ipc/glue -Iz:/build/build/src/obj-firefox/dist/include -Iz:/build/build/src/obj-firefox/dist/include/nspr -Iz:/build/build/src/obj-firefox/dist/include/nss -MD -FI z:/build/build/src/obj-firefox/mozilla-config.h -DMOZILLA_CLIENT -Qunused-arguments -guard:cf -Qunused-arguments -fcrash-diagnostics-dir=z:/build/public/build -TP -nologo -Zc:sizedDealloc- -D_HAS_EXCEPTIONS=0 -guard:cf -W3 -Gy -Zc:inline -Gw -Wno-inline-new-delete -Wno-invalid-offsetof -Wno-microsoft-enum-value -Wno-microsoft-include -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-deprecated-declarations -Wno-invalid-noreturn -Wno-inconsistent-missing-override -Wno-implicit-exception-spec-mismatch -Wno-unused-local-typedef -Wno-ignored-attributes -Wno-used-but-marked-unused -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING -GR- -Z7 -Xclang -load -Xclang z:/build/build/src/obj-firefox/build/clang-plugin/clang-plugin.dll -Xclang -add-plugin -Xclang moz-check -O2 -Oy- -WX -Xclang -MP -Xclang -dependency-file -Xclang .deps/Unified_cpp_dom_base3.obj.pp -Xclang -MT -Xclang Unified_cpp_dom_base3.obj z:/build/build/src/obj-firefox/dom/base/Unified_cpp_dom_base3.cpp
03:48:52 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/base'
03:48:52 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file/uri'
03:48:52 INFO - mkdir -p '.deps/'
03:48:52 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file/uri'
03:48:52 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/file/uri'
03:48:52 INFO - dom/file/uri/Unified_cpp_dom_file_uri0.obj
03:48:52 INFO - mozmake.EXE[4]: Leaving directory 'z:/build/build/src/obj-firefox/dom/file/uri'
03:48:53 INFO - mozmake.EXE[4]: Entering directory 'z:/build/build/src/obj-firefox/dom/fetch'

Backout: https://hg.mozilla.org/integration/autoland/rev/d795681e08ee85b905917247f81df03a451a2864

Flags: needinfo?(cam)
Assignee

Comment 6

28 days ago

Thanks, that's in an #ifdef XP_WIN section, which is why I missed it.

Flags: needinfo?(cam)

Comment 7

28 days ago
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e52d041dc3de
Devirtualize calls to GetText() / TextLength() when we know we have a Text node. r=smaug,jfkthame
Assignee

Comment 9

28 days ago
Flags: needinfo?(cam)

Comment 10

28 days ago
Pushed by cmccormack@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/932a983ac058
Devirtualize calls to GetText() / TextLength() when we know we have a Text node. r=smaug,jfkthame
Status: NEW → RESOLVED
Closed: 27 days ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.