/[dotgnu-pnet]/pnet/libffi/src/x86/win32.S
ViewVC logotype

Diff of /pnet/libffi/src/x86/win32.S

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by ktreichel, Sat Jul 30 19:00:15 2005 UTC revision 1.6 by ktreichel, Wed Aug 17 19:27:01 2005 UTC
# Line 257  sc_epilogue: Line 257  sc_epilogue:
257          ret          ret
258    
259  .ffi_call_STDCALL_end:  .ffi_call_STDCALL_end:
260    
261            .globl _ffi_closure_SYSV
262    _ffi_closure_SYSV:
263            pushl   %ebp
264            movl    %esp, %ebp
265            subl    $40, %esp
266            leal    -24(%ebp), %edx
267            movl    %edx, -12(%ebp) /* resp */
268            leal    8(%ebp), %edx
269            movl    %edx, 4(%esp)   /* args = __builtin_dwarf_cfa () */
270            leal    -12(%ebp), %edx
271            movl    %edx, (%esp)    /* &resp */
272            call    _ffi_closure_SYSV_inner
273            movl    -12(%ebp), %ecx
274            cmpl    $FFI_TYPE_INT, %eax
275            je      .Lcls_retint
276            cmpl    $FFI_TYPE_FLOAT, %eax
277            je      .Lcls_retfloat
278            cmpl    $FFI_TYPE_DOUBLE, %eax
279            je      .Lcls_retdouble
280            cmpl    $FFI_TYPE_LONGDOUBLE, %eax
281            je      .Lcls_retldouble
282            cmpl    $FFI_TYPE_SINT64, %eax
283            je      .Lcls_retllong
284            cmpl    $FFI_TYPE_SINT8, %eax   /* 1-byte struct */
285            je      .Lcls_retstruct1
286            cmpl    $FFI_TYPE_SINT16, %eax  /* 2-bytes struct */
287            je      .Lcls_retstruct2
288    .Lcls_epilogue:
289            movl    %ebp, %esp
290            popl    %ebp
291            ret
292    .Lcls_retint:
293            movl    (%ecx), %eax
294            jmp     .Lcls_epilogue
295    .Lcls_retfloat:
296            flds    (%ecx)
297            jmp     .Lcls_epilogue
298    .Lcls_retdouble:
299            fldl    (%ecx)
300            jmp     .Lcls_epilogue
301    .Lcls_retldouble:
302            fldt    (%ecx)
303            jmp     .Lcls_epilogue
304    .Lcls_retllong:
305            movl    (%ecx), %eax
306            movl    4(%ecx), %edx
307            jmp     .Lcls_epilogue
308    .Lcls_retstruct1:
309            movsbl  (%ecx), %eax
310            jmp     .Lcls_epilogue
311    .Lcls_retstruct2:
312            movswl  (%ecx), %eax
313            jmp     .Lcls_epilogue
314    .ffi_closure_SYSV_end:
315    
316    #if !FFI_NO_RAW_API
317    
318    #define RAW_CLOSURE_CIF_OFFSET ((FFI_TRAMPOLINE_SIZE + 3) & ~3)
319    #define RAW_CLOSURE_FUN_OFFSET (RAW_CLOSURE_CIF_OFFSET + 4)
320    #define RAW_CLOSURE_USER_DATA_OFFSET (RAW_CLOSURE_FUN_OFFSET + 4)
321    #define CIF_FLAGS_OFFSET 20
322    
323            .balign 16
324            .globl _ffi_closure_raw_SYSV
325    _ffi_closure_raw_SYSV:
326            pushl   %ebp
327            movl    %esp, %ebp
328            pushl   %esi
329            subl    $36, %esp
330            movl    RAW_CLOSURE_CIF_OFFSET(%eax), %esi       /* closure->cif */
331            movl    RAW_CLOSURE_USER_DATA_OFFSET(%eax), %edx /* closure->user_data */
332            movl    %edx, 12(%esp)  /* user_data */
333            leal    8(%ebp), %edx   /* __builtin_dwarf_cfa () */
334            movl    %edx, 8(%esp)   /* raw_args */
335            leal    -24(%ebp), %edx
336            movl    %edx, 4(%esp)   /* &res */
337            movl    %esi, (%esp)    /* cif */
338            call    *RAW_CLOSURE_FUN_OFFSET(%eax)            /* closure->fun */
339            movl    CIF_FLAGS_OFFSET(%esi), %eax             /* rtype */
340            cmpl    $FFI_TYPE_INT, %eax
341            je      .Lrcls_retint
342            cmpl    $FFI_TYPE_FLOAT, %eax
343            je      .Lrcls_retfloat
344            cmpl    $FFI_TYPE_DOUBLE, %eax
345            je      .Lrcls_retdouble
346            cmpl    $FFI_TYPE_LONGDOUBLE, %eax
347            je      .Lrcls_retldouble
348            cmpl    $FFI_TYPE_SINT64, %eax
349            je      .Lrcls_retllong
350    .Lrcls_epilogue:
351            addl    $36, %esp
352            popl    %esi
353            popl    %ebp
354            ret
355    .Lrcls_retint:
356            movl    -24(%ebp), %eax
357            jmp     .Lrcls_epilogue
358    .Lrcls_retfloat:
359            flds    -24(%ebp)
360            jmp     .Lrcls_epilogue
361    .Lrcls_retdouble:
362            fldl    -24(%ebp)
363            jmp     .Lrcls_epilogue
364    .Lrcls_retldouble:
365            fldt    -24(%ebp)
366            jmp     .Lrcls_epilogue
367    .Lrcls_retllong:
368            movl    -24(%ebp), %eax
369            movl    -20(%ebp), %edx
370            jmp     .Lrcls_epilogue
371    .ffi_closure_raw_SYSV_end:
372    
373    #endif

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26