diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-23 13:46:43 -0700 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-08-29 09:09:41 -0700 |
commit | def3ade8a809a230648cdffbf4ab066b07fe7bf1 (patch) | |
tree | 8d976629754280b8bf0777a846a7267900cd0f1e /yjit/src/asm | |
parent | 54c7bc67a2d54311b77aca9233b23a9e7a1ca581 (diff) | |
download | ruby-def3ade8a809a230648cdffbf4ab066b07fe7bf1.tar.gz |
Add --yjit-dump-disasm to dump every compiled code (https://github.com/Shopify/ruby/pull/430)
* Add --yjit-dump-disasm to dump every compiled code
* Just use get_option
* Carve out disasm_from_addr
* Avoid push_str with format!
* Share the logic through asm.compile
* This seems to negatively impact the compilation speed
Diffstat (limited to 'yjit/src/asm')
-rw-r--r-- | yjit/src/asm/mod.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/yjit/src/asm/mod.rs b/yjit/src/asm/mod.rs index fef4518816..4029e2ca67 100644 --- a/yjit/src/asm/mod.rs +++ b/yjit/src/asm/mod.rs @@ -57,6 +57,10 @@ pub struct CodeBlock { #[cfg(feature = "asm_comments")] asm_comments: BTreeMap<usize, Vec<String>>, + // True for OutlinedCb + #[cfg(feature = "disasm")] + pub outlined: bool, + // Set if the CodeBlock is unable to output some instructions, // for example, when there is not enough space or when a jump // target is too far away. @@ -65,7 +69,7 @@ pub struct CodeBlock { impl CodeBlock { /// Make a new CodeBlock - pub fn new(mem_block: VirtualMem) -> Self { + pub fn new(mem_block: VirtualMem, outlined: bool) -> Self { Self { mem_size: mem_block.virtual_region_size(), mem_block, @@ -75,6 +79,8 @@ impl CodeBlock { label_refs: Vec::new(), #[cfg(feature = "asm_comments")] asm_comments: BTreeMap::new(), + #[cfg(feature = "disasm")] + outlined, dropped_bytes: false, } } @@ -282,7 +288,7 @@ impl CodeBlock { let mem_start: *const u8 = alloc.mem_start(); let virt_mem = VirtualMem::new(alloc, 1, mem_start as *mut u8, mem_size); - Self::new(virt_mem) + Self::new(virt_mem, false) } } |