]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Get rid of translation chaining stuff from dispatcher.
authorJulian Seward <jseward@acm.org>
Wed, 20 Oct 2004 01:13:44 +0000 (01:13 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 20 Oct 2004 01:13:44 +0000 (01:13 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@377

VEX/head20041019/coregrind/vg_dispatch.S

index 111a160e1b2d19cef045bc29d1e126970ab8accc..2a29ca8f070c820865a27d1117568d72e4f28603 100644 (file)
@@ -120,7 +120,9 @@ dispatch_boring:
        movl    %eax, (%ebp, %esi, 4)
 
        /* Are we out of timeslice?  If yes, defer to scheduler. */
-       cmpl    $0, VG_(dispatch_ctr)
+       /* -------cmpl  $0, VG_(dispatch_ctr) */
+       subl $1, VG_(dispatch_ctr)
+       
        jz      counter_is_zero
        /* try a fast lookup in the translation cache */
        TT_LOOKUP(%ebx, fast_lookup_failed)
@@ -178,44 +180,6 @@ dispatch_exceptional:
        movl    %ebp, %eax
        jmp     run_innerloop_exit
 
-
-/*
-       This is the translation chainer, our run-time linker, if you like.
-
-       VG_(patch_me) patches the call instruction in the jump site
-       with a jump to the generated code for the branch target.  %eax
-       contains the original program's EIP - if we get a hit in
-       tt_fast, then the call is patched into a jump; otherwise it
-       simply drops back into the dispatch loop for normal
-       processing.
-
-       The callsite is expected to look like:
-               call    VG_(patch_me)
-       it will be transformed into
-               jmp     $TARGETADDR
-
-       The environment we're expecting on entry is:
-               %eax    = branch target address (original code EIP)
-               *(%esp) = just after call
-*/
-.globl VG_(patch_me)
-VG_(patch_me):
-       /* try a fast lookup in the translation cache */
-       TT_LOOKUP(%ebx, 1f)
-
-       /* Patch call instruction at callsite into a chained jmp */
-       popl    %eax        /* eax = just after (VG_PATCHME_CALLSZ byte) call */
-       addl    $VG_CODE_OFFSET, %ebx   /* ebx = target eip */
-       subl    %eax, %ebx              /* ebx = delta */
-       movb    $0xE9, -(VG_PATCHME_CALLSZ-0)(%eax)             /* 0xe9 = jmp */
-       movl    %ebx,  -(VG_PATCHME_CALLSZ-1)(%eax)            /* store delta */
-       addl    %eax, %ebx
-       incl    VG_(bb_enchain_count)                         /* update stats */
-       jmp     *%ebx                                          /* jmp to dest */
-
-       /* tt_fast miss: return into main dispatch loop */
-1:     addl    $4, %esp        /* remove our call address */
-       ret                     /* return into main dispatch loop above */
        
 .data
 panic_msg_ebp: