diff options
author | Takashi Kokubun <[email protected]> | 2025-02-06 11:39:06 -0500 |
---|---|---|
committer | Takashi Kokubun <[email protected]> | 2025-04-18 21:52:56 +0900 |
commit | 0f9557e9a7992c91c4aba9d8cf88c0695445e611 (patch) | |
tree | 2ac7267c7211f09f46003cd62529eb16b2b16d44 /zjit/src/codegen.rs | |
parent | a0e2502e183cbc699cfd18922dfc9ee1fede320f (diff) |
Copy VirtualMem and mmap
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13131
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; |