Esempio n. 1
0
/* Since the image might have been saved with a different base address than
where it is loaded, we need to fix up pointers in the image. */
void factor_vm::relocate_data(cell data_relocation_base, cell code_relocation_base)
{
	for(cell i = 0; i < USER_ENV; i++)
		data_fixup(&userenv[i],data_relocation_base);

	data_fixup(&T,data_relocation_base);
	data_fixup(&bignum_zero,data_relocation_base);
	data_fixup(&bignum_pos_one,data_relocation_base);
	data_fixup(&bignum_neg_one,data_relocation_base);

	cell obj = data->tenured->start;

	while(obj)
	{
		relocate_object((object *)obj,data_relocation_base,code_relocation_base);
		data->tenured->record_object_start_offset((object *)obj);
		obj = data->tenured->next_object_after(this,obj);
	}
}
Esempio n. 2
0
File: image.c Progetto: glguy/factor
/* Since the image might have been saved with a different base address than
where it is loaded, we need to fix up pointers in the image. */
void relocate_data()
{
	CELL relocating;

	CELL i;
	for(i = 0; i < USER_ENV; i++)
		data_fixup(&userenv[i]);

	data_fixup(&T);
	data_fixup(&bignum_zero);
	data_fixup(&bignum_pos_one);
	data_fixup(&bignum_neg_one);

	F_ZONE *tenured = &data_heap->generations[TENURED];

	for(relocating = tenured->start;
		relocating < tenured->here;
		relocating += untagged_object_size(relocating))
	{
		allot_barrier(relocating);
		relocate_object(relocating);
	}
}
Esempio n. 3
0
/* Since the image might have been saved with a different base address than
where it is loaded, we need to fix up pointers in the image. */
void relocate_data()
{
	cell relocating;

	cell i;
	for(i = 0; i < USER_ENV; i++)
		data_fixup(&userenv[i]);

	data_fixup(&T);
	data_fixup(&bignum_zero);
	data_fixup(&bignum_pos_one);
	data_fixup(&bignum_neg_one);

	zone *tenured = &data->generations[data->tenured()];

	for(relocating = tenured->start;
		relocating < tenured->here;
		relocating += untagged_object_size((object *)relocating))
	{
		object *obj = (object *)relocating;
		allot_barrier(obj);
		relocate_object(obj);
	}
}