Back to index

lightning-sunbird  0.9+nobinonly
Functions
xptcinvoke_openvms_alpha.cpp File Reference
#include "xptcprivate.h"

Go to the source code of this file.

Functions

 XPTC_InvokeByIndex (nsISupports *that, PRUint32 methodIndex, PRUint32 paramCount, nsXPTCVariant *params)
void invoke_copy_to_stack (PRUint64 *d, PRUint32 paramCount, nsXPTCVariant *s)

Function Documentation

PRUint64 invoke_copy_to_stack ( PRUint64 d,
PRUint32  paramCount,
nsXPTCVariant s 
)

Definition at line 51 of file xptcinvoke_openvms_alpha.cpp.

{
    const PRUint8 NUM_ARG_REGS = 6-1;        // -1 for "this" pointer

    for(PRUint32 i = 0; i < paramCount; i++, d++, s++)
    {
        if(s->IsPtrData())
        {
            *d = (PRUint64)s->ptr;
            continue;
        }
        switch(s->type)
        {
       /*
       ** The line for T_U32 may look wrong (we use signed value for an
       ** unsigned data type), but it is right. Why? The Alpha calling 
       ** standard is defined to sign extend all 32-bit values, regardless
       ** of whether they are int, unsigned int, or 32-bit pointer. The 
       ** caller must "sign-extend" it by replicating bit 31 in bits 32
       ** thru 63 (yes, even for unsigned). This is the format that results
       ** naturally from the LDL instruction, the ADDL instruction, etc.
       */
        case nsXPTType::T_I8     : *d = (PRUint64)s->val.i8;     break;
        case nsXPTType::T_I16    : *d = (PRUint64)s->val.i16;    break;
        case nsXPTType::T_I32    : *d = (PRUint64)s->val.i32;    break;
        case nsXPTType::T_I64    : *d = (PRUint64)s->val.i64;    break;
        case nsXPTType::T_U8     : *d = (PRUint64)s->val.u8;     break;
        case nsXPTType::T_U16    : *d = (PRUint64)s->val.u16;    break;
        case nsXPTType::T_U32    : *d = (PRUint64)s->val.i32;    break;
        case nsXPTType::T_U64    : *d = (PRUint64)s->val.u64;    break;
        case nsXPTType::T_FLOAT  :
            if(i < NUM_ARG_REGS)
            {
                // convert floats to doubles if they are to be passed
                // via registers so we can just deal with doubles later
                union { PRUint64 u64; double d; } t;
                t.d = (double)s->val.f;
                *d = t.u64;
            }
            else
                // otherwise copy to stack normally
                *d = (PRUint64)s->val.u32;
            break;
        case nsXPTType::T_DOUBLE : *d = (PRUint64)s->val.u64;    break;
        case nsXPTType::T_BOOL   : *d = (PRUint64)s->val.b;      break;
        case nsXPTType::T_CHAR   : *d = (PRUint64)s->val.c;      break;
        case nsXPTType::T_WCHAR  : *d = (PRUint64)s->val.wc;     break;
        default:
            // all the others are plain pointer types
            *d = (PRUint64)s->val.p;
            break;
        }
    }
}
XPTC_InvokeByIndex ( nsISupports *  that,
PRUint32  methodIndex,
PRUint32  paramCount,
nsXPTCVariant params 
)

Definition at line 142 of file xptcinvoke_mac.cpp.

{
    return _XPTC_InvokeByIndex(that, methodIndex, paramCount, params);
}