Optimize hook dispatch codegen - #110
Merged
Merged
Conversation
Matches the pattern already used in the post-plugin loop (line 192-193). Prevents re-entrant inner calls from seeing a stale flag and doing unnecessary find_plugin_after_rebuild lookups.
Change reentry tracking from 0-based post-increment counter to -1-based pre-increment index. Pre-increment + compare-to-zero generates inc+jnz on x86 instead of load-compare-increment from post-increment. Exit uses dec+js instead of dec+jnz.
Move copy_meta_globals into the reentry branch — the outermost call has no previous meta globals to save or restore, so the copies are wasted work on the non-reentrant fast path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hook_list_tables_updatedflag immediately after capture in the pre-plugin loop, matching the existing post-plugin loop pattern and preventing unnecessaryfind_plugin_after_rebuildlookups during re-entrant dispatch-1-basedreentry_indexinstead of post-increment0-basedreentry_countfor better x86 codegen (inc+jnz/dec+jsvs load-compare-increment)copy_meta_globalssave/restore on the outermost (non-reentrant) call where there are no previous meta globals to preserveTest plan