* Re: [9fans] JIT (mostly off topic)
2014-09-09 21:45 [9fans] JIT (mostly off topic) Steve Simon
@ 2014-09-09 22:04 ` Aram Hăvărneanu
2014-09-09 22:09 ` Daniel Peyrolon
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Aram Hăvărneanu @ 2014-09-09 22:04 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
You have to mmap an executable region of memory, but it is doable in
almost all cases (certainly for every desktop).
--
Aram Hăvărneanu
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] JIT (mostly off topic)
2014-09-09 21:45 [9fans] JIT (mostly off topic) Steve Simon
2014-09-09 22:04 ` Aram Hăvărneanu
@ 2014-09-09 22:09 ` Daniel Peyrolon
2014-09-09 22:18 ` Skip Tavakkolian
2014-09-10 4:48 ` Bakul Shah
3 siblings, 0 replies; 6+ messages in thread
From: Daniel Peyrolon @ 2014-09-09 22:09 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
[-- Attachment #1: Type: text/plain, Size: 917 bytes --]
Hello Steve,
I'm currently implementing JIT compilation on the FreeBSD firewall on
netmap, using LLVM.
(So yes, there's people doing this, maybe not as you expected it).
Maybe you can use LLVM on that OS, I'm not sure.
As for the DEP thing, Aram got before me, I was about to say that.
2014-09-09 22:45 GMT+01:00 Steve Simon <steve@quintile.net>:
> Years ago The Commander and Bart Locanthi used JIT
> in the form of some C that write machine code into an
> array of chars, cast it to a function pointer, and called it.
> (I appologise if the details are not correct but this is the idea).
>
> I have a need for such a thing again - trying to speed up
> a compressed video decoder.
>
> Anyone done such a thing this millenium? Does the x86 data execution
> prevention mean you just cannot do this - my targets are desktop OSs
> other than plan9 (sadly).
>
> -Steve
>
>
--
Daniel
[-- Attachment #2: Type: text/html, Size: 1390 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] JIT (mostly off topic)
2014-09-09 21:45 [9fans] JIT (mostly off topic) Steve Simon
2014-09-09 22:04 ` Aram Hăvărneanu
2014-09-09 22:09 ` Daniel Peyrolon
@ 2014-09-09 22:18 ` Skip Tavakkolian
2014-09-09 23:53 ` Rob Pike
2014-09-10 4:48 ` Bakul Shah
3 siblings, 1 reply; 6+ messages in thread
From: Skip Tavakkolian @ 2014-09-09 22:18 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
a version of pico (holzmann) for VAX by ken and rob used this
technique. rsc did a version of pico where the repl just "compiles"
pico into C, then compiles and runs it.
On Tue, Sep 9, 2014 at 2:45 PM, Steve Simon <steve@quintile.net> wrote:
> Years ago The Commander and Bart Locanthi used JIT
> in the form of some C that write machine code into an
> array of chars, cast it to a function pointer, and called it.
> (I appologise if the details are not correct but this is the idea).
>
> I have a need for such a thing again - trying to speed up
> a compressed video decoder.
>
> Anyone done such a thing this millenium? Does the x86 data execution
> prevention mean you just cannot do this - my targets are desktop OSs
> other than plan9 (sadly).
>
> -Steve
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [9fans] JIT (mostly off topic)
2014-09-09 21:45 [9fans] JIT (mostly off topic) Steve Simon
` (2 preceding siblings ...)
2014-09-09 22:18 ` Skip Tavakkolian
@ 2014-09-10 4:48 ` Bakul Shah
3 siblings, 0 replies; 6+ messages in thread
From: Bakul Shah @ 2014-09-10 4:48 UTC (permalink / raw)
To: Fans of the OS Plan 9 from Bell Labs
On Tue, 09 Sep 2014 22:45:01 BST "Steve Simon" <steve@quintile.net> wrote:
> Years ago The Commander and Bart Locanthi used JIT
> in the form of some C that write machine code into an
> array of chars, cast it to a function pointer, and called it.
> (I appologise if the details are not correct but this is the idea).
>
> I have a need for such a thing again - trying to speed up
> a compressed video decoder.
>
> Anyone done such a thing this millenium? Does the x86 data execution
> prevention mean you just cannot do this - my targets are desktop OSs
> other than plan9 (sadly).
Have you looked at libjit or luajit? There are a bunch of
projects using JIT on the fly! You may also want to look at
Nils Holm's subc (a 5Kloc compiler for a subset of C +
codegens for 386,arm,x86-64, each in 260..427 lines). For an
example of generating assembly code using C functions.
^ permalink raw reply [flat|nested] 6+ messages in thread