From b5935c796ab0b2c478b4480a0dfdacb8e0dfe40e Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 19 Dec 2024 18:47:57 +0000 Subject: deploy: 8ca27aeeb99a0da43e92e39918aa07c0b1443c07 --- add/index.html | 2 +- fib/index.html | 2 +- juicebox_asm/struct.Runtime.html | 19 ++--- search-index.js | 4 +- search.desc/juicebox_asm/juicebox_asm-desc-0-.js | 2 +- src/add/add.rs.html | 8 +-- src/fib/fib.rs.html | 8 +-- src/juicebox_asm/rt.rs.html | 90 ++++++++++++++++++++---- 8 files changed, 99 insertions(+), 36 deletions(-) diff --git a/add/index.html b/add/index.html index aad4924..df64156 100644 --- a/add/index.html +++ b/add/index.html @@ -1,4 +1,4 @@ -add - Rust

Crate add

source
Expand description

Add example.

+add - Rust

Crate add

source
Expand description

Add example.

Jit compile a function at runtime (generate native host code) which calls a function defined in the example based on the SystemV abi to demonstrate the juicebox_asm crate.

\ No newline at end of file diff --git a/fib/index.html b/fib/index.html index 72e3d45..3ab0bc5 100644 --- a/fib/index.html +++ b/fib/index.html @@ -1,4 +1,4 @@ -fib - Rust

Crate fib

source
Expand description

Fibonacci example.

+fib - Rust

Crate fib

source
Expand description

Fibonacci example.

Jit compile a function at runtime (generate native host code) to compute the fibonacci sequence to demonstrate the juicebox_asm crate.

\ No newline at end of file diff --git a/juicebox_asm/struct.Runtime.html b/juicebox_asm/struct.Runtime.html index 908c529..5734451 100644 --- a/juicebox_asm/struct.Runtime.html +++ b/juicebox_asm/struct.Runtime.html @@ -1,5 +1,5 @@ -Runtime in juicebox_asm - Rust
juicebox_asm

Struct Runtime

source
pub struct Runtime { /* private fields */ }
Expand description

A simple mmaped runtime with executable pages.

-

Implementations§

source§

impl Runtime

source

pub fn new() -> Runtime

Create a new Runtime.

+Runtime in juicebox_asm - Rust
juicebox_asm

Struct Runtime

source
pub struct Runtime { /* private fields */ }
Expand description

A simple mmaped runtime with executable pages.

+

Implementations§

source§

impl Runtime

source

pub fn new() -> Runtime

Create a new Runtime.

§Panics

Panics if the mmap call fails.

source

pub fn with_profile() -> Runtime

Create a new Runtime which also generates static perf metat data.

@@ -21,13 +21,14 @@ pointer is only valid until the let nop = unsafe { rt.add_code::<extern "C" fn()>(&code) }; nop();
-
source

pub fn dump(&self)

Dump the code added so far to the runtime into a file called jit.asm in the processes -current working directory.

-

The code can be inspected with a disassembler as for example ndiasm from -nasm.us.

-
ndisasm -b 64 jit.asm
§Panics
-

Panics if writing the file failed.

-

Trait Implementations§

source§

impl Drop for Runtime

source§

fn drop(&mut self)

Unmaps the code page. This invalidates all the function pointer returned by +

source

pub fn disasm(&self)

Disassemble the code currently added to the runtime, using +ndisasm and print it to stdout. If +ndisasm is not available on the system this prints a warning and +becomes a nop.

+
§Panics
+

Panics if anything goes wrong with spawning, writing to or reading from +the ndisasm child process.

+

Trait Implementations§

source§

impl Drop for Runtime

source§

fn drop(&mut self)

Unmaps the code page. This invalidates all the function pointer returned by Runtime::add_code.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where diff --git a/search-index.js b/search-index.js index 293232d..62be56b 100644 --- a/search-index.js +++ b/search-index.js @@ -1,4 +1,4 @@ -var searchIndex = new Map(JSON.parse('[["add",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["bf",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["fib",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["juicebox_asm",{"t":"FFFFFFFFFFGGGGFNNNNNNNNNNNPPPPNPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPNPPNNNNNNNNNNNNNNNNNPNNNNNNPPPPNNNPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKKKKKKKKKKKKKKKMMMMMMMMMMMMMMMM","n":["Asm","Imm16","Imm32","Imm64","Imm8","Label","Mem16","Mem32","Mem64","Mem8","Reg16","Reg32","Reg64","Reg8","Runtime","add","","","","","","","","","","add_code","ah","al","ax","bh","bind","bl","borrow","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","bp","bpl","bx","call","ch","cl","clone","","","","clone_into","","","","clone_to_uninit","","","","cmovnz","cmovz","cmp","","","cx","dec","","","","","","dh","di","dil","dl","drop","","dump","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","inc","","","","","","indirect","","","","indirect_base_index","","","","indirect_disp","","","","insn","into","","","","","","","","","","","","","","","into_code","jmp","jnz","jz","mov","","","","","","","","","","","","","","","","","new","","","nop","pop","","push","","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","ret","rsi","rsp","si","sil","sp","spl","sub","","test","","","to_owned","","","","try_from","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","type_id","","","","","","","","","","","","","","","with_profile","xor","Add","Call","Cmovnz","Cmovz","Cmp","Dec","Inc","Jmp","Jnz","Jz","Mov","Pop","Push","Sub","Test","Xor","add","call","cmovnz","cmovz","cmp","dec","inc","jmp","jnz","jz","mov","pop","push","sub","test","xor"],"q":[[0,"juicebox_asm"],[309,"juicebox_asm::insn"],[341,"juicebox_asm::asm"],[342,"juicebox_asm::reg"],[343,"juicebox_asm::mem"],[344,"juicebox_asm::imm"],[345,"juicebox_asm::rt"],[346,"core::convert"],[347,"juicebox_asm::label"],[348,"alloc::vec"],[349,"core::result"],[350,"core::any"]],"i":"```````````````d000000000AlBf0Aj1313Bd3A`AhBnCfnAbAdjhAf;<>:=9876543210;<;<;><<10;<10;<10;<>>>>>;>>>>>><;<<:==;00000000>:=99988888777777766666666666543210;<>>>>>>543254325432`>:=9876543210;<>>>>>>>>>>>>>>>>>>>>>>:=>>>>>10<;10<;10<;10<;10<;10<;10<;10<;111111>11;<;<>>>>>10;<>:=9876543210;<>:=9876543210;<>:=9876543210;<=>````````````````DdDfDhDjDlDnE`EbEdEfEhEjElEnF`Fb","f":"```````````````{{{f{bd}}hj}l}{{{f{bd}}hh}l}{{{f{bd}}nA`}l}{{{f{bd}}AbA`}l}{{{f{bd}}AdA`}l}{{{f{bd}}jA`}l}{{{f{bd}}jh}l}{{{f{bd}}AfAf}l}{{{f{bd}}AbAh}l}{{{f{bd}}AbAj}l}{{{f{bAl}}c}e{{Bb{{B`{An}}}}}{}}````{{{f{bd}}{f{bBd}}}l}`{f{{f{c}}}{}}00000000000000{{{f{b}}}{{f{bc}}}{}}00000000000000```{{{f{bd}}h}l}``{{{f{h}}}h}{{{f{Af}}}Af}{{{f{Aj}}}Aj}{{{f{Bf}}}Bf}{{f{f{bc}}}l{}}000{fl}000{{{f{bd}}hh}l}00={{{f{bd}}nA`}l}`{{{f{bd}}Af}l}{{{f{bd}}j}l}:{{{f{bd}}Ad}l}{{{f{bd}}n}l}{{{f{bd}}Ab}l}````{{{f{bBd}}}l}{{{f{bAl}}}l}{{{f{Al}}}l}`````````{cc{}}000{AnA`}{BhA`}{BjAh}3{AnAh}{BlAh}{BhAh}{AnBn}{BjBn}8{C`Bn}{CbBn}{BlBn}{BhBn}<{CdCf}{ChCf}{C`Cf}{CbCf}{BlCf}{BjCf}{AnCf}{BhCf}{CjCf}{ClCf}{cc{}}0000000{{{f{bd}}Af}l}{{{f{bd}}n}l}{{{f{bd}}Ab}l}{{{f{bd}}Ad}l}{{{f{bd}}j}l}{{{f{bd}}h}l}{hn}{hAb}{hAd}{hj}{{hh}n}{{hh}Ab}{{hh}Ad}{{hh}j}{{hCb}n}{{hCb}Ab}{{hCb}Ad}{{hCb}j}`{{}c{}}00000000000000{d{{Cn{An}}}}{{{f{bd}}{f{bBd}}}l}00{{{f{bd}}nBf}l}{{{f{bd}}AjAh}l}{{{f{bd}}AbAh}l}{{{f{bd}}AbAj}l}{{{f{bd}}AdAf}l}{{{f{bd}}jh}l}{{{f{bd}}BfBf}l}{{{f{bd}}AjAj}l}{{{f{bd}}AfAf}l}{{{f{bd}}BfA`}l}{{{f{bd}}hj}l}{{{f{bd}}AfAd}l}{{{f{bd}}AjAb}l}{{{f{bd}}Bfn}l}{{{f{bd}}hCf}l}{{{f{bd}}AfBn}l}{{{f{bd}}hh}l}{{}d}{{}Bd}{{}Al}{{{f{bd}}}l}{{{f{bd}}h}l}{{{f{bd}}Aj}l}10``````````````````````````````````````2``````6{{{f{bd}}nA`}l}?7{{{f{bd}}AbAh}l}{fc{}}000{c{{D`{e}}}{}{}}00000000000000{{}{{D`{c}}}{}}00000000000000{fDb}000000000000009<````````````````{{{f{bDd}}ce}l{}{}}{{{f{bDf}}c}l{}}{{{f{bDh}}ce}l{}{}}{{{f{bDj}}ce}l{}{}}{{{f{bDl}}ce}l{}{}}{{{f{bDn}}c}l{}}{{{f{bE`}}c}l{}}{{{f{bEb}}c}l{}}{{{f{bEd}}c}l{}}{{{f{bEf}}c}l{}}{{{f{bEh}}ce}l{}{}}{{{f{bEj}}c}l{}}{{{f{bEl}}c}l{}}{{{f{bEn}}ce}l{}{}}{{{f{bF`}}ce}l{}{}}{{{f{bFb}}ce}l{}{}}","D":"Ll","p":[[0,"mut"],[5,"Asm",0,341],[1,"reference"],[6,"Reg64",0,342],[5,"Mem64",0,343],[1,"unit"],[5,"Mem8",0,343],[5,"Imm8",0,344],[5,"Mem16",0,343],[5,"Mem32",0,343],[6,"Reg32",0,342],[5,"Imm16",0,344],[6,"Reg16",0,342],[5,"Runtime",0,345],[1,"u8"],[1,"slice"],[10,"AsRef",346],[5,"Label",0,347],[6,"Reg8",0,342],[1,"i8"],[1,"i16"],[1,"u16"],[5,"Imm32",0,344],[1,"u32"],[1,"i32"],[1,"u64"],[5,"Imm64",0,344],[1,"i64"],[1,"usize"],[1,"isize"],[5,"Vec",348],[6,"Result",349],[5,"TypeId",350],[10,"Add",309],[10,"Call",309],[10,"Cmovnz",309],[10,"Cmovz",309],[10,"Cmp",309],[10,"Dec",309],[10,"Inc",309],[10,"Jmp",309],[10,"Jnz",309],[10,"Jz",309],[10,"Mov",309],[10,"Pop",309],[10,"Push",309],[10,"Sub",309],[10,"Test",309],[10,"Xor",309]],"r":[[0,341],[1,344],[2,344],[3,344],[4,344],[5,347],[6,343],[7,343],[8,343],[9,343],[10,342],[11,342],[12,342],[13,342],[14,345]],"b":[[15,"impl-Add%3CReg64,+Mem64%3E-for-Asm"],[16,"impl-Add%3CReg64,+Reg64%3E-for-Asm"],[17,"impl-Add%3CMem8,+Imm8%3E-for-Asm"],[18,"impl-Add%3CMem16,+Imm8%3E-for-Asm"],[19,"impl-Add%3CMem32,+Imm8%3E-for-Asm"],[20,"impl-Add%3CMem64,+Imm8%3E-for-Asm"],[21,"impl-Add%3CMem64,+Reg64%3E-for-Asm"],[22,"impl-Add%3CReg32,+Reg32%3E-for-Asm"],[23,"impl-Add%3CMem16,+Imm16%3E-for-Asm"],[24,"impl-Add%3CMem16,+Reg16%3E-for-Asm"],[82,"impl-Cmp%3CReg64,+Reg64%3E-for-Asm"],[83,"impl-Cmp%3CMem16,+Imm16%3E-for-Asm"],[84,"impl-Cmp%3CMem8,+Imm8%3E-for-Asm"],[86,"impl-Dec%3CReg32%3E-for-Asm"],[87,"impl-Dec%3CMem64%3E-for-Asm"],[88,"impl-Dec%3CReg64%3E-for-Asm"],[89,"impl-Dec%3CMem32%3E-for-Asm"],[90,"impl-Dec%3CMem8%3E-for-Asm"],[91,"impl-Dec%3CMem16%3E-for-Asm"],[112,"impl-From%3Cu8%3E-for-Imm8"],[113,"impl-From%3Ci8%3E-for-Imm8"],[114,"impl-From%3Ci16%3E-for-Imm16"],[116,"impl-From%3Cu8%3E-for-Imm16"],[117,"impl-From%3Cu16%3E-for-Imm16"],[118,"impl-From%3Ci8%3E-for-Imm16"],[119,"impl-From%3Cu8%3E-for-Imm32"],[120,"impl-From%3Ci16%3E-for-Imm32"],[122,"impl-From%3Cu32%3E-for-Imm32"],[123,"impl-From%3Ci32%3E-for-Imm32"],[124,"impl-From%3Cu16%3E-for-Imm32"],[125,"impl-From%3Ci8%3E-for-Imm32"],[127,"impl-From%3Cu64%3E-for-Imm64"],[128,"impl-From%3Ci64%3E-for-Imm64"],[129,"impl-From%3Cu32%3E-for-Imm64"],[130,"impl-From%3Ci32%3E-for-Imm64"],[131,"impl-From%3Cu16%3E-for-Imm64"],[132,"impl-From%3Ci16%3E-for-Imm64"],[133,"impl-From%3Cu8%3E-for-Imm64"],[134,"impl-From%3Ci8%3E-for-Imm64"],[135,"impl-From%3Cusize%3E-for-Imm64"],[136,"impl-From%3Cisize%3E-for-Imm64"],[145,"impl-Inc%3CReg32%3E-for-Asm"],[146,"impl-Inc%3CMem8%3E-for-Asm"],[147,"impl-Inc%3CMem16%3E-for-Asm"],[148,"impl-Inc%3CMem32%3E-for-Asm"],[149,"impl-Inc%3CMem64%3E-for-Asm"],[150,"impl-Inc%3CReg64%3E-for-Asm"],[183,"impl-Mov%3CMem8,+Reg8%3E-for-Asm"],[184,"impl-Mov%3CReg16,+Imm16%3E-for-Asm"],[185,"impl-Mov%3CMem16,+Imm16%3E-for-Asm"],[186,"impl-Mov%3CMem16,+Reg16%3E-for-Asm"],[187,"impl-Mov%3CMem32,+Reg32%3E-for-Asm"],[188,"impl-Mov%3CMem64,+Reg64%3E-for-Asm"],[189,"impl-Mov%3CReg8,+Reg8%3E-for-Asm"],[190,"impl-Mov%3CReg16,+Reg16%3E-for-Asm"],[191,"impl-Mov%3CReg32,+Reg32%3E-for-Asm"],[192,"impl-Mov%3CReg8,+Imm8%3E-for-Asm"],[193,"impl-Mov%3CReg64,+Mem64%3E-for-Asm"],[194,"impl-Mov%3CReg32,+Mem32%3E-for-Asm"],[195,"impl-Mov%3CReg16,+Mem16%3E-for-Asm"],[196,"impl-Mov%3CReg8,+Mem8%3E-for-Asm"],[197,"impl-Mov%3CReg64,+Imm64%3E-for-Asm"],[198,"impl-Mov%3CReg32,+Imm32%3E-for-Asm"],[199,"impl-Mov%3CReg64,+Reg64%3E-for-Asm"],[204,"impl-Pop%3CReg64%3E-for-Asm"],[205,"impl-Pop%3CReg16%3E-for-Asm"],[206,"impl-Push%3CReg64%3E-for-Asm"],[207,"impl-Push%3CReg16%3E-for-Asm"],[253,"impl-Sub%3CReg64,+Reg64%3E-for-Asm"],[254,"impl-Sub%3CMem8,+Imm8%3E-for-Asm"],[255,"impl-Test%3CReg32,+Reg32%3E-for-Asm"],[256,"impl-Test%3CReg64,+Reg64%3E-for-Asm"],[257,"impl-Test%3CMem16,+Imm16%3E-for-Asm"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAO8ADQAQAAkAGwADACAAQQBkAAgAcQACAHUABAB7AAMAgAAJAJIABQC1ABMAzQApAPgAOwA1AQAA"}],["tiny_vm",{"t":"PPPPPPPFPPPFPGGFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHHHNNNNNNNNNNNNNNNNNNNNNNN","n":["A","Add","Addi","B","Branch","BranchZero","C","Fixup","Halt","Load","LoadImm","PhysAddr","Store","TinyInsn","TinyReg","TinyVm","bind","borrow","","","","","borrow_mut","","","","","clone","","clone_into","","clone_to_uninit","","dump","eq","","fmt","","from","","","","","interp","into","","","","","","jit","make_tinyvm_fib","make_tinyvm_jit_perf","make_tinyvm_jit_test","new","","read_mem","read_reg","to_owned","","try_from","","","","","try_into","","","","","type_id","","","","","write_mem","write_reg"],"q":[[0,"tiny_vm"],[77,"alloc::vec"],[78,"core::fmt"],[79,"core::result"],[80,"core::any"]],"i":"nf01001`000`0```bAhA`24310243434343043431024301102430```02004310243102431024300","f":"````````````````{{b{j{d{h{f}}}}}l}{j{{j{c}}}{}}0000{{{j{d}}}{{j{dc}}}{}}0000{{{j{n}}}n}{{{j{f}}}f}{{j{j{dc}}}l{}}0{jl}0{{{j{A`}}}l}{{{j{n}}{j{n}}}Ab}{{{j{f}}{j{f}}}Ab}{{{j{n}}{j{dAd}}}Af}{{{j{f}}{j{dAd}}}Af}{cc{}}0000{{{j{dA`}}}l}{AhAj}{{}c{}}00002{Al{{h{f}}}}{{}{{h{f}}}}0{{{h{f}}}A`}{Ajb}{{{j{A`}}Ah}Al}{{{j{A`}}n}Al}{jc{}}0{c{{An{e}}}{}{}}0000{{}{{An{c}}}{}}0000{jB`}0000{{{j{dA`}}AhAl}l}{{{j{dA`}}nAl}l}","D":"Dj","p":[[5,"Fixup",0],[0,"mut"],[6,"TinyInsn",0],[5,"Vec",77],[1,"reference"],[1,"unit"],[6,"TinyReg",0],[5,"TinyVm",0],[1,"bool"],[5,"Formatter",78],[8,"Result",78],[5,"PhysAddr",0],[1,"usize"],[1,"u16"],[6,"Result",79],[5,"TypeId",80]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAACgABwABAAAABAAAAAcAAAASAA8AIwADAC0AAAA7ABAA"}]]')); +var searchIndex = new Map(JSON.parse('[["add",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["bf",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["fib",{"t":"","n":[],"q":[],"i":"","f":"","D":"b","p":[],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OjAAAAAAAAA="}],["juicebox_asm",{"t":"FFFFFFFFFFGGGGFNNNNNNNNNNNPPPPNPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPNPPNNNNNNNNNNNNNNNNNPNNNNNNPPPNPNNPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNKKKKKKKKKKKKKKKKMMMMMMMMMMMMMMMM","n":["Asm","Imm16","Imm32","Imm64","Imm8","Label","Mem16","Mem32","Mem64","Mem8","Reg16","Reg32","Reg64","Reg8","Runtime","add","","","","","","","","","","add_code","ah","al","ax","bh","bind","bl","borrow","","","","","","","","","","","","","","","borrow_mut","","","","","","","","","","","","","","","bp","bpl","bx","call","ch","cl","clone","","","","clone_into","","","","clone_to_uninit","","","","cmovnz","cmovz","cmp","","","cx","dec","","","","","","dh","di","dil","disasm","dl","drop","","dx","eax","ebp","ebx","ecx","edi","edx","esi","esp","from","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","inc","","","","","","indirect","","","","indirect_base_index","","","","indirect_disp","","","","insn","into","","","","","","","","","","","","","","","into_code","jmp","jnz","jz","mov","","","","","","","","","","","","","","","","","new","","","nop","pop","","push","","r10","r10d","r10l","r10w","r11","r11d","r11l","r11w","r12","r12d","r12l","r12w","r13","r13d","r13l","r13w","r14","r14d","r14l","r14w","r15","r15d","r15l","r15w","r8","r8d","r8l","r8w","r9","r9d","r9l","r9w","rax","rbp","rbx","rcx","rdi","rdx","ret","rsi","rsp","si","sil","sp","spl","sub","","test","","","to_owned","","","","try_from","","","","","","","","","","","","","","","try_into","","","","","","","","","","","","","","","type_id","","","","","","","","","","","","","","","with_profile","xor","Add","Call","Cmovnz","Cmovz","Cmp","Dec","Inc","Jmp","Jnz","Jz","Mov","Pop","Push","Sub","Test","Xor","add","call","cmovnz","cmovz","cmp","dec","inc","jmp","jnz","jz","mov","pop","push","sub","test","xor"],"q":[[0,"juicebox_asm"],[309,"juicebox_asm::insn"],[341,"juicebox_asm::asm"],[342,"juicebox_asm::reg"],[343,"juicebox_asm::mem"],[344,"juicebox_asm::imm"],[345,"juicebox_asm::rt"],[346,"core::convert"],[347,"juicebox_asm::label"],[348,"alloc::vec"],[349,"core::result"],[350,"core::any"]],"i":"```````````````d000000000AlBf0Aj1313Bd3A`AhBnCfnAbAdjhAf;<>:=9876543210;<;<;><<10;<10;<10;<>>>>>;>>>>>><;<=<:=;00000000>:=99988888777777766666666666543210;<>>>>>>543254325432`>:=9876543210;<>>>>>>>>>>>>>>>>>>>>>>:=>>>>>10<;10<;10<;10<;10<;10<;10<;10<;111111>11;<;<>>>>>10;<>:=9876543210;<>:=9876543210;<>:=9876543210;<=>````````````````DdDfDhDjDlDnE`EbEdEfEhEjElEnF`Fb","f":"```````````````{{{f{bd}}hj}l}{{{f{bd}}hh}l}{{{f{bd}}nA`}l}{{{f{bd}}AbA`}l}{{{f{bd}}AdA`}l}{{{f{bd}}jA`}l}{{{f{bd}}jh}l}{{{f{bd}}AfAf}l}{{{f{bd}}AbAh}l}{{{f{bd}}AbAj}l}{{{f{bAl}}c}e{{Bb{{B`{An}}}}}{}}````{{{f{bd}}{f{bBd}}}l}`{f{{f{c}}}{}}00000000000000{{{f{b}}}{{f{bc}}}{}}00000000000000```{{{f{bd}}h}l}``{{{f{h}}}h}{{{f{Af}}}Af}{{{f{Aj}}}Aj}{{{f{Bf}}}Bf}{{f{f{bc}}}l{}}000{fl}000{{{f{bd}}hh}l}00{{{f{bd}}nA`}l}>`{{{f{bd}}Ab}l}{{{f{bd}}Ad}l}{{{f{bd}}j}l};{{{f{bd}}Af}l}{{{f{bd}}n}l}```{{{f{Al}}}l}`{{{f{bBd}}}l}{{{f{bAl}}}l}`````````{cc{}}00{AnA`}{BhA`}2{BhAh}{BjAh}4{BlAh}{AnAh}{AnBn}{BlBn}8{C`Bn}{CbBn}{BjBn}{BhBn}<{CdCf}{ChCf}{C`Cf}{CbCf}{BjCf}{BlCf}{AnCf}{BhCf}{CjCf}{ClCf}{cc{}}0000000{{{f{bd}}Af}l}{{{f{bd}}n}l}{{{f{bd}}Ab}l}{{{f{bd}}Ad}l}{{{f{bd}}j}l}{{{f{bd}}h}l}{hn}{hAb}{hAd}{hj}{{hh}n}{{hh}Ab}{{hh}Ad}{{hh}j}{{hCb}n}{{hCb}Ab}{{hCb}Ad}{{hCb}j}`{{}c{}}00000000000000{d{{Cn{An}}}}{{{f{bd}}{f{bBd}}}l}00{{{f{bd}}nBf}l}{{{f{bd}}AjAh}l}{{{f{bd}}AbAh}l}{{{f{bd}}AbAj}l}{{{f{bd}}AdAf}l}{{{f{bd}}jh}l}{{{f{bd}}BfBf}l}{{{f{bd}}AjAj}l}{{{f{bd}}AfAf}l}{{{f{bd}}BfA`}l}{{{f{bd}}hj}l}{{{f{bd}}AfAd}l}{{{f{bd}}AjAb}l}{{{f{bd}}Bfn}l}{{{f{bd}}hCf}l}{{{f{bd}}AfBn}l}{{{f{bd}}hh}l}{{}d}{{}Bd}{{}Al}{{{f{bd}}}l}{{{f{bd}}h}l}{{{f{bd}}Aj}l}10``````````````````````````````````````2``````6{{{f{bd}}nA`}l}?7{{{f{bd}}AbAh}l}{fc{}}000{c{{D`{e}}}{}{}}00000000000000{{}{{D`{c}}}{}}00000000000000{fDb}000000000000009<````````````````{{{f{bDd}}ce}l{}{}}{{{f{bDf}}c}l{}}{{{f{bDh}}ce}l{}{}}{{{f{bDj}}ce}l{}{}}{{{f{bDl}}ce}l{}{}}{{{f{bDn}}c}l{}}{{{f{bE`}}c}l{}}{{{f{bEb}}c}l{}}{{{f{bEd}}c}l{}}{{{f{bEf}}c}l{}}{{{f{bEh}}ce}l{}{}}{{{f{bEj}}c}l{}}{{{f{bEl}}c}l{}}{{{f{bEn}}ce}l{}{}}{{{f{bF`}}ce}l{}{}}{{{f{bFb}}ce}l{}{}}","D":"Ll","p":[[0,"mut"],[5,"Asm",0,341],[1,"reference"],[6,"Reg64",0,342],[5,"Mem64",0,343],[1,"unit"],[5,"Mem8",0,343],[5,"Imm8",0,344],[5,"Mem16",0,343],[5,"Mem32",0,343],[6,"Reg32",0,342],[5,"Imm16",0,344],[6,"Reg16",0,342],[5,"Runtime",0,345],[1,"u8"],[1,"slice"],[10,"AsRef",346],[5,"Label",0,347],[6,"Reg8",0,342],[1,"i8"],[1,"u16"],[1,"i16"],[5,"Imm32",0,344],[1,"u32"],[1,"i32"],[1,"u64"],[5,"Imm64",0,344],[1,"i64"],[1,"usize"],[1,"isize"],[5,"Vec",348],[6,"Result",349],[5,"TypeId",350],[10,"Add",309],[10,"Call",309],[10,"Cmovnz",309],[10,"Cmovz",309],[10,"Cmp",309],[10,"Dec",309],[10,"Inc",309],[10,"Jmp",309],[10,"Jnz",309],[10,"Jz",309],[10,"Mov",309],[10,"Pop",309],[10,"Push",309],[10,"Sub",309],[10,"Test",309],[10,"Xor",309]],"r":[[0,341],[1,344],[2,344],[3,344],[4,344],[5,347],[6,343],[7,343],[8,343],[9,343],[10,342],[11,342],[12,342],[13,342],[14,345]],"b":[[15,"impl-Add%3CReg64,+Mem64%3E-for-Asm"],[16,"impl-Add%3CReg64,+Reg64%3E-for-Asm"],[17,"impl-Add%3CMem8,+Imm8%3E-for-Asm"],[18,"impl-Add%3CMem16,+Imm8%3E-for-Asm"],[19,"impl-Add%3CMem32,+Imm8%3E-for-Asm"],[20,"impl-Add%3CMem64,+Imm8%3E-for-Asm"],[21,"impl-Add%3CMem64,+Reg64%3E-for-Asm"],[22,"impl-Add%3CReg32,+Reg32%3E-for-Asm"],[23,"impl-Add%3CMem16,+Imm16%3E-for-Asm"],[24,"impl-Add%3CMem16,+Reg16%3E-for-Asm"],[82,"impl-Cmp%3CReg64,+Reg64%3E-for-Asm"],[83,"impl-Cmp%3CMem8,+Imm8%3E-for-Asm"],[84,"impl-Cmp%3CMem16,+Imm16%3E-for-Asm"],[86,"impl-Dec%3CMem16%3E-for-Asm"],[87,"impl-Dec%3CMem32%3E-for-Asm"],[88,"impl-Dec%3CMem64%3E-for-Asm"],[89,"impl-Dec%3CReg64%3E-for-Asm"],[90,"impl-Dec%3CReg32%3E-for-Asm"],[91,"impl-Dec%3CMem8%3E-for-Asm"],[111,"impl-From%3Cu8%3E-for-Imm8"],[112,"impl-From%3Ci8%3E-for-Imm8"],[114,"impl-From%3Ci8%3E-for-Imm16"],[115,"impl-From%3Cu16%3E-for-Imm16"],[117,"impl-From%3Ci16%3E-for-Imm16"],[118,"impl-From%3Cu8%3E-for-Imm16"],[119,"impl-From%3Cu8%3E-for-Imm32"],[120,"impl-From%3Ci16%3E-for-Imm32"],[122,"impl-From%3Cu32%3E-for-Imm32"],[123,"impl-From%3Ci32%3E-for-Imm32"],[124,"impl-From%3Cu16%3E-for-Imm32"],[125,"impl-From%3Ci8%3E-for-Imm32"],[127,"impl-From%3Cu64%3E-for-Imm64"],[128,"impl-From%3Ci64%3E-for-Imm64"],[129,"impl-From%3Cu32%3E-for-Imm64"],[130,"impl-From%3Ci32%3E-for-Imm64"],[131,"impl-From%3Cu16%3E-for-Imm64"],[132,"impl-From%3Ci16%3E-for-Imm64"],[133,"impl-From%3Cu8%3E-for-Imm64"],[134,"impl-From%3Ci8%3E-for-Imm64"],[135,"impl-From%3Cusize%3E-for-Imm64"],[136,"impl-From%3Cisize%3E-for-Imm64"],[145,"impl-Inc%3CReg32%3E-for-Asm"],[146,"impl-Inc%3CMem8%3E-for-Asm"],[147,"impl-Inc%3CMem16%3E-for-Asm"],[148,"impl-Inc%3CMem32%3E-for-Asm"],[149,"impl-Inc%3CMem64%3E-for-Asm"],[150,"impl-Inc%3CReg64%3E-for-Asm"],[183,"impl-Mov%3CMem8,+Reg8%3E-for-Asm"],[184,"impl-Mov%3CReg16,+Imm16%3E-for-Asm"],[185,"impl-Mov%3CMem16,+Imm16%3E-for-Asm"],[186,"impl-Mov%3CMem16,+Reg16%3E-for-Asm"],[187,"impl-Mov%3CMem32,+Reg32%3E-for-Asm"],[188,"impl-Mov%3CMem64,+Reg64%3E-for-Asm"],[189,"impl-Mov%3CReg8,+Reg8%3E-for-Asm"],[190,"impl-Mov%3CReg16,+Reg16%3E-for-Asm"],[191,"impl-Mov%3CReg32,+Reg32%3E-for-Asm"],[192,"impl-Mov%3CReg8,+Imm8%3E-for-Asm"],[193,"impl-Mov%3CReg64,+Mem64%3E-for-Asm"],[194,"impl-Mov%3CReg32,+Mem32%3E-for-Asm"],[195,"impl-Mov%3CReg16,+Mem16%3E-for-Asm"],[196,"impl-Mov%3CReg8,+Mem8%3E-for-Asm"],[197,"impl-Mov%3CReg64,+Imm64%3E-for-Asm"],[198,"impl-Mov%3CReg32,+Imm32%3E-for-Asm"],[199,"impl-Mov%3CReg64,+Reg64%3E-for-Asm"],[204,"impl-Pop%3CReg64%3E-for-Asm"],[205,"impl-Pop%3CReg16%3E-for-Asm"],[206,"impl-Push%3CReg64%3E-for-Asm"],[207,"impl-Push%3CReg16%3E-for-Asm"],[253,"impl-Sub%3CReg64,+Reg64%3E-for-Asm"],[254,"impl-Sub%3CMem8,+Imm8%3E-for-Asm"],[255,"impl-Test%3CReg32,+Reg32%3E-for-Asm"],[256,"impl-Test%3CReg64,+Reg64%3E-for-Asm"],[257,"impl-Test%3CMem16,+Imm16%3E-for-Asm"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAO8ADwAQAAkAGwADACAAPwBhAAEAZAAIAHAAAQBzAAEAdgADAHsAAwCAAAkAkgAFALUAEwDNACkA+AA7ADUBAAA="}],["tiny_vm",{"t":"PPPPPPPFPPPFPGGFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNHHHNNNNNNNNNNNNNNNNNNNNNNN","n":["A","Add","Addi","B","Branch","BranchZero","C","Fixup","Halt","Load","LoadImm","PhysAddr","Store","TinyInsn","TinyReg","TinyVm","bind","borrow","","","","","borrow_mut","","","","","clone","","clone_into","","clone_to_uninit","","dump","eq","","fmt","","from","","","","","interp","into","","","","","","jit","make_tinyvm_fib","make_tinyvm_jit_perf","make_tinyvm_jit_test","new","","read_mem","read_reg","to_owned","","try_from","","","","","try_into","","","","","type_id","","","","","write_mem","write_reg"],"q":[[0,"tiny_vm"],[77,"alloc::vec"],[78,"core::fmt"],[79,"core::result"],[80,"core::any"]],"i":"nf01001`000`0```bAhA`24310243434343043431024301102430```02004310243102431024300","f":"````````````````{{b{j{d{h{f}}}}}l}{j{{j{c}}}{}}0000{{{j{d}}}{{j{dc}}}{}}0000{{{j{n}}}n}{{{j{f}}}f}{{j{j{dc}}}l{}}0{jl}0{{{j{A`}}}l}{{{j{n}}{j{n}}}Ab}{{{j{f}}{j{f}}}Ab}{{{j{n}}{j{dAd}}}Af}{{{j{f}}{j{dAd}}}Af}{cc{}}0000{{{j{dA`}}}l}{AhAj}{{}c{}}00002{Al{{h{f}}}}{{}{{h{f}}}}0{{{h{f}}}A`}{Ajb}{{{j{A`}}Ah}Al}{{{j{A`}}n}Al}{jc{}}0{c{{An{e}}}{}{}}0000{{}{{An{c}}}{}}0000{jB`}0000{{{j{dA`}}AhAl}l}{{{j{dA`}}nAl}l}","D":"Dj","p":[[5,"Fixup",0],[0,"mut"],[6,"TinyInsn",0],[5,"Vec",77],[1,"reference"],[1,"unit"],[6,"TinyReg",0],[5,"TinyVm",0],[1,"bool"],[5,"Formatter",78],[8,"Result",78],[5,"PhysAddr",0],[1,"usize"],[1,"u16"],[6,"Result",79],[5,"TypeId",80]],"r":[],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAACgABwABAAAABAAAAAcAAAASAA8AIwADAC0AAAA7ABAA"}]]')); if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; else if (window.initSearch) window.initSearch(searchIndex); -//{"start":39,"fragment_lengths":[111,111,112,8229,1542]} \ No newline at end of file +//{"start":39,"fragment_lengths":[111,111,112,8243,1542]} \ No newline at end of file diff --git a/search.desc/juicebox_asm/juicebox_asm-desc-0-.js b/search.desc/juicebox_asm/juicebox_asm-desc-0-.js index e413321..9b94cf9 100644 --- a/search.desc/juicebox_asm/juicebox_asm-desc-0-.js +++ b/search.desc/juicebox_asm/juicebox_asm-desc-0-.js @@ -1 +1 @@ -searchState.loadedDescShard("juicebox_asm", 0, "A simple x64 jit assembler with a minimal runtime to …\nx64 jit assembler.\nType representing a 16 bit immediate.\nType representing a 32 bit immediate.\nType representing a 64 bit immediate.\nType representing an 8 bit immediate.\nA label which is used as target for jump instructions.\nA memory operand with word size (16 bit).\nA memory operand with dword size (32 bit).\nA memory operand with qword size (64 bit).\nA memory operand with byte size (8 bit).\nDefinition of 16 bit registers.\nDefinition of 32 bit registers.\nDefinition of 64 bit registers.\nDefinition of 8 bit registers.\nA simple mmaped runtime with executable pages.\nAdd the block of code to the runtime and a get function …\nBind the Label to the current location.\nUnmaps the code page. This invalidates all the function …\nDump the code added so far to the runtime into a file …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nTrait definitions of various instructions.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nConsume the assembler and get the emitted code.\nCreate a new x64 jit assembler.\nCreate a new unbound Label.\nCreate a new Runtime.\nEmit a nop instruction.\nEmit a ret instruction.\nCreate a new Runtime which also generates static perf …\nTrait for add instruction kinds.\nTrait for call instruction kinds.\nTrait for cmovnz instruction kinds.\nTrait for cmovz instruction kinds.\nTrait for cmp instruction kinds.\nTrait for dec instruction kinds.\nTrait for inc instruction kinds.\nTrait for jmp instruction kinds.\nTrait for jnz instruction kinds.\nTrait for jz instruction kinds.\nTrait for mov instruction kinds.\nTrait for pop instruction kinds.\nTrait for push instruction kinds.\nTrait for sub instruction kinds.\nTrait for test instruction kinds.\nTrait for xor instruction kinds.\nEmit an add instruction.\nEmit a call instruction.\nEmit a (conditional) move if not zero instruction.\nEmit a (conditional) move if zero instruction.\nEmit a compare instruction.\nEmit a decrement instruction.\nEmit a increment instruction.\nEmit an unconditional jump instruction.\nEmit a conditional jump if not zero instruction (ZF = 0).\nEmit a conditional jump if zero instruction (ZF = 1).\nEmit an move instruction.\nEmit a pop instruction.\nEmit a push instruction.\nEmit an sub instruction.\nEmit a logical compare instruction.\nEmit a xor instruction.") \ No newline at end of file +searchState.loadedDescShard("juicebox_asm", 0, "A simple x64 jit assembler with a minimal runtime to …\nx64 jit assembler.\nType representing a 16 bit immediate.\nType representing a 32 bit immediate.\nType representing a 64 bit immediate.\nType representing an 8 bit immediate.\nA label which is used as target for jump instructions.\nA memory operand with word size (16 bit).\nA memory operand with dword size (32 bit).\nA memory operand with qword size (64 bit).\nA memory operand with byte size (8 bit).\nDefinition of 16 bit registers.\nDefinition of 32 bit registers.\nDefinition of 64 bit registers.\nDefinition of 8 bit registers.\nA simple mmaped runtime with executable pages.\nAdd the block of code to the runtime and a get function …\nBind the Label to the current location.\nDisassemble the code currently added to the runtime, using …\nUnmaps the code page. This invalidates all the function …\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with indirect addressing mode. For …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with base + index addressing mode. …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nCreate a memory operand with indirect + displacement …\nTrait definitions of various instructions.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nConsume the assembler and get the emitted code.\nCreate a new x64 jit assembler.\nCreate a new unbound Label.\nCreate a new Runtime.\nEmit a nop instruction.\nEmit a ret instruction.\nCreate a new Runtime which also generates static perf …\nTrait for add instruction kinds.\nTrait for call instruction kinds.\nTrait for cmovnz instruction kinds.\nTrait for cmovz instruction kinds.\nTrait for cmp instruction kinds.\nTrait for dec instruction kinds.\nTrait for inc instruction kinds.\nTrait for jmp instruction kinds.\nTrait for jnz instruction kinds.\nTrait for jz instruction kinds.\nTrait for mov instruction kinds.\nTrait for pop instruction kinds.\nTrait for push instruction kinds.\nTrait for sub instruction kinds.\nTrait for test instruction kinds.\nTrait for xor instruction kinds.\nEmit an add instruction.\nEmit a call instruction.\nEmit a (conditional) move if not zero instruction.\nEmit a (conditional) move if zero instruction.\nEmit a compare instruction.\nEmit a decrement instruction.\nEmit a increment instruction.\nEmit an unconditional jump instruction.\nEmit a conditional jump if not zero instruction (ZF = 0).\nEmit a conditional jump if zero instruction (ZF = 1).\nEmit an move instruction.\nEmit a pop instruction.\nEmit a push instruction.\nEmit an sub instruction.\nEmit a logical compare instruction.\nEmit a xor instruction.") \ No newline at end of file diff --git a/src/add/add.rs.html b/src/add/add.rs.html index 580daa0..ba76c7d 100644 --- a/src/add/add.rs.html +++ b/src/add/add.rs.html @@ -36,8 +36,7 @@ 35 36 37 -38 -39
//! Add example.
+38

