Added USE_SIMULATOR macro that explicitly indicates that we wish to use the simulator...
authorsgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Oct 2010 11:39:48 +0000 (11:39 +0000)
committersgjesse@chromium.org <sgjesse@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 14 Oct 2010 11:39:48 +0000 (11:39 +0000)
Patch by Mark Lam <mark.lam@palm.com> from Hewlett-Packard Development Company, LP

Review URL: http://codereview.chromium.org/3825001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5620 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

AUTHORS
SConstruct
src/arm/simulator-arm.cc
src/arm/simulator-arm.h
src/debug.cc
src/mips/simulator-mips.cc
src/mips/simulator-mips.h
src/v8.cc

diff --git a/AUTHORS b/AUTHORS
index 2403fbb9561c27b1cc1cf8863ceed8918df8663a..3749cebcd1763a9de665448b845cecbee18e8902 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,6 +6,7 @@
 Google Inc.
 Sigma Designs Inc.
 ARM Ltd.
+Hewlett-Packard Development Company, LP
 
 Alexander Botero-Lowry <alexbl@FreeBSD.org>
 Alexandre Vassalotti <avassalotti@gmail.com>
index 2a39583f1c3e27fffc4cbbe920ed68d2443fe49e..e33d2df46905185dcb4592e2a17cb6ae53e34769 100644 (file)
@@ -206,7 +206,8 @@ LIBRARY_FLAGS = {
     },
     'simulator:arm': {
       'CCFLAGS':      ['-m32'],
-      'LINKFLAGS':    ['-m32']
+      'LINKFLAGS':    ['-m32'],
+      'CPPDEFINES':   ['USE_SIMULATOR']
     },
     'arch:mips': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_MIPS'],
@@ -217,7 +218,8 @@ LIBRARY_FLAGS = {
     },
     'simulator:mips': {
       'CCFLAGS':      ['-m32'],
-      'LINKFLAGS':    ['-m32']
+      'LINKFLAGS':    ['-m32'],
+      'CPPDEFINES':   ['USE_SIMULATOR']
     },
     'arch:x64': {
       'CPPDEFINES':   ['V8_TARGET_ARCH_X64'],
index 40be9bb818aa695cf3669d0c779da62e493897bc..84d9d01d08885b24a729330df6503ffd7b7e2744 100644 (file)
@@ -37,7 +37,7 @@
 #include "arm/constants-arm.h"
 #include "arm/simulator-arm.h"
 
-#if !defined(__arm__)
+#if !defined(__arm__) || defined(USE_SIMULATOR)
 
 // Only build the simulator if not compiling for real ARM hardware.
 namespace assembler {
@@ -2840,6 +2840,6 @@ uintptr_t Simulator::PopAddress() {
 
 } }  // namespace assembler::arm
 
-#endif  // __arm__
+#endif  // !__arm__ || USE_SIMULATOR
 
 #endif  // V8_TARGET_ARCH_ARM
index fee296e40e8e56231c7779c9a16c188df79c8164..d4c8250b33aff9af5a64fd04444a1cb46fe75d45 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "allocation.h"
 
-#if defined(__arm__)
+#if defined(__arm__) && !defined(USE_SIMULATOR)
 
 // When running without a simulator we call the entry directly.
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
@@ -70,7 +70,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   reinterpret_cast<TryCatch*>(try_catch_address)
 
 
-#else  // defined(__arm__)
+#else  // !defined(__arm__) || defined(USE_SIMULATOR)
 
 // When running with the simulator transition into simulated execution at this
 // point.
@@ -356,6 +356,6 @@ class SimulatorStack : public v8::internal::AllStatic {
 };
 
 
-#endif  // defined(__arm__)
+#endif  // !defined(__arm__) || defined(USE_SIMULATOR)
 
 #endif  // V8_ARM_SIMULATOR_ARM_H_
index 53773acaf5fa04b16a22a3f731bb632b27369cc8..60d2587172b06b7ab6a0b101f56a8f58d7826a5b 100644 (file)
@@ -2712,6 +2712,7 @@ Handle<Object> Debugger::Call(Handle<JSFunction> fun,
 
 
 static void StubMessageHandler2(const v8::Debug::Message& message) {
+  PrintF("XXX\n");
   // Simply ignore message.
 }
 
index 57bed6a04767ce336b7a7252edd7b3a17c870c07..59a537324f1fc555554e04d0b209392e70cd2b1a 100644 (file)
@@ -39,7 +39,7 @@
 
 namespace v8i = v8::internal;
 
-#if !defined(__mips)
+#if !defined(__mips) || defined(USE_SIMULATOR)
 
 // Only build the simulator if not compiling for real MIPS hardware.
 namespace assembler {
@@ -1645,6 +1645,6 @@ uintptr_t Simulator::PopAddress() {
 
 } }  // namespace assembler::mips
 
-#endif  // __mips
+#endif  // !__mips || USE_SIMULATOR
 
 #endif  // V8_TARGET_ARCH_MIPS
index d5dfc301a89c6bfbbc6c13da6cc8f7a5286d3c17..6e42683a2eb71e68d9458c235d8ae78bf6129aa0 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "allocation.h"
 
-#if defined(__mips)
+#if defined(__mips) && !defined(USE_SIMULATOR)
 
 // When running without a simulator we call the entry directly.
 #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
@@ -79,7 +79,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   reinterpret_cast<TryCatch*>(try_catch_address)
 
 
-#else   // #if defined(__mips)
+#else  // #if !defined(__mips) || defined(USE_SIMULATOR)
 
 // When running with the simulator transition into simulated execution at this
 // point.
@@ -305,7 +305,7 @@ class SimulatorStack : public v8::internal::AllStatic {
   }
 };
 
-#endif  // defined(__mips)
+#endif  // !defined(__mips) || defined(USE_SIMULATOR)
 
 #endif  // V8_MIPS_SIMULATOR_MIPS_H_
 
index 23139670c3e58f55facc4fc3efdd5a1baf24c44b..b30564a391a30ec16e36573440785897a551cbaa 100644 (file)
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -68,7 +68,7 @@ bool V8::Initialize(Deserializer* des) {
   OS::Setup();
 
   // Initialize other runtime facilities
-#if !V8_HOST_ARCH_ARM && V8_TARGET_ARCH_ARM
+#if (defined(USE_SIMULATOR) || !V8_HOST_ARCH_ARM) && V8_TARGET_ARCH_ARM
   ::assembler::arm::Simulator::Initialize();
 #endif