From: ager@chromium.org Date: Tue, 26 Oct 2010 08:12:17 +0000 (+0000) Subject: Allow forcing the use of a simulator from the build script X-Git-Tag: upstream/4.7.83~21037 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9640b6d9abff7a254eb27c9462e5e528789c5759;p=platform%2Fupstream%2Fv8.git Allow forcing the use of a simulator from the build script independently of the host architecture. Fix build issue for the mips simulator. The mips simulator does not currently work, but at least this change does not make it worse. Review URL: http://codereview.chromium.org/4090003 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5701 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/globals.h b/src/globals.h index ee9ddac..6f9db3b 100644 --- a/src/globals.h +++ b/src/globals.h @@ -94,12 +94,16 @@ namespace internal { #endif // Determine whether we are running in a simulated environment. +// Setting USE_SIMULATOR explicitly from the build script will force +// the use of a simulated environment. +#if !defined(USE_SIMULATOR) #if (defined(V8_TARGET_ARCH_ARM) && !defined(V8_HOST_ARCH_ARM)) #define USE_SIMULATOR 1 #endif #if (defined(V8_TARGET_ARCH_MIPS) && !defined(V8_HOST_ARCH_MIPS)) #define USE_SIMULATOR 1 #endif +#endif // Define unaligned read for the target architectures supporting it. #if defined(V8_TARGET_ARCH_X64) || defined(V8_TARGET_ARCH_IA32) diff --git a/src/top.cc b/src/top.cc index 6ba45ab..1f0d159 100644 --- a/src/top.cc +++ b/src/top.cc @@ -67,8 +67,12 @@ void ThreadLocalTop::Initialize() { c_entry_fp_ = 0; handler_ = 0; #ifdef USE_SIMULATOR +#ifdef V8_TARGET_ARCH_ARM simulator_ = assembler::arm::Simulator::current(); -#endif // USE_SIMULATOR +#elif V8_TARGET_ARCH_MIPS + simulator_ = assembler::mips::Simulator::current(); +#endif +#endif #ifdef ENABLE_LOGGING_AND_PROFILING js_entry_sp_ = 0; #endif @@ -1066,7 +1070,11 @@ char* Top::RestoreThread(char* from) { // This might be just paranoia, but it seems to be needed in case a // thread_local_ is restored on a separate OS thread. #ifdef USE_SIMULATOR +#ifdef V8_TARGET_ARCH_ARM thread_local_.simulator_ = assembler::arm::Simulator::current(); +#elif V8_TARGET_ARCH_MIPS + thread_local_.simulator_ = assembler::mips::Simulator::current(); +#endif #endif return from + sizeof(thread_local_); } diff --git a/src/v8.cc b/src/v8.cc index e492de8..0623400 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -69,7 +69,11 @@ bool V8::Initialize(Deserializer* des) { // Initialize other runtime facilities #if defined(USE_SIMULATOR) +#if defined(V8_TARGET_ARCH_ARM) ::assembler::arm::Simulator::Initialize(); +#elif defined(V8_TARGET_ARCH_MIPS) + ::assembler::mips::Simulator::Initialize(); +#endif #endif { // NOLINT