1    /*
2     * Increment profile counter for this trace, and decrement
3     * sample counter.  If sample counter goes below zero, turn
4     * off profiling.
5     *
6     * On entry
7     * (lr-11) is address of pointer to counter.  Note: the counter
8     *    actually exists 10 bytes before the return target, but because
9     *    we are arriving from thumb mode, lr will have its low bit set.
10     */
11     ldr    r0, [lr,#-11]
12     ldr    r1, [rSELF, #offThread_pProfileCountdown]
13     ldr    r2, [r0]                    @ get counter
14     ldr    r3, [r1]                    @ get countdown timer
15     add    r2, #1
16     subs   r2, #1
17     blt    .L${opcode}_disable_profiling
18     str    r2, [r0]
19     str    r3, [r1]
20     bx     lr
21
22.L${opcode}_disable_profiling:
23     mov    r4, lr                     @ preserve lr
24     ldr    r0, .LdvmJitTraceProfilingOff
25     blx    r0
26     bx     r4
27