//! Add example.
 //!
 //! Jit compile a function at runtime (generate native host code) which calls a function defined in
 //! the example based on the SystemV abi to demonstrate the [`juicebox_asm`] crate.
@@ -69,9 +68,8 @@
     let mut rt = Runtime::new();
     let add42 = unsafe { rt.add_code::<extern "C" fn(u32) -> u32>(asm.into_code()) };
 
-    // Write out JIT code for visualization.
-    // Disassemble for example with `ndisasm -b 64 jit.asm`.
-    rt.dump();
+    // Disassemble JIT code and write to stdout.
+    rt.disasm();
 
     let res = add42(5);
     assert_eq!(res, 47);
diff --git a/src/fib/fib.rs.html b/src/fib/fib.rs.html
index c1a746f..99da282 100644
--- a/src/fib/fib.rs.html
+++ b/src/fib/fib.rs.html
@@ -75,8 +75,7 @@
 74
 75
 76
-77
-78
//! Fibonacci example.
+77
//! Fibonacci example.
 //!
 //! Jit compile a function at runtime (generate native host code) to compute the fibonacci sequence
 //! to demonstrate the [`juicebox_asm`] crate.
@@ -144,9 +143,8 @@
     let mut rt = Runtime::new();
     let fib = unsafe { rt.add_code::<extern "C" fn(u64) -> u64>(asm.into_code()) };
 
