Alien-LibJIT
view release on metacpan or search on metacpan
libjit/jit/jit-internal.h view on Meta::CPAN
/* Generate position-independent code */
unsigned position_independent : 1;
/* Memory pools that contain values, instructions, and metadata blocks */
jit_memory_pool value_pool;
jit_memory_pool edge_pool;
jit_memory_pool meta_pool;
/* Common constants that have been cached */
jit_value_t null_constant;
jit_value_t zero_constant;
/* The values for the parameters, structure return, and parent frame */
jit_value_t *param_values;
jit_value_t struct_return;
jit_value_t parent_frame;
/* Metadata that is stored only while the function is being built */
jit_meta_t meta;
/* Current size of the local variable frame (used by the back end) */
jit_nint frame_size;
/* Number of stack items that are queued for a deferred pop */
jit_nint deferred_items;
/* Size of the outgoing parameter area in the frame */
jit_nint param_area_size;
#ifdef _JIT_COMPILE_DEBUG
int block_count;
int insn_count;
#endif
};
/*
* Internal structure of a function.
*/
struct _jit_function
{
/* The context that the function is associated with */
jit_context_t context;
jit_function_t next;
jit_function_t prev;
/* Containing function in a nested context */
jit_function_t nested_parent;
/* Metadata that survives once the builder is discarded */
jit_meta_t meta;
/* The signature for this function */
jit_type_t signature;
/* The builder information for this function */
jit_builder_t builder;
/* Debug information for this function */
jit_varint_data_t bytecode_offset;
/* Cookie value for this function */
void *cookie;
/* Flag bits for this function */
unsigned is_recompilable : 1;
unsigned is_optimized : 1;
unsigned no_throw : 1;
unsigned no_return : 1;
unsigned has_try : 1;
unsigned optimization_level : 8;
/* Flag set once the function is compiled */
int volatile is_compiled;
/* The entry point for the function's compiled code */
void * volatile entry_point;
/* The function to call to perform on-demand compilation */
jit_on_demand_func on_demand;
#ifndef JIT_BACKEND_INTERP
# ifdef jit_redirector_size
/* Buffer that contains the redirector for this function.
Redirectors are used to support on-demand compilation */
unsigned char *redirector;
# endif
/* Buffer that contains the indirector for this function.
The indirector jumps to the address that is currently
stored in the entry_point field. Indirectors are used
to support recompilation and on-demand compilation. */
unsigned char *indirector;
#endif
};
/*
* Ensure that there is a builder associated with a function.
*/
int _jit_function_ensure_builder(jit_function_t func);
/*
* Free the builder associated with a function.
*/
void _jit_function_free_builder(jit_function_t func);
/*
* Destroy all memory associated with a function.
*/
void _jit_function_destroy(jit_function_t func);
/*
* Compute value liveness and "next use" information for a function.
*/
void _jit_function_compute_liveness(jit_function_t func);
/*
* Compile a function on-demand. Returns the entry point.
*/
void *_jit_function_compile_on_demand(jit_function_t func);
/*
( run in 2.616 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )