Alien-LibJIT

 view release on metacpan or  search on metacpan

libjit/jit/jit-internal.h  view on Meta::CPAN

#define _JIT_EDGE_EXCEPT	3

/*
 * Internal structure of a basic block.
 */
struct _jit_block
{
	jit_function_t		func;
	jit_label_t		label;

	/* List of all instructions in this block */
	jit_insn_t		insns;
	int			num_insns;
	int			max_insns;

	/* Next and previous blocks in the function's linear block list */
	jit_block_t 		next;
	jit_block_t 		prev;

	/* Edges to successor blocks in control flow graph */
	_jit_edge_t		*succs;
	int			num_succs;

	/* Edges to predecessor blocks in control flow graph */
	_jit_edge_t		*preds;
	int			num_preds;

	/* Control flow flags */
	unsigned		visited : 1;
	unsigned		ends_in_dead : 1;
	unsigned		address_of : 1;

	/* Metadata */
	jit_meta_t		meta;

	/* Code generation data */
	void			*address;
	void			*fixup_list;
	void			*fixup_absolute_list;
};

/*
 * Internal structure of a value.
 */
struct _jit_value
{
	jit_block_t		block;
	jit_type_t		type;
	unsigned		is_temporary : 1;
	unsigned		is_local : 1;
	unsigned		is_volatile : 1;
	unsigned		is_addressable : 1;
	unsigned		is_constant : 1;
	unsigned		is_nint_constant : 1;
	unsigned		is_parameter : 1;
	unsigned		is_reg_parameter : 1;
	unsigned		has_address : 1;
	unsigned		free_address : 1;
	unsigned		in_register : 1;
	unsigned		in_frame : 1;
	unsigned		in_global_register : 1;
	unsigned		live : 1;
	unsigned		next_use : 1;
	unsigned		has_frame_offset : 1;
	unsigned		global_candidate : 1;
	unsigned		has_global_register : 1;
	short			reg;
	short			global_reg;
	jit_nint		address;
	jit_nint		frame_offset;
	jit_nuint		usage_count;
	int			index;
};
#define	JIT_INVALID_FRAME_OFFSET	((jit_nint)0x7FFFFFFF)

/*
 * Free the structures that are associated with a value.
 */
void _jit_value_free(void *value);

/*
 * Add references to all of the parameter values in a function.
 * This is used when the initialization block is split during a
 * "jit_insn_move_blocks_to_start" instruction.
 */
void _jit_value_ref_params(jit_function_t func);

/*
 * Internal structure of an instruction.
 */
struct _jit_insn
{
	short			opcode;
	short			flags;
	jit_value_t		dest;
	jit_value_t		value1;
	jit_value_t		value2;
};

/*
 * Instruction flags.
 */
#define	JIT_INSN_DEST_LIVE		0x0001
#define	JIT_INSN_DEST_NEXT_USE		0x0002
#define	JIT_INSN_VALUE1_LIVE		0x0004
#define	JIT_INSN_VALUE1_NEXT_USE	0x0008
#define	JIT_INSN_VALUE2_LIVE		0x0010
#define	JIT_INSN_VALUE2_NEXT_USE	0x0020
#define	JIT_INSN_LIVENESS_FLAGS		0x003F
#define	JIT_INSN_DEST_IS_LABEL		0x0040
#define	JIT_INSN_DEST_IS_FUNCTION	0x0080
#define	JIT_INSN_DEST_IS_NATIVE		0x0100
#define	JIT_INSN_DEST_OTHER_FLAGS	0x01C0
#define	JIT_INSN_VALUE1_IS_NAME		0x0200
#define	JIT_INSN_VALUE1_IS_LABEL	0x0400
#define	JIT_INSN_VALUE1_OTHER_FLAGS	0x0600
#define	JIT_INSN_VALUE2_IS_SIGNATURE	0x0800
#define	JIT_INSN_VALUE2_OTHER_FLAGS	0x0800
#define	JIT_INSN_DEST_IS_VALUE		0x1000

/*
 * Information about each label associated with a function.
 *
 * Multiple labels may belong to the same basic block. Such labels are
 * linked into list.
 */
typedef struct _jit_label_info _jit_label_info_t;
struct _jit_label_info



( run in 0.557 second using v1.01-cache-2.11-cpan-f0fbb3f571b )