diff options
author | unknown <malff/marcsql@weblab.(none)> | 2007-01-02 14:18:13 -0700 |
---|---|---|
committer | unknown <malff/marcsql@weblab.(none)> | 2007-01-02 14:18:13 -0700 |
commit | d7577ecb7d455d9a326a7543c8ef1a81e59150d1 (patch) | |
tree | 1a43bc5c6b21902a943e0a8759f9f36c9c407c1c /sql/sp_head.h | |
parent | f20cb8d0379264eef566c6b91fe2aa03017789ba (diff) | |
parent | 552d4cede57926ecfba91624e9ef2a72cf1bd81f (diff) | |
download | mariadb-git-d7577ecb7d455d9a326a7543c8ef1a81e59150d1.tar.gz |
Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into weblab.(none):/home/marcsql/TREE/mysql-5.1-merge
mysql-test/r/sp.result:
Auto merged
server-tools/instance-manager/commands.cc:
Auto merged
server-tools/instance-manager/commands.h:
Auto merged
server-tools/instance-manager/guardian.cc:
Auto merged
server-tools/instance-manager/guardian.h:
Auto merged
server-tools/instance-manager/instance.cc:
Auto merged
server-tools/instance-manager/instance.h:
Auto merged
server-tools/instance-manager/instance_map.cc:
Auto merged
server-tools/instance-manager/instance_map.h:
Auto merged
server-tools/instance-manager/instance_options.h:
Auto merged
server-tools/instance-manager/listener.cc:
Auto merged
server-tools/instance-manager/manager.cc:
Auto merged
server-tools/instance-manager/manager.h:
Auto merged
server-tools/instance-manager/user_map.cc:
Auto merged
sql/event_data_objects.cc:
Auto merged
sql/event_queue.cc:
Auto merged
sql/handler.cc:
Auto merged
sql/lock.cc:
Auto merged
sql/set_var.cc:
Auto merged
sql/set_var.h:
Auto merged
sql/sp_head.cc:
Auto merged
sql/sp_head.h:
Auto merged
sql/sql_class.cc:
Auto merged
sql/sql_class.h:
Auto merged
sql/sql_lex.cc:
Auto merged
sql/sql_lex.h:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
storage/csv/ha_tina.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index 2c554d50bd8..0085608ae40 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -303,8 +303,19 @@ public: void restore_thd_mem_root(THD *thd); + /** + Optimize the code. + */ void optimize(); - void opt_mark(uint ip); + + /** + Helper used during flow analysis during code optimization. + See the implementation of <code>opt_mark()</code>. + @param ip the instruction to add to the leads list + @param leads the list of remaining paths to explore in the graph that + represents the code, during flow analysis. + */ + void add_mark_lead(uint ip, List<sp_instr> *leads); void recursion_level_error(THD *thd); @@ -413,6 +424,12 @@ private: bool execute(THD *thd); + /** + Perform a forward flow analysis in the generated code. + Mark reachable instructions, for the optimizer. + */ + void opt_mark(); + /* Merge the list of tables used by query into the multi-set of tables used by routine. @@ -480,10 +497,10 @@ public: /* Mark this instruction as reachable during optimization and return the - index to the next instruction. Jump instruction will mark their - destination too recursively. + index to the next instruction. Jump instruction will add their + destination to the leads list. */ - virtual uint opt_mark(sp_head *sp) + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads) { marked= 1; return m_ip+1; @@ -755,7 +772,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp); + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads); virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start); @@ -805,7 +822,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp); + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads); /* Override sp_instr_jump's shortcut; we stop here */ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) @@ -851,7 +868,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp) + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads) { marked= 1; return UINT_MAX; @@ -888,7 +905,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp); + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads); /* Override sp_instr_jump's shortcut; we stop here. */ virtual uint opt_shortcut_jump(sp_head *sp, sp_instr *start) @@ -953,7 +970,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp); + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads); private: @@ -1123,7 +1140,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp) + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads) { marked= 1; return UINT_MAX; @@ -1156,7 +1173,7 @@ public: virtual void print(String *str); - virtual uint opt_mark(sp_head *sp); + virtual uint opt_mark(sp_head *sp, List<sp_instr> *leads); virtual void opt_move(uint dst, List<sp_instr> *ibp); |