From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5027045b88fe7d178a0926131e4205f1@quintile.net> From: "Steve Simon" Date: Tue, 9 Sep 2014 22:45:01 +0100 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 157a1218-ead9-11e9-9d60-3106f5b1d025 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 From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <5027045b88fe7d178a0926131e4205f1@quintile.net> References: <5027045b88fe7d178a0926131e4205f1@quintile.net> From: =?UTF-8?B?QXJhbSBIxIN2xINybmVhbnU=?= Date: Wed, 10 Sep 2014 00:04:14 +0200 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 157e826c-ead9-11e9-9d60-3106f5b1d025 You have to mmap an executable region of memory, but it is doable in almost all cases (certainly for every desktop). --=20 Aram H=C4=83v=C4=83rneanu From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <5027045b88fe7d178a0926131e4205f1@quintile.net> References: <5027045b88fe7d178a0926131e4205f1@quintile.net> Date: Tue, 9 Sep 2014 23:09:40 +0100 Message-ID: From: Daniel Peyrolon To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e013d15d41f2c7d0502a93188 Subject: Re: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 1582a194-ead9-11e9-9d60-3106f5b1d025 --089e013d15d41f2c7d0502a93188 Content-Type: text/plain; charset=ISO-8859-1 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 : > 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 --089e013d15d41f2c7d0502a93188 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hello Steve,

I'm currently imple= menting JIT compilation on the FreeBSD firewall on netmap, using LLVM.
= (So yes, there's people doing this, maybe not as you expected it).
<= /div>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.<= br>

2014-09-09 22:45 GMT+01:00 Steve Simon <steve@quintile.net>:
Years ago The Commander and Bart Loca= nthi 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
--089e013d15d41f2c7d0502a93188-- From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <5027045b88fe7d178a0926131e4205f1@quintile.net> References: <5027045b88fe7d178a0926131e4205f1@quintile.net> Date: Tue, 9 Sep 2014 15:18:37 -0700 Message-ID: From: Skip Tavakkolian To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 15873c86-ead9-11e9-9d60-3106f5b1d025 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 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <5027045b88fe7d178a0926131e4205f1@quintile.net> From: Rob Pike Date: Tue, 9 Sep 2014 16:53:00 -0700 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 158b50fa-ead9-11e9-9d60-3106f5b1d025 The original Blit JIT (stupid name - if the compilation was "in time" we wouldn't need a JIT. Our term was "on the fly") version was actually done by John Reiser. My favorite JIT I wrote was to fix up floating point after a trap on the SPARC. -rob From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Tue, 09 Sep 2014 22:45:01 BST." <5027045b88fe7d178a0926131e4205f1@quintile.net> References: <5027045b88fe7d178a0926131e4205f1@quintile.net> Date: Tue, 9 Sep 2014 21:48:14 -0700 From: Bakul Shah Message-Id: <20140910044814.78442B827@mail.bitblocks.com> Subject: Re: [9fans] JIT (mostly off topic) Topicbox-Message-UUID: 158f8828-ead9-11e9-9d60-3106f5b1d025 On Tue, 09 Sep 2014 22:45:01 BST "Steve Simon" 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.