Exemplo n.º 1
0
/*
 * Initialize the not yet initialized local values to 0 and move the
 * initialization sequence to the start of the function.
 */
static int _ILJitLocalsInit(ILJITCoder *coder)
{
	ILUInt32 num = coder->jitLocals.numSlots;

	if(num > 0)
	{
		jit_label_t startLabel = jit_label_undefined;
		jit_label_t endLabel = jit_label_undefined;

		if(!jit_insn_label(coder->jitFunction, &startLabel))
		{
			return 0;
		}

		if(!_ILJitLocalSlotsInitLocals(coder, &(coder->jitLocals)))
		{
			return 0;
		}

		if(!jit_insn_label(coder->jitFunction, &endLabel))
		{
			return 0;
		}
		if(!jit_insn_move_blocks_to_start(coder->jitFunction, startLabel,
															  endLabel))
		{
			return 0;
		}
	}
	return 1;
}
Exemplo n.º 2
0
void jit_function::insn_move_blocks_to_start
	(const jit_label& from_label, const jit_label& to_label)
{
	if(!jit_insn_move_blocks_to_start(func, from_label.raw(), to_label.raw()))
	{
		out_of_memory();
	}
}