-    // Write out JIT code for visualization.
-    // Disassemble for example with `ndisasm -b 64 jit.asm`.
-    rt.dump();
+    // Disassemble JIT code and write to stdout.
+    rt.disasm();
 
     for n in 0..15 {
         let fib_jit = fib(n);
diff --git a/src/juicebox_asm/rt.rs.html b/src/juicebox_asm/rt.rs.html
index b0fad10..d138a8e 100644
--- a/src/juicebox_asm/rt.rs.html
+++ b/src/juicebox_asm/rt.rs.html
@@ -266,7 +266,40 @@
 265
 266
 267
-268
//! Simple `mmap`ed runtime.
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
//! Simple `mmap`ed runtime.
 //!
 //! This runtime supports adding code to executable pages and turn the added code into user
 //! specified function pointer.
@@ -424,22 +457,55 @@
         unsafe { Self::as_fn::<F>(fn_start) }
     }
 
-    /// Dump the code added so far to the runtime into a file called `jit.asm` in the processes
-    /// current working directory.
-    ///
-    /// The code can be inspected with a disassembler as for example `ndiasm` from
-    /// [nasm.us](https://nasm.us/index.php).
-    /// ```sh
-    /// ndisasm -b 64 jit.asm
-    /// ```
+    /// Disassemble the code currently added to the runtime, using
+    /// [`ndisasm`](https://nasm.us/index.php) and print it to _stdout_. If
+    /// `ndisasm` is not available on the system this prints a warning and
+    /// becomes a nop.
     ///
     /// # Panics
     ///
