Hi Daryl,

As far as I know there is no reason other than that it was not necessary so
far. Feel free to submit a patch.

Thanks,
Andreas

On Tue, Nov 23, 2021 at 1:19 AM Daryl Haresign <[email protected]> wrote:

> We recently discovered an interesting result of LTO, whereby
> Isolate::Initialize() was failing where it checks that the platform's
> foreground task runner has non-nestable tasks enabled:
> https://source.chromium.org/chromium/chromium/src/+/main:v8/src/api/api.cc;l=8690-8696?q=Isolate::Initi&ss=chromium
>
> Despite our implementation returning true, the check was still failing.
> After some investigation it turned out that within the dll that houses
> Chromium, LTO had kicked in and turned the virtual call into simple load:
> https://github.com/llvm/llvm-project/blob/release/13.x/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp#L14-L18
>
> As our implementation or v8::TaskRunner lives outside of this dll, it
> wasn't generated with this extra slot for the value next to its vtable, so
> at runtime Isolate::Initialize() was loading garbage and thus the check was
> failing.
>
> It seems that the fix is to mark the v8::TaskRunner class as V8_EXPORT so
> that LTO doesn't apply: https://clang.llvm.org/docs/LTOVisibility.html
>
> Is there any reason these weren't marked already?  If not, I'm happy to
> submit a patch.
>
> Thanks,
> Daryl.
>
> --
> --
> v8-dev mailing list
> [email protected]
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-dev/5121dc21-9ad7-4bcf-b8ba-aa3964bdcf53n%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-dev/5121dc21-9ad7-4bcf-b8ba-aa3964bdcf53n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
v8-dev mailing list
[email protected]
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-dev/CAELSTvcrdtp-kahjCvw2Ae6hknzC75RX8Kv4pXjTUo1%2BJVmy%2BA%40mail.gmail.com.

Reply via email to