My Project
|
#include <sp_instr.h>
Public Member Functions | |
void | set_cont_dest (uint cont_dest) |
virtual uint | opt_mark (sp_head *sp, List< sp_instr > *leads) |
virtual void | opt_move (uint dst, List< sp_branch_instr > *ibp) |
virtual uint | get_cont_dest () const |
virtual bool | is_invalid () const |
virtual void | invalidate () |
virtual LEX_STRING | get_expr_query () const |
virtual void | set_destination (uint old_dest, uint new_dest) |
virtual void | backpatch (uint dest) |
Protected Member Functions | |
sp_lex_branch_instr (uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_STRING expr_query) | |
sp_lex_branch_instr (uint ip, sp_pcontext *ctx, LEX *lex, Item *expr_item, LEX_STRING expr_query, uint dest) | |
Protected Attributes | |
uint | m_dest |
Where we will go. | |
uint | m_cont_dest |
Where continue handlers will go. | |
sp_instr * | m_optdest |
sp_instr * | m_cont_optdest |
Item * | m_expr_item |
Expression item. | |
LEX_STRING | m_expr_query |
SQL-query corresponding to the expression. |
sp_lex_branch_instr is a base class for SP-instructions, which might perform conditional jump depending on the value of an SQL-expression.
virtual void sp_lex_branch_instr::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_set_case_expr.
virtual uint sp_lex_branch_instr::get_cont_dest | ( | ) | const [inline, virtual] |
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Reimplemented from sp_instr.
virtual LEX_STRING sp_lex_branch_instr::get_expr_query | ( | ) | const [inline, virtual] |
Reimplemented from sp_lex_instr.
virtual void sp_lex_branch_instr::invalidate | ( | ) | [inline, virtual] |
virtual bool sp_lex_branch_instr::is_invalid | ( | ) | const [inline, virtual] |
false | if the object (i.e. LEX-object) is valid and exec_core() can be just called. |
true | if the object is not valid any longer, exec_core() can not be called. The original query string should be re-parsed and a new LEX-object should be used. |
Implements sp_lex_instr.
uint sp_lex_branch_instr::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_set_case_expr.
void sp_lex_branch_instr::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.
Reimplemented in sp_instr_set_case_expr.
virtual void sp_lex_branch_instr::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.
Reimplemented in sp_instr_set_case_expr.