Hi Andrew, I can't answer your questions about vtables, but I can try to untangle the "clever things" in V8's codebase that make it difficult to find the caller to the constructor. - The ArrayTimSort builtin is defined in V8's Torque DSL here <https://source.chromium.org/chromium/chromium/src/+/main:v8/third_party/v8/builtins/array-sort.tq;l=1359?q=ArrayTimSort&ss=chromium>, and called here <https://source.chromium.org/chromium/chromium/src/+/main:v8/third_party/v8/builtins/array-sort.tq;l=1394?q=ArrayTimSort&ss=chromium> . - The torque compiler generates a bunch of C++ code to implement the buitlins and their interface descriptors. One of the things it creates is a list of the Torque defined builtins in a macro, with the ArrayTimSort one listed here <https://source.chromium.org/chromium/chromium/src/+/main:out/android-Debug/gen/v8/torque-generated/builtin-definitions.h;l=401;bpv=1;bpt=1?q=ArrayTimSort&ss=chromium&start=11> . - This macro is used to define a Builtin_ArrayTimSort_InterfaceDescriptor = ArrayTimSortDescriptor here <https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins-descriptors.h;l=34?q=Builtin_%23%23Name%23%23_InterfaceDescriptor&ss=chromium> using V8's favorite macro magic trick. - This descriptor is then created by the call to Builtins::CallableFor(..., Builtins::kArrayTimSort) here <https://source.chromium.org/chromium/chromium/src/+/main:out/win-Debug/gen/v8/torque-generated/third_party/v8/builtins/array-sort-tq-csa.cc;l=11665?q=ArrayTimSort&ss=chromium> in the auto-generated C++ code created by the Torque code listed in step 1, via the macro-magic switch statement here <https://source.chromium.org/chromium/chromium/src/+/main:v8/src/builtins/builtins.cc;drc=9de41c281bbe975c886fb14bc13b1df6c06f3864;l=186?q=CallableFor&ss=chromium> .
Who said V8 was complicated?... Cheers, Ross On Thu, 3 Jun 2021 at 15:19, Andrew Grieve <agri...@chromium.org> wrote: > I'm investigating why ArrayTimSortDescriptor does not have a vtable > without -fwhole-program-vtables, but does have one with the flag. > > Given that it does have virtual methods, I'd like to first figure out why > it does not have a vtable without the flag. One theory is just that its > constructor is never called. I can't find in codesearch where its > constructor is called... but V8 is often doing clever things, so I thought > I'd ask :). > > The supersize breakdown > <https://chrome-supersize.firebaseapp.com/viewer.html?load_url=https%3A%2F%2Fstorage.googleapis.com%2Fchromium-binary-size-trybot-results%2Fandroid-binary-size%2F2021%2F02%2F22%2F740612%2Fsupersize_diff.sizediff&include=ArrayTimSortDescriptor> > shows this (from crrev/2713049/1 > <https://chromium-review.googlesource.com/c/chromium/src/+/2713049/1>). > You can also filter by "interface-descriptors" to see that the same is true > for other similar classes. I just thought I'd pick on > ArrayTimSortDescriptor :P. > > Any pointers or theories? > > > -- > -- > v8-dev mailing list > v8-dev@googlegroups.com > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to the Google Groups > "v8-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to v8-dev+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-dev/CABiQX1UdaDkp5VVKSpU77HueKjCr%3DsEF3WXR8t0aV8-%2B1VwgSw%40mail.gmail.com > <https://groups.google.com/d/msgid/v8-dev/CABiQX1UdaDkp5VVKSpU77HueKjCr%3DsEF3WXR8t0aV8-%2B1VwgSw%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAP-rjT7LOVcdvrt-MNUCnJ7ENt5j74%2B%3DN16O5psZS3x%2BypDKQA%40mail.gmail.com.