Index: arm/constants-arm.h
|
===================================================================
|
--- arm/constants-arm.h (revision 7851)
|
+++ arm/constants-arm.h (working copy)
|
@@ -29,7 +29,7 @@
|
#define V8_ARM_CONSTANTS_ARM_H_
|
|
// ARM EABI is required.
|
-#if defined(__arm__) && !defined(__ARM_EABI__)
|
+#if defined(__arm__) && !defined(__APPLE__) && !defined(__ARM_EABI__)
|
#error ARM EABI support is required.
|
#endif
|
|
Index: arm/cpu-arm.cc
|
===================================================================
|
--- arm/cpu-arm.cc (revision 7851)
|
+++ arm/cpu-arm.cc (working copy)
|
@@ -38,6 +38,10 @@
|
#include "macro-assembler.h"
|
#include "simulator.h" // for cache flushing.
|
|
+#ifdef __APPLE__
|
+#include <libkern/OSCacheControl.h>
|
+#endif
|
+
|
namespace v8 {
|
namespace internal {
|
|
@@ -64,6 +68,8 @@
|
// None of this code ends up in the snapshot so there are no issues
|
// around whether or not to generate the code when building snapshots.
|
Simulator::FlushICache(Isolate::Current()->simulator_i_cache(), start, size);
|
+#elif defined (__APPLE__)
|
+ sys_icache_invalidate(start, size);
|
#else
|
// Ideally, we would call
|
// syscall(__ARM_NR_cacheflush, start,
|
Index: atomicops.h
|
===================================================================
|
--- atomicops.h (revision 7851)
|
+++ atomicops.h (working copy)
|
@@ -151,7 +151,7 @@
|
(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
#include "atomicops_internals_x86_msvc.h"
|
#elif defined(__APPLE__) && \
|
- (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
+ (defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64) || defined(V8_HOST_ARCH_ARM))
|
#include "atomicops_internals_x86_macosx.h"
|
#elif defined(__GNUC__) && \
|
(defined(V8_HOST_ARCH_IA32) || defined(V8_HOST_ARCH_X64))
|
Index: objects-visiting.h
|
===================================================================
|
--- objects-visiting.h (revision 7851)
|
+++ objects-visiting.h (working copy)
|
@@ -148,7 +148,13 @@
|
// every element of callbacks_ array will remain correct
|
// pointer (memcpy might be implemented as a byte copying loop).
|
for (int i = 0; i < StaticVisitorBase::kVisitorIdCount; i++) {
|
- NoBarrier_Store(&callbacks_[i], other->callbacks_[i]);
|
+ NoBarrier_Store(reinterpret_cast<
|
+#ifdef V8_HOST_ARCH_64_BIT
|
+ Atomic64 *
|
+#else
|
+ Atomic32 *
|
+#endif
|
+ >(&callbacks_[i]), other->callbacks_[i]);
|
}
|
}
|
|
Index: platform-macos.cc
|
===================================================================
|
--- platform-macos.cc (revision 7851)
|
+++ platform-macos.cc (working copy)
|
@@ -195,7 +195,11 @@
|
|
|
void OS::DebugBreak() {
|
+#ifdef V8_HOST_ARCH_ARM
|
+ asm("bkpt");
|
+#else
|
asm("int $3");
|
+#endif
|
}
|
|
|
@@ -285,7 +289,22 @@
|
return (one << SSE2) | (one << CMOV) | (one << RDTSC) | (one << CPUID);
|
}
|
|
+#ifdef V8_HOST_ARCH_ARM
|
|
+bool OS::ArmCpuHasFeature(CpuFeature feature) {
|
+ switch (feature) {
|
+ case VFP3:
|
+ case ARMv7:
|
+ return true;
|
+ default:
|
+ UNREACHABLE();
|
+ }
|
+
|
+ return false;
|
+}
|
+
|
+#endif
|
+
|
int OS::ActivationFrameAlignment() {
|
// OS X activation frames must be 16 byte-aligned; see "Mac OS X ABI
|
// Function Call Guide".
|
@@ -761,7 +780,16 @@
|
#else
|
#define REGISTER_FIELD(name) e ## name
|
#endif // __DARWIN_UNIX03
|
+#elif V8_HOST_ARCH_ARM
|
+ thread_state_flavor_t flavor = ARM_THREAD_STATE;
|
+ arm_thread_state_t state;
|
+ mach_msg_type_number_t count = ARM_THREAD_STATE_COUNT;
|
+#if __DARWIN_UNIX03
|
+#define REGISTER_FIELD(name) __ ## name
|
#else
|
+#define REGISTER_FIELD(name) name
|
+#endif // __DARWIN_UNIX03
|
+#else
|
#error Unsupported Mac OS X host architecture.
|
#endif // V8_HOST_ARCH
|
|
@@ -770,9 +798,15 @@
|
reinterpret_cast<natural_t*>(&state),
|
&count) == KERN_SUCCESS) {
|
sample->state = sampler->isolate()->current_vm_state();
|
+#if V8_HOST_ARCH_ARM
|
+ sample->pc = reinterpret_cast<Address>(state.REGISTER_FIELD(pc));
|
+ sample->sp = reinterpret_cast<Address>(state.REGISTER_FIELD(sp));
|
+ sample->fp = reinterpret_cast<Address>(state.REGISTER_FIELD(r[7]));
|
+#else
|
sample->pc = reinterpret_cast<Address>(state.REGISTER_FIELD(ip));
|
sample->sp = reinterpret_cast<Address>(state.REGISTER_FIELD(sp));
|
sample->fp = reinterpret_cast<Address>(state.REGISTER_FIELD(bp));
|
+#endif
|
sampler->SampleStack(sample);
|
sampler->Tick(sample);
|
}
|