The world's most popular open source database
#include <sp_head.h>
Inheritance diagram for sp_instr_jump_if_not:


Public Member Functions | |
| sp_instr_jump_if_not (uint ip, sp_pcontext *ctx, Item *i, LEX *lex) | |
| sp_instr_jump_if_not (uint ip, sp_pcontext *ctx, Item *i, uint dest, LEX *lex) | |
| virtual | ~sp_instr_jump_if_not () |
| virtual int | execute (THD *thd, uint *nextp) |
| virtual int | exec_core (THD *thd, uint *nextp) |
| virtual void | print (String *str) |
| virtual uint | opt_mark (sp_head *sp) |
| virtual uint | opt_shortcut_jump (sp_head *sp, sp_instr *start) |
| virtual void | opt_move (uint dst, List< sp_instr > *ibp) |
| virtual void | set_destination (uint old_dest, uint new_dest) |
Private Member Functions | |
| sp_instr_jump_if_not (const sp_instr_jump_if_not &) | |
| void | operator= (sp_instr_jump_if_not &) |
Private Attributes | |
| Item * | m_expr |
| sp_lex_keeper | m_lex_keeper |
Definition at line 779 of file sp_head.h.
| sp_instr_jump_if_not::sp_instr_jump_if_not | ( | const sp_instr_jump_if_not & | ) | [private] |
| sp_instr_jump_if_not::sp_instr_jump_if_not | ( | uint | ip, | |
| sp_pcontext * | ctx, | |||
| Item * | i, | |||
| LEX * | lex | |||
| ) | [inline] |
Definition at line 786 of file sp_head.h.
00787 : sp_instr_jump(ip, ctx), m_expr(i), 00788 m_lex_keeper(lex, TRUE) 00789 {}
| sp_instr_jump_if_not::sp_instr_jump_if_not | ( | uint | ip, | |
| sp_pcontext * | ctx, | |||
| Item * | i, | |||
| uint | dest, | |||
| LEX * | lex | |||
| ) | [inline] |
Definition at line 791 of file sp_head.h.
00792 : sp_instr_jump(ip, ctx, dest), m_expr(i), 00793 m_lex_keeper(lex, TRUE) 00794 {}
| virtual sp_instr_jump_if_not::~sp_instr_jump_if_not | ( | ) | [inline, virtual] |
| int sp_instr_jump_if_not::exec_core | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Reimplemented from sp_instr.
Definition at line 2716 of file sp_head.cc.
References sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_dest, m_expr, sp_instr::m_ip, sp_prepare_func_item(), and Item::val_bool().
02717 { 02718 Item *it; 02719 int res; 02720 02721 it= sp_prepare_func_item(thd, &m_expr); 02722 if (! it) 02723 { 02724 res= -1; 02725 *nextp = m_cont_dest; 02726 } 02727 else 02728 { 02729 res= 0; 02730 if (! it->val_bool()) 02731 *nextp = m_dest; 02732 else 02733 *nextp = m_ip+1; 02734 } 02735 02736 return res; 02737 }
Here is the call graph for this function:

| int sp_instr_jump_if_not::execute | ( | THD * | thd, | |
| uint * | nextp | |||
| ) | [virtual] |
Reimplemented from sp_instr_jump.
Definition at line 2707 of file sp_head.cc.
References DBUG_ENTER, DBUG_PRINT, DBUG_RETURN, sp_instr_opt_meta::m_dest, m_lex_keeper, sp_lex_keeper::reset_lex_and_exec_core(), and TRUE.
02708 { 02709 DBUG_ENTER("sp_instr_jump_if_not::execute"); 02710 DBUG_PRINT("info", ("destination: %u", m_dest)); 02711 DBUG_RETURN(m_lex_keeper.reset_lex_and_exec_core(thd, nextp, TRUE, this)); 02712 }
Here is the call graph for this function:

