diff options
author | konstantin@mysql.com <> | 2006-02-08 13:11:44 +0300 |
---|---|---|
committer | konstantin@mysql.com <> | 2006-02-08 13:11:44 +0300 |
commit | d4c5516929a0e5d3da3f5e7348d56b490ef0a996 (patch) | |
tree | d52a6a2982aebb6ef2627a7d45c870911ee5e677 /sql/sp_head.h | |
parent | 0831fd611e7c11c12af844665bf90399fe559d04 (diff) | |
parent | a6b86d8962d723f824606def34f51c8b5691a93c (diff) | |
download | mariadb-git-d4c5516929a0e5d3da3f5e7348d56b490ef0a996.tar.gz |
Merge mysql.com:/home/kostja/mysql/tmp_merge
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index c4b6cb36090..f9c37090322 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -460,17 +460,34 @@ public: virtual void backpatch(uint dest, sp_pcontext *dst_ctx) {} + /* + Mark this instruction as reachable during optimization and return the + index to the next instruction. Jump instruction will mark their + destination too recursively. + */ virtual uint opt_mark(sp_head *sp) { marked= 1; return m_ip+1; } + /* + 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. + */ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) { return m_ip; } + /* + 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'. + */ virtual void opt_move(uint dst, List<sp_instr> *ibp) { m_ip= dst; @@ -695,6 +712,9 @@ public: m_dest= dest; } + /* + Update the destination; used by the optimizer. + */ virtual void set_destination(uint old_dest, uint new_dest) { if (m_dest == old_dest) @@ -738,6 +758,7 @@ public: virtual uint opt_mark(sp_head *sp); + /* Override sp_instr_jump's shortcut; we stop here */ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) { return m_ip; @@ -821,6 +842,7 @@ public: virtual uint opt_mark(sp_head *sp); + /* Override sp_instr_jump's shortcut; we stop here. */ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) { return m_ip; @@ -858,15 +880,6 @@ public: virtual void print(String *str); - virtual void backpatch(uint dest, sp_pcontext *dst_ctx); - - virtual uint opt_mark(sp_head *sp) - { - if (m_count) - marked= 1; - return m_ip+1; - } - private: uint m_count; @@ -952,15 +965,6 @@ public: virtual void print(String *str); - virtual void backpatch(uint dest, sp_pcontext *dst_ctx); - - virtual uint opt_mark(sp_head *sp) - { - if (m_count) - marked= 1; - return m_ip+1; - } - private: uint m_count; |