Skip to content

Conversation

@gvanrossum
Copy link
Member

@gvanrossum gvanrossum commented Mar 18, 2024

This reduces the combined JIT template size by about 75 bytes (on Intel; 88 bytes on my M3, where everything is bigger, even the battery :-).

These opcodes always occur in a pair, and _CHECK_STACK_SPACE does some duplicate work (code = func->func_code). The latter doesn't use any cache entries. Both contain 2-3 DEOPT_IF() calls.

I'll run a benchmark once the tests pass.

This should reduce the combined JIT template size by ~75 bytes.
@brandtbucher
Copy link
Member

Was the idea behind splitting these that we could maybe sometimes optimize away one, but not both?

For example, if we already checked a larger stack size, we could remove this one. Similarly, if we have already guarded against this function’s version, we could probably avoid doing it again.

If that’s the case, then maybe they make sense to leave apart. Otherwise, the change looks good.

@gvanrossum
Copy link
Member Author

@gvanrossum
Copy link
Member Author

Mark prefers to keep them separate. We should do a PR to actually eliminate this guard.

@gvanrossum gvanrossum closed this Mar 19, 2024
@gvanrossum gvanrossum deleted the fuse-func-guards branch March 19, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting core review interpreter-core (Objects, Python, Grammar, and Parser dirs) skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants