| Index: src/platform-linux.cc
|
| diff --git a/src/platform-linux.cc b/src/platform-linux.cc
|
| index ec48d6305e3de2ea4b51f0571a1c7a83bb0ae619..665ab77691adb47e175a7bd94722f80feb91aa1c 100644
|
| --- a/src/platform-linux.cc
|
| +++ b/src/platform-linux.cc
|
| @@ -284,6 +284,21 @@ bool OS::MipsCpuHasFeature(CpuFeature feature) {
|
| #endif // def __mips__
|
|
|
|
|
| +#ifdef __sh__
|
| +bool OS::SHCpuHasFeature(CpuFeature feature) {
|
| + switch (feature) {
|
| + case FPU:
|
| + // Assume FPU is always active.
|
| + // All supported SH4 implementation feature it
|
| + return true;
|
| + default:
|
| + UNREACHABLE();
|
| + }
|
| + return false;
|
| +}
|
| +#endif // def __sh__
|
| +
|
| +
|
| int OS::ActivationFrameAlignment() {
|
| #ifdef V8_TARGET_ARCH_ARM
|
| // On EABI ARM targets this is required for fp correctness in the
|
| @@ -291,6 +306,8 @@ int OS::ActivationFrameAlignment() {
|
| return 8;
|
| #elif V8_TARGET_ARCH_MIPS
|
| return 8;
|
| +#elif V8_TARGET_ARCH_SH4
|
| + return 4;
|
| #endif
|
| // With gcc 4.4 the tree vectorization optimizer can generate code
|
| // that requires 16 byte alignment such as movdqa on x86.
|
| @@ -409,6 +426,8 @@ void OS::DebugBreak() {
|
| # endif
|
| #elif defined(__mips__)
|
| asm("break");
|
| +#elif defined(__sh__)
|
| + asm("ldtlb");
|
| #else
|
| asm("int $3");
|
| #endif
|
| @@ -1069,9 +1088,13 @@ static void ProfilerSignalHandler(int signal, siginfo_t* info, void* context) {
|
| #endif // defined(__GLIBC__) && !defined(__UCLIBC__) &&
|
| // (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
|
| #elif V8_HOST_ARCH_MIPS
|
| + sample.pc = reinterpret_cast<Address>(mcontext.pc);
|
| + sample.sp = reinterpret_cast<Address>(mcontext.gregs[29]);
|
| + sample.fp = reinterpret_cast<Address>(mcontext.gregs[30]);
|
| +#elif defined(V8_HOST_ARCH_SH4)
|
| sample->pc = reinterpret_cast<Address>(mcontext.pc);
|
| - sample->sp = reinterpret_cast<Address>(mcontext.gregs[29]);
|
| - sample->fp = reinterpret_cast<Address>(mcontext.gregs[30]);
|
| + sample->sp = reinterpret_cast<Address>(mcontext.gregs[R15]);
|
| + sample->fp = reinterpret_cast<Address>(mcontext.gregs[R14]);
|
| #endif // V8_HOST_ARCH_*
|
| sampler->SampleStack(sample);
|
| sampler->Tick(sample);
|
|
|