[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9 Working with basic blocks in the JIT

Function: jit_function_t jit_block_get_function (jit_block_t block)

Get the function that a particular block belongs to.

Function: jit_context_t jit_block_get_context (jit_block_t block)

Get the context that a particular block belongs to.

Function: jit_label_t jit_block_get_label (jit_block_t block)

Get the label associated with a block.

Function: jit_label_t jit_block_get_next_label (jit_block_t block, jit_label_t label)

Get the next label associated with a block.

Function: jit_block_t jit_block_next (jit_function_t func, jit_block_t previous)

Iterate over the blocks in a function, in order of their creation. The previous argument should be NULL on the first call. This function will return NULL if there are no further blocks to iterate.

Function: jit_block_t jit_block_previous (jit_function_t func, jit_block_t previous)

Iterate over the blocks in a function, in reverse order of their creation. The previous argument should be NULL on the first call. This function will return NULL if there are no further blocks to iterate.

Function: jit_block_t jit_block_from_label (jit_function_t func, jit_label_t label)

Get the block that corresponds to a particular label. Returns NULL if there is no block associated with the label.

Function: int jit_block_set_meta (jit_block_t block, int type, void *data, jit_meta_free_func free_data)

Tag a block with some metadata. Returns zero if out of memory. If the type already has some metadata associated with it, then the previous value will be freed. Metadata may be used to store dependency graphs, branch prediction information, or any other information that is useful to optimizers or code generators.

Metadata type values of 10000 or greater are reserved for internal use.

Function: void * jit_block_get_meta (jit_block_t block, int type)

Get the metadata associated with a particular tag. Returns NULL if type does not have any metadata associated with it.

Function: void jit_block_free_meta (jit_block_t block, int type)

Free metadata of a specific type on a block. Does nothing if the type does not have any metadata associated with it.

Function: int jit_block_is_reachable (jit_block_t block)

Determine if a block is reachable from some other point in its function. Unreachable blocks can be discarded in their entirety. If the JIT is uncertain as to whether a block is reachable, or it does not wish to perform expensive flow analysis to find out, then it will err on the side of caution and assume that it is reachable.

Function: int jit_block_ends_in_dead (jit_block_t block)

Determine if a block ends in a "dead" marker. That is, control will not fall out through the end of the block.

Function: int jit_block_current_is_dead (jit_function_t func)

Determine if the current point in the function is dead. That is, there are no existing branches or fall-throughs to this point. This differs slightly from jit_block_ends_in_dead in that this can skip past zero-length blocks that may not appear to be dead to find the dead block at the head of a chain of empty blocks.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated on September 17, 2016 using texi2html 5.0.