From 42e1cabc9467a79c56156c5f820a5316b24dc18a Mon Sep 17 00:00:00 2001 From: gbeauche <> Date: Tue, 4 Nov 2003 20:45:46 +0000 Subject: [PATCH] Move variables for compile statistics to powerpc_cpu private data --- SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.cpp | 12 +++--------- SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp | 5 +++++ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.cpp index 70027f11..1d7c7fbb 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.cpp @@ -34,14 +34,6 @@ // Define to gather some compile time statistics #define PROFILE_COMPILE_TIME 1 -#if PROFILE_COMPILE_TIME -#include -static uint32 compile_count = 0; -static clock_t compile_time = 0; -static clock_t emul_start_time = 0; -static clock_t emul_end_time = 0; -#endif - void powerpc_cpu::set_register(int id, any_register const & value) { if (id >= powerpc_registers::GPR(0) && id <= powerpc_registers::GPR(31)) { @@ -244,6 +236,8 @@ void powerpc_cpu::initialize() #endif #if PROFILE_COMPILE_TIME + compile_count = 0; + compile_time = 0; emul_start_time = clock(); #endif } @@ -251,7 +245,7 @@ void powerpc_cpu::initialize() powerpc_cpu::~powerpc_cpu() { #if PROFILE_COMPILE_TIME - emul_end_time = clock(); + clock_t emul_end_time = clock(); const char *type = NULL; #ifndef PPC_NO_DECODE_CACHE diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp index 475872c3..d4689aa2 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-cpu.hpp @@ -162,6 +162,11 @@ protected: private: + // Compile time statistics + uint32 compile_count; + clock_t compile_time; + clock_t emul_start_time; + // Flight recorder data static const int LOG_SIZE = 32768; #if PPC_FLIGHT_RECORDER