My Project
|
#include <sp_instr.h>
Public Member Functions | |
sp_instr_jump (uint ip, sp_pcontext *ctx) | |
sp_instr_jump (uint ip, sp_pcontext *ctx, uint dest) | |
virtual void | print (String *str) |
virtual bool | execute (THD *thd, uint *nextp) |
virtual uint | opt_mark (sp_head *sp, List< sp_instr > *leads) |
virtual uint | opt_shortcut_jump (sp_head *sp, sp_instr *start) |
virtual void | opt_move (uint dst, List< sp_branch_instr > *ibp) |
virtual void | set_destination (uint old_dest, uint new_dest) |
virtual void | backpatch (uint dest) |
Protected Attributes | |
uint | m_dest |
Where we will go. | |
sp_instr * | m_optdest |
This is base class for all kinds of jump instructions.
virtual void sp_instr_jump::backpatch | ( | uint | dest | ) | [inline, virtual] |
Update all instruction with the given label in the backpatch list to the specified instruction pointer.
dest | destination instruction pointer. |
Implements sp_branch_instr.
Reimplemented in sp_instr_hpush_jump.
virtual bool sp_instr_jump::execute | ( | THD * | thd, |
uint * | nextp | ||
) | [inline, virtual] |
Execute this instruction
thd | Thread context | |
[out] | nextp | index of the next instruction to execute. (For most instructions this will be the instruction following this one). Note that this parameter is undefined in case of errors, use get_cont_dest() to find the continuation instruction for CONTINUE error handlers. |
Implements sp_instr.
Reimplemented in sp_instr_hreturn, and sp_instr_hpush_jump.
uint sp_instr_jump::opt_mark | ( | sp_head * | sp, |
List< sp_instr > * | leads | ||
) | [virtual] |
Mark this instruction as reachable during optimization and return the index to the next instruction. Jump instruction will add their destination to the leads list.
Reimplemented from sp_instr.
Reimplemented in sp_instr_hreturn, and sp_instr_hpush_jump.
void sp_instr_jump::opt_move | ( | uint | dst, |
List< sp_branch_instr > * | ibp | ||
) | [virtual] |
Inform the instruction that it has been moved during optimization. Most instructions will simply update its index, but jump instructions must also take care of their destination pointers. Forward jumps get pushed to the backpatch list 'ibp'.
Reimplemented from sp_instr.
uint sp_instr_jump::opt_shortcut_jump | ( | sp_head * | sp, |
sp_instr * | start | ||
) | [virtual] |
Short-cut jumps to jumps during optimization. This is used by the jump instructions' opt_mark() methods. 'start' is the starting point, used to prevent the mark sweep from looping for ever. Return the end destination.
Reimplemented from sp_instr.
Reimplemented in sp_instr_hreturn, and sp_instr_hpush_jump.
virtual void sp_instr_jump::set_destination | ( | uint | old_dest, |
uint | new_dest | ||
) | [inline, virtual] |
Update the destination; used by the SP-instruction-optimizer.
old_dest | current (old) destination (instruction pointer). |
new_dest | new destination (instruction pointer). |
Implements sp_branch_instr.