Skip to content

keep callees of plain callers plain - #37

Open
dougchansan wants to merge 1 commit into
ExpansionPak:mainfrom
dougchansan:fix/plain-caller-targets
Open

dougchansan wants to merge 1 commit into
ExpansionPak:mainfrom
dougchansan:fix/plain-caller-targets

Conversation

@dougchansan

Copy link
Copy Markdown
Contributor

with function-aligned ranges, small leaves like OSDisableInterrupts / OSRestoreInterrupts become native while their callers stay plain. on x86 a plain caller can't call a native range directly (branch_targets.cpp, cold_escapes_), so every call exits through the runner. pokemon colosseum's main thread loop calls both every iteration.

this demotes native callees of plain callers to a fixpoint, right after the abi policy runs. recompcore runtime only; moderngekko is untouched.

frames in 20s, on top of #35:

#35 only with this c
colosseum clean-field2 447 746 790
mkdd race 1115 1208 1066
luigi's mansion foyer 763 933 565
skyward sword gameplay (avg of 4) 836 858 822

tests pass locally apart from modern_memory_service, which already fails on windows.

@dougchansan
dougchansan force-pushed the fix/plain-caller-targets branch from 275b7d6 to 54e0473 Compare October 10, 2026 19:11
on x86 a plain caller can't call a native range directly, so each call
exits through the runner. function-aligned ranges make small leaves like
OSDisableInterrupts native while their callers stay plain, so hot loops
paid a dispatcher round trip per call. demote those callees after the abi
policy runs. recompcore runtime only.
@dougchansan
dougchansan force-pushed the fix/plain-caller-targets branch from 54e0473 to 8582d0b Compare October 10, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant