Okay I have an idea.
I can't shake the idea you could do fun tricks with thread local executable 
pages.

The theoretically fastest way of safepoint polling is inserting a trap 
instruction. But icache overheads dominate. If the icache is based on physical 
addresses and not virtual ones then it should be possible to remap the page 
without doing icache synchronization.
You should be able to have very fast safepoints by remapping the page.

But I'm not sure there's a fast way to do a call/return from thread local 
storage. And a call/return from a constant page still might not be faster than 
just a load.

TLDR:
Limited self modifying code without icache syncing stuff could be possible with 
memory management tricks as long as the icache and other stuff is based on 
physical addresses.

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/mechanical-sympathy/bcc3cf00-4074-4f69-b6a2-95ac9174ab0d%40googlegroups.com.

Reply via email to