VirtualBox

Changeset 86277 in vbox for trunk/src/libs


Ignore:
Timestamp:
Sep 24, 2020 8:13:22 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140553
Message:

xpcom/reflect: Shrunk the 'fast' code. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_amd64_vbox.asm

    r86272 r86277  
    101101        ; case goes to generic (slow) code path.
    102102        ;
    103         cmp     r12d, 1
    104         je      .fast_1
    105         cmp     r12d, 2
    106         je      .fast_2
    107         cmp     r12d, 3
    108         je      .fast_3
    109         cmp     r12d, 4
    110         je      .fast_4
    111         cmp     r12d, 0
    112         je      .fast_0
    113         cmp     r12d, 5
    114         je      .fast_5
    115         jmp     .slow
    116         times 0x17 int3  ; manually align the 'ret' instruction on the last cacheline byte and fast_1 on the first.
     103        dec     edx                     ; we can still use edx for the parameter count here as a throwaway.
     104        jz      .fast_1
     105        dec     edx
     106        jz      .fast_2
     107        dec     edx
     108        jz      .fast_3
     109        dec     edx
     110        jz      .fast_4
     111        dec     edx
     112        jnz     .slow_or_zero
    117113%macro fast_case 4
    118114%1:
    119         test    byte [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.flags], PTR_IS_DATA
     115        mov     eax, [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.type] ; ASSUMES 'type' and 'flags' are adjacent byte fields.
     116        test    ah, PTR_IS_DATA
    120117        mov     %4,  [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.ptr]
    121118        jnz     %2
     119        sub     al, T_FLOAT
     120        sub     al, 2
     121        je      .fast_bailout
    122122        mov     %4,  [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.val]
    123         cmp     byte [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.flags], T_FLOAT
    124         je      .fast_bailout
    125         cmp     byte [rbx + nsXPTCVariant_size * %3 + nsXPTCVariant.flags], T_DOUBLE
    126         je      .fast_bailout
    127123%endmacro
    128124        fast_case .fast_5, .fast_4, 4, r9
     
    145141        ret
    146142
     143.slow_or_zero:
     144        cmp     r12d, 0
     145        je      .fast_0
     146 %if 0
     147        jmp     .slow
    147148.fast_bailout:
    148 ;        int3
     149        int3
     150 %else
     151.fast_bailout:
     152 %endif
    149153.slow:
    150154%endif
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