Modified: branches/safari-606-branch/Source/_javascript_Core/ChangeLog (237436 => 237437)
--- branches/safari-606-branch/Source/_javascript_Core/ChangeLog 2018-10-25 23:59:43 UTC (rev 237436)
+++ branches/safari-606-branch/Source/_javascript_Core/ChangeLog 2018-10-26 00:11:24 UTC (rev 237437)
@@ -1,3 +1,7 @@
+2018-10-25 Kocsen Chung <[email protected]>
+
+ Revert r236606. rdar://problem/45285669
+
2018-10-23 Kocsen Chung <[email protected]>
Cherry-pick r236606. rdar://problem/45285669
Modified: branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp (237436 => 237437)
--- branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp 2018-10-25 23:59:43 UTC (rev 237436)
+++ branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp 2018-10-26 00:11:24 UTC (rev 237437)
@@ -110,7 +110,7 @@
uint8_t* inData = reinterpret_cast<uint8_t*>(m_assemblerStorage.buffer());
uint8_t* codeOutData = m_code.dataLocation<uint8_t*>();
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
const ARM64EHash assemblerBufferHash = macroAssembler.m_assembler.buffer().hash();
ARM64EHash verifyUncompactedHash(assemblerBufferHash.randomSeed());
uint8_t* outData = codeOutData;
@@ -123,7 +123,7 @@
int writePtr = 0;
unsigned jumpCount = jumpsToLink.size();
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
os_thread_self_restrict_rwx_to_rw();
#endif
@@ -140,12 +140,12 @@
ASSERT(!(regionSize % 2));
ASSERT(!(readPtr % 2));
ASSERT(!(writePtr % 2));
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
unsigned index = readPtr;
#endif
while (copySource != copyEnd) {
InstructionType insn = *copySource++;
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
static_assert(sizeof(InstructionType) == 4, "");
verifyUncompactedHash.update(insn, index);
index += sizeof(InstructionType);
@@ -193,13 +193,13 @@
RELEASE_ASSERT(bitwise_cast<uintptr_t>(src) % sizeof(InstructionType) == 0);
RELEASE_ASSERT(bytes % sizeof(InstructionType) == 0);
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
unsigned index = readPtr;
#endif
for (size_t i = 0; i < bytes; i += sizeof(InstructionType)) {
InstructionType insn = *src++;
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
verifyUncompactedHash.update(insn, index);
index += sizeof(InstructionType);
#endif
@@ -207,7 +207,7 @@
}
}
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
if (verifyUncompactedHash.hash() != assemblerBufferHash.hash()) {
dataLogLn("Hashes don't match: ", RawPointer(bitwise_cast<void*>(verifyUncompactedHash.hash())), " ", RawPointer(bitwise_cast<void*>(assemblerBufferHash.hash())));
dataLogLn("Crashing!");
@@ -218,7 +218,7 @@
recordLinkOffsets(m_assemblerStorage, readPtr, initialSize, readPtr - writePtr);
for (unsigned i = 0; i < jumpCount; ++i) {
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
auto memcpyFunction = memcpy;
#else
auto memcpyFunction = performJITMemcpy;
@@ -235,7 +235,7 @@
MacroAssembler::AssemblerType_T::fillNops(outData + compactSize, nopSizeInBytes, memcpy);
}
-#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
+#if CPU(ARM64E)
os_thread_self_restrict_rwx_to_rx();
#endif
@@ -244,7 +244,7 @@
m_executableMemory->shrink(m_size);
}
-#if !CPU(ARM64E) || !ENABLE(FAST_JIT_PERMISSIONS)
+#if !CPU(ARM64E)
ASSERT(codeOutData != outData);
performJITMemcpy(codeOutData, outData, m_size);
#else