VirtualBox

Changeset 16396 in vbox for trunk/src/libs/xpcom18a4/xpcom


Ignore:
Timestamp:
Jan 29, 2009 11:38:53 PM (16 years ago)
Author:
vboxsync
Message:

XPCOM-darwin/amd64: Shot at the xptcall fun.

Location:
trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix
Files:
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcstubs_amd64_darwin.cpp

    r16389 r16396  
    5656// - 'gpregs[]' contains the arguments passed in integer registers
    5757// - 'fpregs[]' contains the arguments passed in floating point registers
    58 // 
     58//
    5959// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
    6060// and then the method gets called.
     
    105105        const nsXPTType& type = param.GetType();
    106106        nsXPTCMiniVariant* dp = &dispatchParams[i];
    107        
     107
    108108        if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
    109109            if (nr_fpr < FPR_COUNT)
     
    165165
    166166#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
    167 // Linux/x86-64 uses gcc >= 3.1
     167// Darwin/AMD64 uses gcc >= 3.1
    168168#define STUB_ENTRY(n) \
    169 asm(".section   \".text\"\n\t" \
     169asm(".text\n\t" \
    170170    ".align     2\n\t" \
    171171    ".if        " #n " < 10\n\t" \
    172     ".globl     _ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
    173     ".type      _ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
    174     "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
     172    ".globl     __ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     173    /*".type    __ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n"*/ \
     174    "__ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
    175175    ".elseif    " #n " < 100\n\t" \
    176     ".globl     _ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
    177     ".type      _ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
    178     "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
     176    ".globl     __ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
     177    /*".type    __ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n"*/ \
     178    "__ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
    179179    ".elseif    " #n " < 1000\n\t" \
    180     ".globl     _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
    181     ".type      _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
    182     "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
     180    ".globl     __ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
     181    /*".type      __ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n"*/ \
     182    "__ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
    183183    ".else\n\t" \
    184184    ".err       \"stub number " #n " >= 1000 not yet supported\"\n\t" \
     
    187187    "jmp        SharedStub\n\t" \
    188188    ".if        " #n " < 10\n\t" \
    189     ".size      _ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
     189    /*".size    __ZN14nsXPTCStubBase5Stub" #n "Ev,.-__ZN14nsXPTCStubBase5Stub" #n "Ev\n\t"*/ \
    190190    ".elseif    " #n " < 100\n\t" \
    191     ".size      _ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
     191    /*".size    __ZN14nsXPTCStubBase6Stub" #n "Ev,.-__ZN14nsXPTCStubBase6Stub" #n "Ev\n\t"*/ \
    192192    ".else\n\t" \
    193     ".size      _ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
     193    /*".size    __ZN14nsXPTCStubBase7Stub" #n "Ev,.-__ZN14nsXPTCStubBase7Stub" #n "Ev\n\t"*/ \
    194194    ".endif");
    195195
    196 // static nsresult SharedStub(PRUint32 methodIndex)
    197 asm(".section   \".text\"\n\t"
     196// static nsresult SharedStub(PRUint32 methodIndex) [methodIndex is in eax].
     197asm(".text\n\t"
    198198    ".align     2\n\t"
    199     ".type      SharedStub,@function\n\t"
     199/*    ".type      SharedStub,@function\n\t" */
    200200    "SharedStub:\n\t"
    201201    // make room for gpregs (48), fpregs (64)
     
    224224    "movl       %eax,%esi\n\t"
    225225    "leaq       16(%rbp),%rdx\n\t"
    226     "call       PrepareAndDispatch@plt\n\t"
     226    "call       _PrepareAndDispatch\n\t"
    227227    "leave\n\t"
    228228    "ret\n\t"
    229     ".size      SharedStub,.-SharedStub");
     229/*   ".size      SharedStub,.-SharedStub" */
     230    );
    230231
    231232#define SENTINEL_ENTRY(n) \
     
    239240
    240241#else
    241 #error "Unsupported compiler. Use gcc >= 3.1 for Linux/x86-64."
     242#error "Unsupported compiler. Use gcc >= 3.1 for Darwin/AMD64."
    242243#endif /* __GNUC__ */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette