Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: src/platform-linux.cc

Issue 11275184: First draft of the sh4 port Base URL: http://github.com/v8/v8.git@master
Patch Set: Use GYP and fixe some typos Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform.h ('k') | src/platform-posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/platform.h ('k') | src/platform-posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698