4 /* The compiled code heap is structured into blocks. */
8 cell owner; /* tagged pointer to word, quotation or f */
9 cell parameters; /* tagged pointer to array or f */
10 cell relocation; /* tagged pointer to byte-array or f */
14 return (header & 1) == 1;
17 code_block_type type() const
19 return (code_block_type)((header >> 1) & 0x3);
22 void set_type(code_block_type type)
24 header = ((header & ~0x7) | (type << 1));
29 return type() == code_block_pic;
32 bool optimized_p() const
34 return type() == code_block_optimized;
44 return (void *)(this + 1);
49 factor::flush_icache((cell)this,size());
52 template<typename Iterator> void each_instruction_operand(Iterator &iter)
54 if(to_boolean(relocation))
56 byte_array *rels = (byte_array *)UNTAG(relocation);
59 cell length = (rels->capacity >> TAG_BITS) / sizeof(relocation_entry);
61 for(cell i = 0; i < length; i++)
63 relocation_entry rel = rels->data<relocation_entry>()[i];
64 iter(instruction_operand(rel,this,index));
65 index += rel.number_of_parameters();