| void sp_instr_jump_if_not::operator= | ( | sp_instr_jump_if_not & | ) | [private] |
Reimplemented from sp_instr_jump.
Definition at line 2756 of file sp_head.cc.
References sp_head::get_instr(), sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_cont_optdest, sp_instr_opt_meta::m_dest, sp_instr::m_ip, sp_instr_opt_meta::m_optdest, sp_instr::marked, sp_head::opt_mark(), and sp_instr::opt_shortcut_jump().
02757 { 02758 sp_instr *i; 02759 02760 marked= 1; 02761 if ((i= sp->get_instr(m_dest))) 02762 { 02763 m_dest= i->opt_shortcut_jump(sp, this); 02764 m_optdest= sp->get_instr(m_dest); 02765 } 02766 sp->opt_mark(m_dest); 02767 if ((i= sp->get_instr(m_cont_dest))) 02768 { 02769 m_cont_dest= i->opt_shortcut_jump(sp, this); 02770 m_cont_optdest= sp->get_instr(m_cont_dest); 02771 } 02772 sp->opt_mark(m_cont_dest); 02773 return m_ip+1; 02774 }
Here is the call graph for this function:

Reimplemented from sp_instr_jump.
Definition at line 2777 of file sp_head.cc.
References sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_cont_optdest, sp_instr_opt_meta::m_dest, sp_instr::m_ip, sp_instr_jump::opt_move(), and List< T >::push_back().
02778 { 02779 /* 02780 cont. destinations may point backwards after shortcutting jumps 02781 during the mark phase. If it's still pointing forwards, only 02782 push this for backpatching if sp_instr_jump::opt_move() will not 02783 do it (i.e. if the m_dest points backwards). 02784 */ 02785 if (m_cont_dest > m_ip) 02786 { // Forward 02787 if (m_dest < m_ip) 02788 bp->push_back(this); 02789 } 02790 else if (m_cont_optdest) 02791 m_cont_dest= m_cont_optdest->m_ip; // Backward 02792 /* This will take care of m_dest and m_ip */ 02793 sp_instr_jump::opt_move(dst, bp); 02794 }
Here is the call graph for this function:

| virtual uint sp_instr_jump_if_not::opt_shortcut_jump | ( | sp_head * | sp, | |
| sp_instr * | start | |||
| ) | [inline, virtual] |
Reimplemented from sp_instr_jump.
Definition at line 808 of file sp_head.h.
References sp_instr::m_ip.
00809 { 00810 return m_ip; 00811 }
| void sp_instr_jump_if_not::print | ( | String * | str | ) | [virtual] |
Reimplemented from sp_instr_jump.
Definition at line 2741 of file sp_head.cc.
References sp_instr_opt_meta::m_cont_dest, sp_instr_opt_meta::m_dest, m_expr, Item::print(), String::qs_append(), String::reserve(), SP_INSTR_UINT_MAXLEN, and STRING_WITH_LEN.
02742 { 02743 /* jump_if_not dest(cont) ... */ 02744 if (str->reserve(2*SP_INSTR_UINT_MAXLEN+14+32)) // Add some for the expr. too 02745 return; 02746 str->qs_append(STRING_WITH_LEN("jump_if_not ")); 02747 str->qs_append(m_dest); 02748 str->qs_append('('); 02749 str->qs_append(m_cont_dest); 02750 str->qs_append(STRING_WITH_LEN(") ")); 02751 m_expr->print(str); 02752 }
Here is the call graph for this function:

| virtual void sp_instr_jump_if_not::set_destination | ( | uint | old_dest, | |
| uint | new_dest | |||
| ) | [inline, virtual] |
Reimplemented from sp_instr_jump.
Definition at line 815 of file sp_head.h.
References sp_instr_opt_meta::m_cont_dest, and sp_instr_jump::set_destination().
00816 { 00817 sp_instr_jump::set_destination(old_dest, new_dest); 00818 if (m_cont_dest == old_dest) 00819 m_cont_dest= new_dest; 00820 }
Here is the call graph for this function:

Item* sp_instr_jump_if_not::m_expr [private] |
1.4.7

