diff options
Diffstat (limited to 'zjit/src/codegen.rs')
-rw-r--r-- | zjit/src/codegen.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zjit/src/codegen.rs b/zjit/src/codegen.rs new file mode 100644 index 0000000000..f54d8b2036 --- /dev/null +++ b/zjit/src/codegen.rs @@ -0,0 +1,19 @@ +use std::rc::Rc; +use std::cell::RefCell; + +use crate::virtualmem::VirtualMem; + +/// Block of memory into which instructions can be assembled +pub struct CodeBlock { + // Memory for storing the encoded instructions + mem_block: Rc<RefCell<VirtualMem>>, +} + +/// Global state needed for code generation +pub struct ZJITState { + /// Inline code block (fast path) + inline_cb: CodeBlock, +} + +/// Private singleton instance of the codegen globals +static mut ZJIT_STATE: Option<ZJITState> = None; |