-    /// Panics if writing the file failed.
-    pub fn dump(&self) {
+    /// Panics if anything goes wrong with spawning, writing to or reading from
+    /// the `ndisasm` child process.
+    pub fn disasm(&self) {
         assert!(self.idx <= self.len);
         let code = unsafe { core::slice::from_raw_parts(self.buf, self.idx) };
-        std::fs::write("jit.asm", code).expect("Failed to write file");
+
+        // Create ndisasm process, which expects input on stdin.
+        let mut child = match std::process::Command::new("ndisasm")
+            .args(["-b64", "-"])
+            .stdin(std::process::Stdio::piped())
+            .stdout(std::process::Stdio::piped())
+            .spawn()
+        {
+            Ok(child) => child,
+            Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
+                println!("Runtime::disasm: ndisasm not found, skipping!");
+                return;
+            }
+            Err(err) => {
+                panic!("{:?}", err);
+            }
+        };
+
+        // Write code to stdin of ndisasm.
+        use std::io::Write;
+        child
+            .stdin
+            .take()
+            .expect("failed to take stdin")
+            .write_all(code)
+            .expect("failed to write bytes to stdin");
+
+        // Wait for output from ndisasm and print to stdout.
+        println!(
+            "{}",
+            String::from_utf8_lossy(
+                &child
+                    .wait_with_output()
+                    .expect("failed to get stdout")
+                    .stdout
+            )
+        );
     }
 
     /// Reinterpret the block of code pointed to by `fn_start` as `F`.
-- 
cgit v1.2.3