www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2384] New: abi spec is unclear on parameter passing

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2384

           Summary: abi spec is unclear on parameter passing
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: tomas famolsen.dk


the spec says the last parameter is passed in EAX, from just reading the spec
it's unclear (to me) what counts as the last parameter.

for example, the 'this' pointer is not passed in EAX even though it's the last
thing passed and does fit in EAX


-- 
Oct 01 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2384


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME





'this' is passed last, and in the EAX register. For example,

class A
{
    int x;
    void foo() { x = 3; }
}

results in:

_D5test51A3fooMFZv      comdat
        assume  CS:_D5test51A3fooMFZv
                mov     dword ptr 8[EAX],3
                ret
_D5test51A3fooMFZv      ends


-- 
Oct 02 2008