Συντάκτης: Zoltán Herczeg Ημερομηνία: Προς: Panicz Maciej Godek, pcre-dev Αντικείμενο: Re: [pcre-dev] JIT compilation of regexps
Hi
>This doesn't answer the question whether the
>pre-compilation would fail on JIT-enabled systems,
>or perhaps it would still speed something up?
I am not sure I understand this question, but you can pre-compile a regex, save its byte code, reload it, and compile with JIT. You cannot save and reload JIT code because several resources are accessed by absolute addresses.
>The other question is whether it is impossible
>to store the JIT data in principle, or perhaps there
>could be an option to store it somehow in some
>of the future releases?
If performance would be sacrificed, you could probably do it. But this is not an easy task, since you would need to generate a position independent code with relative resource accesses.
There would be another solution, but that is complex, and involves mmap magic. You would need an absolute address space, where all regexps, character properties, JIT code, etc. would be stored, and this address space could be saved on the disk. Later you can map this address space on restore its content. The process is similar as the ld tool loads binaries on Linux. You also need to redirect all allocations to use this space.