Commit 8e72ab6d authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Added USE_SIMULATOR macro that explicitly indicates that we wish to use the...

Added USE_SIMULATOR macro that explicitly indicates that we wish to use the simulator as the execution engine. For example, this allows us to run with the ARM simulator on ARM.

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
parent 6c0cde67
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
Google Inc. Google Inc.
Sigma Designs Inc. Sigma Designs Inc.
ARM Ltd. ARM Ltd.
Hewlett-Packard Development Company, LP
Alexander Botero-Lowry <alexbl@FreeBSD.org> Alexander Botero-Lowry <alexbl@FreeBSD.org>
Alexandre Vassalotti <avassalotti@gmail.com> Alexandre Vassalotti <avassalotti@gmail.com>
......
...@@ -206,7 +206,8 @@ LIBRARY_FLAGS = { ...@@ -206,7 +206,8 @@ LIBRARY_FLAGS = {
}, },
'simulator:arm': { 'simulator:arm': {
'CCFLAGS': ['-m32'], 'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32'] 'LINKFLAGS': ['-m32'],
'CPPDEFINES': ['USE_SIMULATOR']
}, },
'arch:mips': { 'arch:mips': {
'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'], 'CPPDEFINES': ['V8_TARGET_ARCH_MIPS'],
...@@ -217,7 +218,8 @@ LIBRARY_FLAGS = { ...@@ -217,7 +218,8 @@ LIBRARY_FLAGS = {
}, },
'simulator:mips': { 'simulator:mips': {
'CCFLAGS': ['-m32'], 'CCFLAGS': ['-m32'],
'LINKFLAGS': ['-m32'] 'LINKFLAGS': ['-m32'],
'CPPDEFINES': ['USE_SIMULATOR']
}, },
'arch:x64': { 'arch:x64': {
'CPPDEFINES': ['V8_TARGET_ARCH_X64'], 'CPPDEFINES': ['V8_TARGET_ARCH_X64'],
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include "arm/constants-arm.h" #include "arm/constants-arm.h"
#include "arm/simulator-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. // Only build the simulator if not compiling for real ARM hardware.
namespace assembler { namespace assembler {
...@@ -2840,6 +2840,6 @@ uintptr_t Simulator::PopAddress() { ...@@ -2840,6 +2840,6 @@ uintptr_t Simulator::PopAddress() {
} } // namespace assembler::arm } } // namespace assembler::arm
#endif // __arm__ #endif // !__arm__ || USE_SIMULATOR
#endif // V8_TARGET_ARCH_ARM #endif // V8_TARGET_ARCH_ARM
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "allocation.h" #include "allocation.h"
#if defined(__arm__) #if defined(__arm__) && !defined(USE_SIMULATOR)
// When running without a simulator we call the entry directly. // When running without a simulator we call the entry directly.
#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
...@@ -70,7 +70,7 @@ class SimulatorStack : public v8::internal::AllStatic { ...@@ -70,7 +70,7 @@ class SimulatorStack : public v8::internal::AllStatic {
reinterpret_cast<TryCatch*>(try_catch_address) 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 // When running with the simulator transition into simulated execution at this
// point. // point.
...@@ -356,6 +356,6 @@ class SimulatorStack : public v8::internal::AllStatic { ...@@ -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_ #endif // V8_ARM_SIMULATOR_ARM_H_
...@@ -2712,6 +2712,7 @@ Handle<Object> Debugger::Call(Handle<JSFunction> fun, ...@@ -2712,6 +2712,7 @@ Handle<Object> Debugger::Call(Handle<JSFunction> fun,
static void StubMessageHandler2(const v8::Debug::Message& message) { static void StubMessageHandler2(const v8::Debug::Message& message) {
PrintF("XXX\n");
// Simply ignore message. // Simply ignore message.
} }
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
namespace v8i = v8::internal; namespace v8i = v8::internal;
#if !defined(__mips) #if !defined(__mips) || defined(USE_SIMULATOR)
// Only build the simulator if not compiling for real MIPS hardware. // Only build the simulator if not compiling for real MIPS hardware.
namespace assembler { namespace assembler {
...@@ -1645,6 +1645,6 @@ uintptr_t Simulator::PopAddress() { ...@@ -1645,6 +1645,6 @@ uintptr_t Simulator::PopAddress() {
} } // namespace assembler::mips } } // namespace assembler::mips
#endif // __mips #endif // !__mips || USE_SIMULATOR
#endif // V8_TARGET_ARCH_MIPS #endif // V8_TARGET_ARCH_MIPS
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
#include "allocation.h" #include "allocation.h"
#if defined(__mips) #if defined(__mips) && !defined(USE_SIMULATOR)
// When running without a simulator we call the entry directly. // When running without a simulator we call the entry directly.
#define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \ #define CALL_GENERATED_CODE(entry, p0, p1, p2, p3, p4) \
...@@ -79,7 +79,7 @@ class SimulatorStack : public v8::internal::AllStatic { ...@@ -79,7 +79,7 @@ class SimulatorStack : public v8::internal::AllStatic {
reinterpret_cast<TryCatch*>(try_catch_address) 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 // When running with the simulator transition into simulated execution at this
// point. // point.
...@@ -305,7 +305,7 @@ class SimulatorStack : public v8::internal::AllStatic { ...@@ -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_ #endif // V8_MIPS_SIMULATOR_MIPS_H_
...@@ -68,7 +68,7 @@ bool V8::Initialize(Deserializer* des) { ...@@ -68,7 +68,7 @@ bool V8::Initialize(Deserializer* des) {
OS::Setup(); OS::Setup();
// Initialize other runtime facilities // 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(); ::assembler::arm::Simulator::Initialize();
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment