cpu: Drop unnecessary dynamic casts in *_env_get_cpu()
commit6e42be7cd10260fd3a006d94f6c870692bf7a2c0
authorAndreas Färber <afaerber@suse.de>
Fri, 10 May 2013 14:34:06 +0000 (10 16:34 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 9 Jul 2013 19:20:28 +0000 (9 21:20 +0200)
tree75a590145a887c9d8424fd100d23e985ce2338ae
parent6291ad77d7c57dfc52a6a938d1a77ec3ec3ad16c
cpu: Drop unnecessary dynamic casts in *_env_get_cpu()

A transition from CPUFooState to FooCPU can be considered safe,
just like FooCPU::env access in the opposite direction.
The only benefit of the FOO_CPU() casts would be protection against
bogus CPUFooState pointers, but then surrounding code would likely
break, too.

This should slightly improve interrupt etc. performance when going from
CPUFooState to FooCPU.
For any additional CPU() casts see 3556c233d931ad5ffa46a35cb25cfc057732ebb8
(qom: allow turning cast debugging off).

Reported-by: Anthony Liguori <aliguori@us.ibm.com>
Acked-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Andreas Färber <afaerber@suse.de>
16 files changed:
target-alpha/cpu-qom.h
target-arm/cpu-qom.h
target-cris/cpu-qom.h
target-i386/cpu-qom.h
target-lm32/cpu-qom.h
target-m68k/cpu-qom.h
target-microblaze/cpu-qom.h
target-mips/cpu-qom.h
target-moxie/cpu.h
target-openrisc/cpu.h
target-ppc/cpu-qom.h
target-s390x/cpu-qom.h
target-sh4/cpu-qom.h
target-sparc/cpu-qom.h
target-unicore32/cpu-qom.h
target-xtensa/cpu-qom.h