Index: src/base/platform/platform-posix.cc |
diff --git a/src/base/platform/platform-posix.cc b/src/base/platform/platform-posix.cc |
index 046dbb69c30f03f50a70d81114f60fd58173bb80..7e985e3fb70bc68bcc3c16789db9179dac7d298c 100644 |
--- a/src/base/platform/platform-posix.cc |
+++ b/src/base/platform/platform-posix.cc |
@@ -81,6 +81,8 @@ int OS::ActivationFrameAlignment() { |
return 8; |
#elif V8_TARGET_ARCH_MIPS |
return 8; |
+#elif V8_TARGET_ARCH_S390 |
+ return 8; |
#else |
// Otherwise we just assume 16 byte alignment, i.e.: |
// - With gcc 4.4 the tree vectorization optimizer can generate code |
@@ -185,6 +187,15 @@ void* OS::GetRandomMmapAddr() { |
// Little-endian Linux: 48 bits of virtual addressing. |
raw_addr &= V8_UINT64_C(0x3ffffffff000); |
#endif |
+#elif V8_TARGET_ARCH_S390X |
+ // Linux on Z uses bits 22-32 for Region Indexing, which translates to 42 bits |
+ // of virtual addressing. Truncate to 40 bits to allow kernel chance to |
+ // fulfill request. |
+ raw_addr &= V8_UINT64_C(0xfffffff000); |
+#elif V8_TARGET_ARCH_S390 |
+ // 31 bits of virtual addressing. Truncate to 29 bits to allow kernel chance |
+ // to fulfill request. |
+ raw_addr &= 0x1ffff000; |
#else |
raw_addr &= 0x3ffff000; |
@@ -252,6 +263,9 @@ void OS::DebugBreak() { |
#endif // V8_OS_NACL |
#elif V8_HOST_ARCH_X64 |
asm("int $3"); |
+#elif V8_HOST_ARCH_S390 |
+ // Software breakpoint instruction is 0x0001 |
+ asm volatile(".word 0x0001"); |
#else |
#error Unsupported host architecture. |
#endif |