Revision: 5701
Author: [email protected]
Date: Tue Oct 26 01:12:17 2010
Log: 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
http://code.google.com/p/v8/source/detail?r=5701

Modified:
 /branches/bleeding_edge/src/globals.h
 /branches/bleeding_edge/src/top.cc
 /branches/bleeding_edge/src/v8.cc

=======================================
--- /branches/bleeding_edge/src/globals.h       Mon Oct 25 09:40:41 2010
+++ /branches/bleeding_edge/src/globals.h       Tue Oct 26 01:12:17 2010
@@ -94,12 +94,16 @@
 #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)
=======================================
--- /branches/bleeding_edge/src/top.cc  Mon Oct 25 09:40:41 2010
+++ /branches/bleeding_edge/src/top.cc  Tue Oct 26 01:12:17 2010
@@ -67,8 +67,12 @@
   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 @@
   // 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_);
 }
=======================================
--- /branches/bleeding_edge/src/v8.cc   Mon Oct 25 09:40:41 2010
+++ /branches/bleeding_edge/src/v8.cc   Tue Oct 26 01:12:17 2010
@@ -69,7 +69,11 @@

   // 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

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to