@@ -39,11 +39,9 @@ If this happens you can configure your build tool, to just issue warning message
3939
4040### Method Names
4141
42- By default the compiler names each generated method ` func_0 ` , ` func_1 ` , etc. The ` methodPrefixer `
43- parameter takes the fully qualified name of a ` MethodPrefixer ` implementation that supplies a more
44- recognisable prefix instead, which makes thread dumps, profiler output and stack traces identify
45- functions by name. ` NameSectionMethodPrefixer ` uses the function names from the module's name
46- section:
42+ By default the compiler names each generated method ` func_0 ` , ` func_1 ` , etc. Set ` methodPrefixer ` to
43+ name them after the module's name section instead, so that thread dumps, profiler output and stack
44+ traces identify functions by name:
4745
4846``` xml
4947<configuration >
@@ -53,38 +51,12 @@ section:
5351</configuration >
5452```
5553
56- You can name your own implementation instead, for example one that demangles Rust or C++ symbols.
57- It must implement ` run.endive.compiler.MethodPrefixer ` and have a public no-argument constructor.
58- The class is loaded by the plugin, so it has to be a dependency of the plugin declaration rather
59- than of the project:
54+ The names are resolved at build time and baked into the generated classes; the name section itself is
55+ not shipped with them.
6056
61- ``` xml
62- <plugin >
63- <groupId >run.endive</groupId >
64- <artifactId >endive-compiler-maven-plugin</artifactId >
65- <dependencies >
66- <dependency >
67- <groupId >org.acme</groupId >
68- <artifactId >my-demangler</artifactId >
69- <version >1.0.0</version >
70- </dependency >
71- </dependencies >
72- <!-- executions, with <methodPrefixer>org.acme.MyDemanglingPrefixer</methodPrefixer> -->
73- </plugin >
74- ```
75-
76- Names are resolved once, at build time. This is the only opportunity to do so: the meta Wasm module
77- emitted next to the compiled classes has all of its custom sections stripped, so the name section is
78- no longer available when the module is loaded. Resolving names here also costs nothing at runtime.
79-
80- Whatever the prefixer returns, the compiler appends ` _<funcId> ` to produce the method name, so names
81- stay unique and the Wasm function index remains recoverable from any method name. Characters that are
82- illegal in JVM method names (` . ; [ / < > ` ) are replaced with underscores. The prefix is a hint for
83- humans; tools should use the function index instead. See
84- [ Method Names] ( runtime-compiler.md#method-names ) for the full contract.
85-
86- Since the name section is not retained, mapping a function index back to its original name requires
87- the original Wasm module, which is a build input rather than something shipped with the classes.
57+ The parameter accepts any ` run.endive.compiler.MethodPrefixer ` with a public no-argument constructor,
58+ declared as a dependency of the plugin. See [ Method Names] ( runtime-compiler.md#method-names ) for the
59+ naming contract.
8860
8961## Using Maven
9062
@@ -241,9 +213,7 @@ endive:compile
241213 Fully qualified name of a MethodPrefixer implementation used to name the
242214 compiled methods. Defaults to naming them func_0, func_1 and so on. Set
243215 it to run.endive.compiler.NameSectionMethodPrefixer to name them after
244- the module's name section, which makes thread dumps and profiler output
245- readable, or to your own implementation. A custom class must be a
246- dependency of this plugin, not of the project.
216+ the module's name section.
247217
248218 moduleInterface
249219 Fully qualified name of the user's class for which to generate
0 commit comments