Surfing on wave.. WASM

Sebastiaan Koppe mail at skoppe.eu
Tue May 28 19:13:05 UTC 2019


On Tuesday, 28 May 2019 at 18:54:24 UTC, kinke wrote:
> On Tuesday, 28 May 2019 at 18:19:14 UTC, Sebastiaan Koppe wrote:
>> Somehow LLVM expands array arguments into two u32's. Dunno why.
>
> It's analogous to the other target ABIs - pointer-sized length 
> and pointer are passed as 2 separate arguments, usually in 2 
> registers.

Makes sense.

>> And for return types it adds an u32 as first argument (on the 
>> js side) that points to the return value on the stack. Pretty 
>> rad.
>
> If the return type is a struct or static array, yes. This is 
> the behaviour of LDC's UnknownTargetABI [1], which is currently 
> selected for wasm targets.

Ok, cool. I like it. I suppose it'll stay unknown for now?


More information about the Digitalmars-d mailing list