MySQL 5.6.14 Source Code Document
|
#include <sp_instr.h>
Public Member Functions | |
sp_instr (uint ip, sp_pcontext *ctx) | |
virtual bool | execute (THD *thd, uint *nextp)=0 |
uint | get_ip () const |
virtual uint | get_cont_dest () const |
sp_pcontext * | get_parsing_ctx () const |
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) |
bool | opt_is_marked () const |
Public Member Functions inherited from sp_printable | |
virtual void | print (String *str)=0 |
Protected Attributes | |
bool | m_marked |
uint | m_ip |
Instruction pointer. | |
sp_pcontext * | m_parsing_ctx |
Instruction parsing context. |
Additional Inherited Members | |
Static Public Member Functions inherited from Sql_alloc | |
static void * | operator new (size_t size) throw () |
static void * | operator new[] (size_t size) throw () |
static void * | operator new[] (size_t size, MEM_ROOT *mem_root) throw () |
static void * | operator new (size_t size, MEM_ROOT *mem_root) throw () |
static void | operator delete (void *ptr, size_t size) |
static void | operator delete (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, MEM_ROOT *mem_root) |
static void | operator delete[] (void *ptr, size_t size) |
Base class for every SP-instruction. sp_instr defines interface and provides base implementation.
Definition at line 61 of file sp_instr.h.
|
pure 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. |
Implemented in sp_instr_error, sp_instr_cfetch, sp_instr_cclose, sp_instr_copen, sp_instr_cpop, sp_instr_cpush, sp_instr_hreturn, sp_instr_hpop, sp_instr_hpush_jump, sp_instr_jump, sp_instr_stmt, and sp_lex_instr.
|
inlinevirtual |
Get the continuation destination (instruction pointer for the CONTINUE HANDLER) of this instruction.
Reimplemented in sp_lex_branch_instr.
Definition at line 98 of file sp_instr.h.
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 in sp_instr_error, sp_instr_hreturn, sp_instr_hpush_jump, sp_instr_set_case_expr, sp_lex_branch_instr, sp_instr_jump, and sp_instr_freturn.
Definition at line 113 of file sp_instr.h.
|
inlinevirtual |
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 in sp_instr_set_case_expr, sp_lex_branch_instr, and sp_instr_jump.
Definition at line 134 of file sp_instr.h.
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 in sp_instr_hreturn, sp_instr_hpush_jump, and sp_instr_jump.
Definition at line 125 of file sp_instr.h.
|
protected |
Show if this instruction is reachable within the SP (used by SP-optimizer).
Definition at line 143 of file sp_instr.h.