From 779f16ef901642de5012297734af0e20f36767cf Mon Sep 17 00:00:00 2001 From: johannst Date: Thu, 19 Dec 2024 17:29:34 +0000 Subject: deploy: f76bf4e81d6b039007715ca0af3ad3a5d043367f --- src/fib/fib.rs.html | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/fib/fib.rs.html') diff --git a/src/fib/fib.rs.html b/src/fib/fib.rs.html index 32ebea0..c1a746f 100644 --- a/src/fib/fib.rs.html +++ b/src/fib/fib.rs.html @@ -76,8 +76,7 @@ 75 76 77 -78 -79
//! Fibonacci example.
+78
//! Fibonacci example.
 //!
 //! Jit compile a function at runtime (generate native host code) to compute the fibonacci sequence
 //! to demonstrate the [`juicebox_asm`] crate.
@@ -141,14 +140,13 @@
     asm.bind(&mut end);
     asm.ret();
 
-    // Write out JIT code for visualization.
-    // Disassemble for example with `ndisasm -b 64 jit.asm`.
-    let code = asm.into_code();
-    std::fs::write("jit.asm", &code).unwrap();
-
     // Move code into executable page and get function pointer to it.
     let mut rt = Runtime::new();
-    let fib = unsafe { rt.add_code::<extern "C" fn(u64) -> u64>(code) };
+    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();
 
     for n in 0..15 {
         let fib_jit = fib(n);
-- 
cgit v1.2.3