Modified: branches/safari-606-branch/Source/_javascript_Core/ChangeLog (237373 => 237374)
--- branches/safari-606-branch/Source/_javascript_Core/ChangeLog 2018-10-23 23:52:18 UTC (rev 237373)
+++ branches/safari-606-branch/Source/_javascript_Core/ChangeLog 2018-10-23 23:52:20 UTC (rev 237374)
@@ -1,5 +1,31 @@
2018-10-23 Kocsen Chung <[email protected]>
+ Cherry-pick r236606. rdar://problem/45285669
+
+ Gardening: speculative build fix.
+ <rdar://problem/44869924>
+
+ Not reviewed.
+
+ * assembler/LinkBuffer.cpp:
+ (JSC::LinkBuffer::copyCompactAndLinkCode):
+
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2018-09-28 Mark Lam <[email protected]>
+
+ Gardening: speculative build fix.
+ <rdar://problem/44869924>
+
+ Not reviewed.
+
+ * assembler/LinkBuffer.cpp:
+ (JSC::LinkBuffer::copyCompactAndLinkCode):
+
+2018-10-23 Kocsen Chung <[email protected]>
+
Cherry-pick r236589. rdar://problem/45285669
Verify the contents of AssemblerBuffer on arm64e
Modified: branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp (237373 => 237374)
--- branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp 2018-10-23 23:52:18 UTC (rev 237373)
+++ branches/safari-606-branch/Source/_javascript_Core/assembler/LinkBuffer.cpp 2018-10-23 23:52:20 UTC (rev 237374)
@@ -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)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
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)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
os_thread_self_restrict_rwx_to_rw();
#endif
@@ -140,12 +140,12 @@
ASSERT(!(regionSize % 2));
ASSERT(!(readPtr % 2));
ASSERT(!(writePtr % 2));
-#if CPU(ARM64E)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
unsigned index = readPtr;
#endif
while (copySource != copyEnd) {
InstructionType insn = *copySource++;
-#if CPU(ARM64E)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
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)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
unsigned index = readPtr;
#endif
for (size_t i = 0; i < bytes; i += sizeof(InstructionType)) {
InstructionType insn = *src++;
-#if CPU(ARM64E)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
verifyUncompactedHash.update(insn, index);
index += sizeof(InstructionType);
#endif
@@ -207,7 +207,7 @@
}
}
-#if CPU(ARM64E)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
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)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
auto memcpyFunction = memcpy;
#else
auto memcpyFunction = performJITMemcpy;
@@ -235,7 +235,7 @@
MacroAssembler::AssemblerType_T::fillNops(outData + compactSize, nopSizeInBytes, memcpy);
}
-#if CPU(ARM64E)
+#if CPU(ARM64E) && ENABLE(FAST_JIT_PERMISSIONS)
os_thread_self_restrict_rwx_to_rx();
#endif
@@ -244,7 +244,7 @@
m_executableMemory->shrink(m_size);
}
-#if !CPU(ARM64E)
+#if !CPU(ARM64E) || !ENABLE(FAST_JIT_PERMISSIONS)
ASSERT(codeOutData != outData);
performJITMemcpy(codeOutData, outData, m_size);
#else