Esempio n. 1
0
cell frame_executing(stack_frame *frame)
{
	code_block *compiled = frame_code(frame);
	if(compiled->literals == F || !stack_traces_p())
		return F;
	else
	{
		array *literals = untag<array>(compiled->literals);
		cell executing = array_nth(literals,0);
		check_data_pointer((object *)executing);
		return executing;
	}
}
Esempio n. 2
0
template<typename Iterator> void factor_vm::iterate_relocations(code_block *compiled, Iterator &iter)
{
	if(compiled->relocation != F)
	{
		byte_array *relocation = untag<byte_array>(compiled->relocation);

		cell index = stack_traces_p() ? 1 : 0;

		cell length = array_capacity(relocation) / sizeof(relocation_entry);
		for(cell i = 0; i < length; i++)
		{
			relocation_entry rel = relocation->data<relocation_entry>()[i];
			iter(rel,index,compiled);
			index += number_of_parameters(relocation_type_of(rel));			
		}
	}
}