Adjustor thunks and variadic arguments.

Iain Buclaw via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 9 05:38:13 PDT 2015


On 9 April 2015 at 13:20, Daniel Murphy via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> "Iain Buclaw via Digitalmars-d"  wrote in message
> news:mailman.1364.1428563414.3111.digitalmars-d at puremagic.com...
>
>> If under the same object file, you can happily emit:
>>
>> sub    offset, %thisreg
>> jmp    method
>>
>> But if doing separate compilation, many targets to not support doing
>> such operations across section boundaries.  So a more general/agnostic
>> way to go about it is by copying all arguments, adjusting the 'this'
>> pointer and calling target method at the codegen level.  This works so
>> long as you are not dealing with a variadic method (ie:
>> std.stream.Stream.printf)
>
>
> They don't support jumping across section boundaries?  But they do support
> calling?
>
> Anyway it sounds like
>
> sub offset, %thisreg
> call method
> ret
>
> would do it

That's not copying arguments. :-)

Iain.


More information about the Digitalmars-d mailing list