On Sat, Nov 23, 2013 at 07:00:51PM +0100, Andreas Färber wrote:
> Am 22.11.2013 17:02, schrieb Edgar E. Iglesias:
> > Hi, no I actually had it in cpustate first but had to do env-get-cpu all
> > over so i moved it to env. Iiuc env-get-cpu involves a dyn typecheck.
>
> No, it doesn't any more, it's just a pointer offset.
>
Hi Andreas,
Looking at todays master, for example for i386:
target-i386/cpu-qom.h:
#define ENV_GET_CPU(e) CPU(x86_env_get_cpu(e))
include/qom/cpu.h:
#define CPU(obj) OBJECT_CHECK(CPUState, (obj), TYPE_CPU)
include/qom/object.h:
#define OBJECT_CHECK(type, obj, name) \
((type *)object_dynamic_cast_assert(OBJECT(obj), (name), \
__FILE__, __LINE__, __func__))
Maybe we should remove the CPU() around xx_env_get_cpu(e)?
I'm happy to move the cpu address space into CPUState, but right
now I'm afraid ENV_GET_CPU will slow down some of these hot paths.
Cheers,
Edgar