|
From: Nicholas N. <nj...@ca...> - 2004-01-23 16:30:43
|
Hi,
vg_dispatch.S has this code:
---------------------------
/* Set up the baseBlock pointer */
movl $VG_(baseBlock), %ebp
/* fetch m_eip into %eax */
movl VGOFF_(m_eip), %esi
movl (%ebp, %esi, 4), %eax
dispatch_main:
/* Jump here to do a new dispatch.
%eax holds destination (original) address.
%ebp indicates further details of the control transfer
requested to the address in %eax.
If ebp == & VG_(baseBlock), just jump next to %eax.
If ebp == VG_EBP_JMP_SYSCALL, do a system call before
continuing at eax.
If ebp == VG_EBP_JMP_CLIENTREQ, do a client request before
continuing at eax.
If %ebp has any other value, we panic.
*/
cmpl $VG_(baseBlock), %ebp
jnz dispatch_exceptional
/* fall into main loop */
dispatch_boring:
/* save the jump address at VG_(baseBlock)[VGOFF_(m_eip)] */
movl VGOFF_(m_eip), %esi
movl %eax, (%ebp, %esi, 4)
---------------------------
AFAICT, the entire bit between dispatch_main: and dispatch_boring: can be
removed -- the cmpl and the jnz never occur, because we've just loaded
%ebp with $VG_(baseBlock). I've tried it, it works fine. Maybe the
comment should be moved elsewhere, I'm not sure. I don't think it will
affect performance much, because it's outside the main loop, but still...
N
|