This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v4][C][ADA] use function descriptors instead of trampolines in C


On Wed, Dec 19, 2018 at 07:53:48PM +0000, Uecker, Martin wrote:
> What do you think about making the trampoline a single call
> instruction and have a large memory region which is the same
> page mapped many times?
> 
> 
> call trampoline_handler
> call trampoline_handler
> call trampoline_handler
> ...
> ...
> many identical read-only pages
> ...
> ...
> 
> 
> The trampoline handler would pop the instruction pointer and use
> this as an index into the real stack to read the static chain and
> function pointer.

While you save a few bytes per trampoline that way, it is heavily call-ret
stack unfriendly, so it will not be very fast.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]