The CodeStubAssembler (and all its derived classes) is not compiled into
the shipping binaries, so all that infrastructure is indeed only available
at V8 build time.

It's probably most instructive to look at the existing entry points to the
"Turboshaft" part of the pipeline, such as graph-builder.cc
<https://chromium.googlesource.com/v8/v8/+/main/src/compiler/turboshaft/graph-builder.cc>
(for JS, taking a Turbofan Sea-of-Nodes graph as input) and
turboshaft-graph-interface.cc
<https://chromium.googlesource.com/v8/v8/+/main/src/wasm/turboshaft-graph-interface.cc>
(for Wasm, individual functions being called for slightly abstract-ified
versions of Wasm instructions) for inspiration.

If the compiler doesn't have the infrastructure you need, you can consider
following the example of irregexp and using the platform-specific
MacroAssembler directly. At least for an initial prototype for just one
platform, this may be both simpler and give better results. (For proper
productionization, a cross-platform implementation is then likely quite
desirable, but it doesn't necessarily need to be the first step.)

Good luck!


On Tue, Mar 11, 2025 at 10:20 AM Zaclegarssure <[email protected]>
wrote:

> Hi everyone, first time posting here.
> As part of my master thesis I'm working on improving the performances of
> the experimental non-backtracking regex engine of v8. In particular I plan
> to add native compilation to it, like it's done in Irregexp, to help close
> the performance gap between the two.
> I was wondering if there is a way to generate native code at runtime in a
> platform-agnostic manner, by leveraging Turbofan. At first glance, the
> CodeStubAssembler seems to do exactly this, but in the examples I've seen,
> the code was generated at build time only. Is there a way to invoke it at
> runtime as well?
>
> Any insights or pointers would be greatly appreciated!
>
> Thanks,
> Zacharie Tevaearai
>
>
> --
> --
> 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 visit
> https://groups.google.com/d/msgid/v8-dev/95df57ee-db41-4a44-ae14-946cec5be621n%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-dev/95df57ee-db41-4a44-ae14-946cec5be621n%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 visit 
https://groups.google.com/d/msgid/v8-dev/CAKSzg3RUa5gsA-e9MMSBsg_5OMi4Az%2BnfT2wk2SODzfTURWg%2BQ%40mail.gmail.com.

Reply via email to