File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed
Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -497,47 +497,54 @@ procedure TEvent.InvokeEventHandlerStub;
497497{ $ELSE}
498498asm
499499 // check DisabledFlag
500- bt [Self ].fRefCount,30
500+ bt [rcx ].fRefCount,30
501501 jc @@return
502502
503- sub rsp,32
504- mov eax,[Self].fMethodInfo.RegisterFlag
503+ // allocate stackframe
504+ push rbp
505+ sub rsp,$20
506+ mov rbp,rsp
507+
508+ mov eax,[rcx].fMethodInfo.RegisterFlag
505509
506510 // first parameter is always pointer
507- mov [rsp+$28 ],rcx
511+ mov [rsp+$30 ],rcx
508512
509513 // second parameter: save rdx or xmm1
510514 test al,2
511515 jnz @@save_xmm1
512- mov [rsp+$30 ],rdx
516+ mov [rsp+$38 ],rdx
513517 jmp @@third
514518@@save_xmm1:
515- movsd [rsp+$30 ],xmm1
519+ movsd [rsp+$38 ],xmm1
516520
517521 // third parameter: save r8 or xmm2
518522@@third:
519523 test al,4
520524 jnz @@save_xmm2
521- mov [rsp+$38 ],r8
525+ mov [rsp+$40 ],r8
522526 jmp @@fourth
523527@@save_xmm2:
524- movsd [rsp+$38 ],xmm2
528+ movsd [rsp+$40 ],xmm2
525529
526530 // fourth parameter: save r9 or xmm3
527531@@fourth:
528532 test al,8
529533 jnz @@save_xmm3
530- mov [rsp+$40 ],r9
534+ mov [rsp+$48 ],r9
531535 jmp @@call
532536@@save_xmm3:
533- movsd [rsp+$40 ],xmm3
537+ movsd [rsp+$48 ],xmm3
534538
535539@@call:
536- lea rdx,[rsp+$28 ] // put stack address into Params
540+ lea rdx,[rsp+$30 ] // put stack address into Params
537541 mov r8d,[rcx].fMethodInfo.StackSize // pass StackSize
538542 call [rcx].fMethodInvoke
539543
540- add rsp,32
544+ // restore stack pointer
545+ lea rsp,[rbp+$20 ]
546+ pop rbp
547+
541548@@return:
542549end ;
543550{ $ENDIF}
You can’t perform that action at this time.
0 commit comments