]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/code_blocks.hpp
GC maps for more compact inline GC checks
[factor.git] / vm / code_blocks.hpp
index baf763357c5911f379c928160d708ab10141dd06..f20e2da37292d5c6a5a8c1dd12cbb16d03d19f69 100644 (file)
@@ -43,11 +43,22 @@ struct code_block
                return size;
        }
 
+       template<typename Fixup> cell size(Fixup fixup) const
+       {
+               return size();
+       }
+
        void *entry_point() const
        {
                return (void *)(this + 1);
        }
 
+       /* GC info is stored at the end of the block */
+       gc_info *block_gc_info() const
+       {
+               return (gc_info *)((u8 *)this + size() - sizeof(gc_info));
+       }
+
        void flush_icache()
        {
                factor::flush_icache((cell)this,size());