Unreviewed, reverting r288400.
https://bugs.webkit.org/show_bug.cgi?id=235470
broke ARM64E build
Reverted changeset:
"[JSC][32bit] Fix regexp crash on ARMv7"
https://bugs.webkit.org/show_bug.cgi?id=234476
https://commits.webkit.org/r288400
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@288401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 6d248b4..ba18a83 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2022-01-21 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, reverting r288400.
+ https://bugs.webkit.org/show_bug.cgi?id=235470
+
+ broke ARM64E build
+
+ Reverted changeset:
+
+ "[JSC][32bit] Fix regexp crash on ARMv7"
+ https://bugs.webkit.org/show_bug.cgi?id=234476
+ https://commits.webkit.org/r288400
+
2022-01-21 Mikhail R. Gadelha <mikhail@igalia.com>
[JSC][32bit] Fix regexp crash on ARMv7
diff --git a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
index 3b156df..626f619 100644
--- a/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
+++ b/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp
@@ -2888,7 +2888,7 @@
{
UNUSED_PARAM(node);
ASSERT_NOT_REACHED();
- compileRegExpTest(node);
+ return compileRegExpTest(node);
}
#endif
diff --git a/Source/JavaScriptCore/jit/GPRInfo.h b/Source/JavaScriptCore/jit/GPRInfo.h
index 60a5bee..52a13aa 100644
--- a/Source/JavaScriptCore/jit/GPRInfo.h
+++ b/Source/JavaScriptCore/jit/GPRInfo.h
@@ -626,7 +626,7 @@
public:
typedef GPRReg RegisterType;
static constexpr unsigned numberOfRegisters = 16;
- static constexpr unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS;
+ static constexpr unsigned numberOfArgumentRegisters = 8;
// These registers match the baseline JIT.
static constexpr GPRReg callFrameRegister = ARM64Registers::fp;
@@ -825,7 +825,7 @@
public:
typedef GPRReg RegisterType;
static constexpr unsigned numberOfRegisters = 13;
- static constexpr unsigned numberOfArgumentRegisters = NUMBER_OF_ARGUMENT_REGISTERS;
+ static constexpr unsigned numberOfArgumentRegisters = 8;
static constexpr GPRReg callFrameRegister = RISCV64Registers::fp;
static constexpr GPRReg numberTagRegister = RISCV64Registers::x25;
diff --git a/Source/JavaScriptCore/runtime/RegExp.cpp b/Source/JavaScriptCore/runtime/RegExp.cpp
index 44909d1..1b8cd42 100644
--- a/Source/JavaScriptCore/runtime/RegExp.cpp
+++ b/Source/JavaScriptCore/runtime/RegExp.cpp
@@ -448,10 +448,10 @@
break;
case JITCode: {
Yarr::YarrCodeBlock& codeBlock = *m_regExpJITCode.get();
- snprintf(jit8BitMatchOnlyAddr, jitAddrSize, "0x%014" PRIxPTR, reinterpret_cast<uintptr_t>(codeBlock.get8BitMatchOnlyAddr()));
- snprintf(jit16BitMatchOnlyAddr, jitAddrSize, "0x%014" PRIxPTR, reinterpret_cast<uintptr_t>(codeBlock.get16BitMatchOnlyAddr()));
- snprintf(jit8BitMatchAddr, jitAddrSize, "0x%014" PRIxPTR, reinterpret_cast<uintptr_t>(codeBlock.get8BitMatchAddr()));
- snprintf(jit16BitMatchAddr, jitAddrSize, "0x%014" PRIxPTR, reinterpret_cast<uintptr_t>(codeBlock.get16BitMatchAddr()));
+ snprintf(jit8BitMatchOnlyAddr, jitAddrSize, "0x%014lx", reinterpret_cast<uintptr_t>(codeBlock.get8BitMatchOnlyAddr()));
+ snprintf(jit16BitMatchOnlyAddr, jitAddrSize, "0x%014lx", reinterpret_cast<uintptr_t>(codeBlock.get16BitMatchOnlyAddr()));
+ snprintf(jit8BitMatchAddr, jitAddrSize, "0x%014lx", reinterpret_cast<uintptr_t>(codeBlock.get8BitMatchAddr()));
+ snprintf(jit16BitMatchAddr, jitAddrSize, "0x%014lx", reinterpret_cast<uintptr_t>(codeBlock.get16BitMatchAddr()));
break;
}
}
diff --git a/Source/JavaScriptCore/runtime/RegExpInlines.h b/Source/JavaScriptCore/runtime/RegExpInlines.h
index 9c655f4..022cbba 100644
--- a/Source/JavaScriptCore/runtime/RegExpInlines.h
+++ b/Source/JavaScriptCore/runtime/RegExpInlines.h
@@ -132,12 +132,12 @@
if (m_state == JITCode) {
{
ASSERT(m_regExpJITCode);
- Yarr::MatchingContextHolder regExpContext(vm, m_regExpJITCode->usesPatternContextBuffer(), this, matchFrom);
+ Yarr::MatchingContextHolder regExpContext(vm, m_regExpJITCode.get(), this, matchFrom);
if (s.is8Bit())
- result = m_regExpJITCode->execute(s.characters8(), startOffset, s.length(), offsetVector, ®ExpContext).start;
+ result = m_regExpJITCode->execute(s.characters8(), startOffset, s.length(), offsetVector, regExpContext).start;
else
- result = m_regExpJITCode->execute(s.characters16(), startOffset, s.length(), offsetVector, ®ExpContext).start;
+ result = m_regExpJITCode->execute(s.characters16(), startOffset, s.length(), offsetVector, regExpContext).start;
}
if (result == static_cast<int>(Yarr::JSRegExpResult::JITCodeFailure)) {
@@ -146,8 +146,7 @@
if (m_state == ParseError)
return throwError();
{
- constexpr bool usesPatternContextBuffer = false;
- Yarr::MatchingContextHolder regExpContext(vm, usesPatternContextBuffer, this, matchFrom);
+ Yarr::MatchingContextHolder regExpContext(vm, nullptr, this, matchFrom);
result = Yarr::interpret(m_regExpBytecode.get(), s, startOffset, reinterpret_cast<unsigned*>(offsetVector));
}
}
@@ -163,8 +162,7 @@
} else
#endif
{
- constexpr bool usesPatternContextBuffer = false;
- Yarr::MatchingContextHolder regExpContext(vm, usesPatternContextBuffer, this, matchFrom);
+ Yarr::MatchingContextHolder regExpContext(vm, nullptr, this, matchFrom);
result = Yarr::interpret(m_regExpBytecode.get(), s, startOffset, reinterpret_cast<unsigned*>(offsetVector));
}
@@ -268,12 +266,12 @@
MatchResult result;
{
ASSERT(m_regExpJITCode);
- Yarr::MatchingContextHolder regExpContext(vm, m_regExpJITCode->usesPatternContextBuffer(), this, matchFrom);
+ Yarr::MatchingContextHolder regExpContext(vm, m_regExpJITCode.get(), this, matchFrom);
if (s.is8Bit())
- result = m_regExpJITCode->execute(s.characters8(), startOffset, s.length(), ®ExpContext);
+ result = m_regExpJITCode->execute(s.characters8(), startOffset, s.length(), regExpContext);
else
- result = m_regExpJITCode->execute(s.characters16(), startOffset, s.length(), ®ExpContext);
+ result = m_regExpJITCode->execute(s.characters16(), startOffset, s.length(), regExpContext);
}
#if ENABLE(REGEXP_TRACING)
@@ -297,8 +295,7 @@
nonReturnedOvector.grow(offsetVectorSize);
offsetVector = nonReturnedOvector.data();
{
- constexpr bool usesPatternContextBuffer = false;
- Yarr::MatchingContextHolder regExpContext(vm, usesPatternContextBuffer, this, matchFrom);
+ Yarr::MatchingContextHolder regExpContext(vm, nullptr, this, matchFrom);
result = Yarr::interpret(m_regExpBytecode.get(), s, startOffset, reinterpret_cast<unsigned*>(offsetVector));
}
#if REGEXP_FUNC_TEST_DATA_GEN
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.cpp b/Source/JavaScriptCore/yarr/YarrJIT.cpp
index 37aaca1..51ff4a7 100644
--- a/Source/JavaScriptCore/yarr/YarrJIT.cpp
+++ b/Source/JavaScriptCore/yarr/YarrJIT.cpp
@@ -27,7 +27,6 @@
#include "config.h"
#include "YarrJIT.h"
-#include "CCallHelpers.h"
#include "LinkBuffer.h"
#include "Options.h"
#include "VM.h"
@@ -187,6 +186,10 @@
template<class YarrJITRegs = YarrJITDefaultRegisters>
class YarrGenerator final : public YarrJITInfo {
+#ifdef JIT_UNICODE_EXPRESSIONS
+ const MacroAssembler::TrustedImm32 surrogateTagMask = MacroAssembler::TrustedImm32(0xfffffc00);
+#endif
+
#if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
struct ParenContextSizes {
size_t m_numSubpatterns;
@@ -600,7 +603,7 @@
m_jit.load16Unaligned(MacroAssembler::Address(m_regs.regUnicodeInputAndTrail), resultReg);
// Is the character a leading surrogate?
- m_jit.and32(m_regs.surrogateTagMask, resultReg, m_regs.unicodeTemp);
+ m_jit.and32(YarrJITDefaultRegisters::surrogateTagMask, resultReg, m_regs.unicodeTemp);
notUnicode.append(m_jit.branch32(MacroAssembler::NotEqual, m_regs.unicodeTemp, m_regs.leadingSurrogateTag));
// Is the input long enough to read a trailing surrogate?
@@ -609,7 +612,7 @@
// Is the character a trailing surrogate?
m_jit.load16Unaligned(MacroAssembler::Address(m_regs.regUnicodeInputAndTrail), m_regs.regUnicodeInputAndTrail);
- m_jit.and32(m_regs.surrogateTagMask, m_regs.regUnicodeInputAndTrail, m_regs.unicodeTemp);
+ m_jit.and32(YarrJITDefaultRegisters::surrogateTagMask, m_regs.regUnicodeInputAndTrail, m_regs.unicodeTemp);
notUnicode.append(m_jit.branch32(MacroAssembler::NotEqual, m_regs.unicodeTemp, m_regs.trailingSurrogateTag));
// Combine leading and trailing surrogates to produce a code point.
@@ -3958,71 +3961,57 @@
void generateEnter()
{
- auto pushInEnter = [&](GPRReg gpr) {
- m_jit.push(gpr);
- m_pushCountInEnter += 1;
- };
-
- auto pushPairInEnter = [&](GPRReg gpr1, GPRReg gpr2) {
- m_jit.pushPair(gpr1, gpr2);
- m_pushCountInEnter += 2;
- };
-
#if CPU(X86_64)
- UNUSED_VARIABLE(pushPairInEnter);
- m_jit.emitFunctionPrologue();
+ m_jit.push(X86Registers::ebp);
+ m_jit.move(MacroAssembler::stackPointerRegister, X86Registers::ebp);
if (m_pattern.m_saveInitialStartValue)
- pushInEnter(X86Registers::ebx);
+ m_jit.push(X86Registers::ebx);
#if OS(WINDOWS)
- pushInEnter(X86Registers::edi);
+ m_jit.push(X86Registers::edi);
#endif
#if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
if (m_containsNestedSubpatterns) {
#if OS(WINDOWS)
- pushInEnter(X86Registers::esi);
+ m_jit.push(X86Registers::esi);
#endif
- pushInEnter(X86Registers::r12);
+ m_jit.push(X86Registers::r12);
}
#endif
if (m_decodeSurrogatePairs) {
- pushInEnter(X86Registers::r13);
- pushInEnter(X86Registers::r14);
- pushInEnter(X86Registers::r15);
+ m_jit.push(X86Registers::r13);
+ m_jit.push(X86Registers::r14);
+ m_jit.push(X86Registers::r15);
}
#if OS(WINDOWS)
if (m_compileMode == JITCompileMode::IncludeSubpatterns)
- m_jit.loadPtr(MacroAssembler::Address(MacroAssembler::framePointerRegister, 6 * sizeof(void*)), m_regs.output);
+ m_jit.loadPtr(MacroAssembler::Address(X86Registers::ebp, 6 * sizeof(void*)), m_regs.output);
// rcx is the pointer to the allocated space for result in x64 Windows.
- pushInEnter(X86Registers::ecx);
+ m_jit.push(X86Registers::ecx);
#endif
#elif CPU(ARM64)
- UNUSED_VARIABLE(pushInEnter);
if (!Options::useJITCage())
m_jit.tagReturnAddress();
if (m_decodeSurrogatePairs) {
if (!Options::useJITCage())
- pushPairInEnter(MacroAssembler::framePointerRegister, MacroAssembler::linkRegister);
+ m_jit.pushPair(MacroAssembler::framePointerRegister, MacroAssembler::linkRegister);
m_jit.move(MacroAssembler::TrustedImm32(0x10000), m_regs.supplementaryPlanesBase);
m_jit.move(MacroAssembler::TrustedImm32(0xd800), m_regs.leadingSurrogateTag);
m_jit.move(MacroAssembler::TrustedImm32(0xdc00), m_regs.trailingSurrogateTag);
}
#elif CPU(ARM_THUMB2)
- UNUSED_VARIABLE(pushPairInEnter);
- pushInEnter(ARMRegisters::r4);
- pushInEnter(ARMRegisters::r5);
- pushInEnter(ARMRegisters::r6);
- pushInEnter(ARMRegisters::r8);
- pushInEnter(ARMRegisters::r10);
+ m_jit.push(ARMRegisters::r4);
+ m_jit.push(ARMRegisters::r5);
+ m_jit.push(ARMRegisters::r6);
+ m_jit.push(ARMRegisters::r8);
+ m_jit.push(ARMRegisters::r10);
#elif CPU(RISCV64)
- UNUSED_VARIABLE(pushInEnter);
if (m_decodeSurrogatePairs)
- pushPairInEnter(MacroAssembler::framePointerRegister, MacroAssembler::linkRegister);
-#else
- UNUSED_VARIABLE(pushInEnter);
- UNUSED_VARIABLE(pushPairInEnter);
+ m_jit.pushPair(MacroAssembler::framePointerRegister, MacroAssembler::linkRegister);
+#elif CPU(MIPS)
+ // Do nothing.
#endif
}
@@ -4063,7 +4052,7 @@
if (m_pattern.m_saveInitialStartValue)
m_jit.pop(X86Registers::ebx);
- m_jit.emitFunctionEpilogue();
+ m_jit.pop(X86Registers::ebp);
#elif CPU(ARM64)
if (m_decodeSurrogatePairs) {
if (!Options::useJITCage())
@@ -4078,8 +4067,9 @@
#elif CPU(RISCV64)
if (m_decodeSurrogatePairs)
m_jit.popPair(MacroAssembler::framePointerRegister, MacroAssembler::linkRegister);
+#elif CPU(MIPS)
+ // Do nothing
#endif
-
#if CPU(ARM64E)
if (Options::useJITCage())
m_jit.farJump(MacroAssembler::TrustedImmPtr(retagCodePtr<void*, CFunctionPtrTag, OperationPtrTag>(&vmEntryToYarrJITAfter)), OperationPtrTag);
@@ -4096,7 +4086,7 @@
}
public:
- YarrGenerator(CCallHelpers& jit, const VM* vm, YarrCodeBlock* codeBlock, const YarrJITRegs& regs, YarrPattern& pattern, const String& patternString, CharSize charSize, JITCompileMode compileMode)
+ YarrGenerator(MacroAssembler& jit, const VM* vm, YarrCodeBlock* codeBlock, const YarrJITRegs& regs, YarrPattern& pattern, const String& patternString, CharSize charSize, JITCompileMode compileMode)
: m_jit(jit)
, m_vm(vm)
, m_codeBlock(codeBlock)
@@ -4115,7 +4105,7 @@
m_boyerMooreData = static_cast<YarrBoyerMoyerData*>(m_codeBlock);
}
- YarrGenerator(CCallHelpers& jit, const VM* vm, YarrBoyerMoyerData* yarrBMData, const YarrJITRegs& regs, YarrPattern& pattern, const String& patternString, CharSize charSize, JITCompileMode compileMode)
+ YarrGenerator(MacroAssembler& jit, const VM* vm, YarrBoyerMoyerData* yarrBMData, const YarrJITRegs& regs, YarrPattern& pattern, const String& patternString, CharSize charSize, JITCompileMode compileMode)
: m_jit(jit)
, m_vm(vm)
, m_codeBlock(nullptr)
@@ -4149,13 +4139,6 @@
m_compilationThreadStackChecker = stackChecker;
}
- template<typename OperationType>
- static constexpr void functionChecks()
- {
- static_assert(FunctionTraits<OperationType>::cCallArity() == 5, "YarrJITCode takes 5 arguments");
- static_assert(std::is_same<MatchingContextHolder*, typename FunctionTraits<OperationType>::template ArgumentType<4>>::value, "MatchingContextHolder* is expected as the function 5th argument");
- }
-
void compile(YarrCodeBlock& codeBlock)
{
MacroAssembler::Label startOfMainCode;
@@ -4208,25 +4191,14 @@
if (callFrameSizeInBytes) {
// Check stack size
m_jit.addPtr(MacroAssembler::TrustedImm32(-callFrameSizeInBytes), MacroAssembler::stackPointerRegister, m_regs.regT0);
-
- // Make sure that the JITed functions have 5 parameters and that the 5th argument is a MatchingContextHolder*
- functionChecks<YarrCodeBlock::YarrJITCode8>();
- functionChecks<YarrCodeBlock::YarrJITCode16>();
- functionChecks<YarrCodeBlock::YarrJITCodeMatchOnly8>();
- functionChecks<YarrCodeBlock::YarrJITCodeMatchOnly16>();
#if CPU(X86_64) && OS(WINDOWS)
// matchingContext is the 5th argument, it is found on the stack.
MacroAssembler::RegisterID matchingContext = m_regs.regT1;
- m_jit.loadPtr(MacroAssembler::Address(MacroAssembler::framePointerRegister, 7 * sizeof(void*)), matchingContext);
+ m_jit.loadPtr(MacroAssembler::Address(X86Registers::ebp, 7 * sizeof(void*)), matchingContext);
#elif CPU(ARM_THUMB2) || CPU(MIPS)
- // Not enough argument registers: try to load the 5th argument from the stack
+ // matchingContext is the 5th argument, it is found on the stack.
MacroAssembler::RegisterID matchingContext = m_regs.regT1;
-
- // The argument will be in an offset that depends on the arch and the number of registers we pushed into the stack
- // POKE_ARGUMENT_OFFSET: MIPS reserves space in the stack for all arguments, so we add +4 offset
- // m_pushCountInEnter: number of registers pushed into the stack (see generateEnter())
- unsigned offset = POKE_ARGUMENT_OFFSET + m_pushCountInEnter;
- m_jit.loadPtr(MacroAssembler::Address(MacroAssembler::stackPointerRegister, offset * sizeof(void*)), matchingContext);
+ m_jit.loadPtr(MacroAssembler::Address(MacroAssembler::stackPointerRegister, 4 * sizeof(void*)), matchingContext);
#else
MacroAssembler::RegisterID matchingContext = m_regs.matchingContext;
#endif
@@ -4646,7 +4618,7 @@
}
private:
- CCallHelpers& m_jit;
+ MacroAssembler& m_jit;
const VM* m_vm;
YarrCodeBlock* m_codeBlock;
YarrBoyerMoyerData* m_boyerMooreData;
@@ -4700,12 +4672,6 @@
BacktrackingState m_backtrackingState;
std::unique_ptr<YarrDisassembler> m_disassembler;
-
- // Member is used to count the number of GPR pushed into the stack when
- // entering JITed code. It is used to figure out if an function argument
- // offset in the stack if there wasn't enough registers to pass it, e.g.,
- // ARMv7 and MIPS only use 4 registers to pass function arguments.
- unsigned m_pushCountInEnter { 0 };
};
static void dumpCompileFailure(JITFailureReason failure)
@@ -4740,7 +4706,7 @@
void jitCompile(YarrPattern& pattern, String& patternString, CharSize charSize, VM* vm, YarrCodeBlock& codeBlock, JITCompileMode mode)
{
- CCallHelpers masm;
+ MacroAssembler masm;
ASSERT(mode == JITCompileMode::MatchOnly || mode == JITCompileMode::IncludeSubpatterns);
@@ -4761,7 +4727,7 @@
#error "No support for inlined JIT'ing of RegExp.test for this CPU / OS combination."
#endif
-void jitCompileInlinedTest(StackCheck* m_compilationThreadStackChecker, const String& patternString, OptionSet<Yarr::Flags> flags, CharSize charSize, const VM* vm, YarrBoyerMoyerData& boyerMooreData, CCallHelpers& jit, YarrJITRegisters& jitRegisters)
+void jitCompileInlinedTest(StackCheck* m_compilationThreadStackChecker, const String& patternString, OptionSet<Yarr::Flags> flags, CharSize charSize, const VM* vm, YarrBoyerMoyerData& boyerMooreData, MacroAssembler& jit, YarrJITRegisters& jitRegisters)
{
Yarr::ErrorCode errorCode;
Yarr::YarrPattern pattern(patternString, flags, errorCode);
diff --git a/Source/JavaScriptCore/yarr/YarrJIT.h b/Source/JavaScriptCore/yarr/YarrJIT.h
index 69bde8b..289d6e8 100644
--- a/Source/JavaScriptCore/yarr/YarrJIT.h
+++ b/Source/JavaScriptCore/yarr/YarrJIT.h
@@ -43,10 +43,9 @@
namespace JSC {
-class CCallHelpers;
+class VM;
class ExecutablePool;
class MacroAssembler;
-class VM;
namespace Yarr {
@@ -272,12 +271,12 @@
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(YarrCodeBlock);
-public:
- using YarrJITCode8 = SlowPathReturnType (*)(const LChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder*) YARR_CALL;
- using YarrJITCode16 = SlowPathReturnType (*)(const UChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder*) YARR_CALL;
- using YarrJITCodeMatchOnly8 = SlowPathReturnType (*)(const LChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder*) YARR_CALL;
- using YarrJITCodeMatchOnly16 = SlowPathReturnType (*)(const UChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder*) YARR_CALL;
+ using YarrJITCode8 = SlowPathReturnType (*)(const LChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
+ using YarrJITCode16 = SlowPathReturnType (*)(const UChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
+ using YarrJITCodeMatchOnly8 = SlowPathReturnType (*)(const LChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
+ using YarrJITCodeMatchOnly16 = SlowPathReturnType (*)(const UChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
+public:
YarrCodeBlock() = default;
void setFallBackWithFailureReason(JITFailureReason failureReason) { m_failureReason = failureReason; }
@@ -327,7 +326,7 @@
InlineStats& get8BitInlineStats() { return m_matchOnly8Stats; }
InlineStats& get16BitInlineStats() { return m_matchOnly16Stats; }
- MatchResult execute(const LChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder* matchingContext)
+ MatchResult execute(const LChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder& matchingContext)
{
ASSERT(has8BitCode());
#if CPU(ARM64E)
@@ -337,7 +336,7 @@
return MatchResult(untagCFunctionPtr<YarrJITCode8, Yarr8BitPtrTag>(m_ref8.code().executableAddress())(input, start, length, output, matchingContext));
}
- MatchResult execute(const UChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder* matchingContext)
+ MatchResult execute(const UChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder& matchingContext)
{
ASSERT(has16BitCode());
#if CPU(ARM64E)
@@ -347,7 +346,7 @@
return MatchResult(untagCFunctionPtr<YarrJITCode16, Yarr16BitPtrTag>(m_ref16.code().executableAddress())(input, start, length, output, matchingContext));
}
- MatchResult execute(const LChar* input, unsigned start, unsigned length, MatchingContextHolder* matchingContext)
+ MatchResult execute(const LChar* input, unsigned start, unsigned length, MatchingContextHolder& matchingContext)
{
ASSERT(has8BitCodeMatchOnly());
#if CPU(ARM64E)
@@ -357,7 +356,7 @@
return MatchResult(untagCFunctionPtr<YarrJITCodeMatchOnly8, YarrMatchOnly8BitPtrTag>(m_matchOnly8.code().executableAddress())(input, start, length, nullptr, matchingContext));
}
- MatchResult execute(const UChar* input, unsigned start, unsigned length, MatchingContextHolder* matchingContext)
+ MatchResult execute(const UChar* input, unsigned start, unsigned length, MatchingContextHolder& matchingContext)
{
ASSERT(has16BitCodeMatchOnly());
#if CPU(ARM64E)
@@ -440,7 +439,7 @@
class YarrJITRegisters;
-void jitCompileInlinedTest(StackCheck*, const String&, OptionSet<Yarr::Flags>, CharSize, const VM*, YarrBoyerMoyerData&, CCallHelpers&, YarrJITRegisters&);
+void jitCompileInlinedTest(StackCheck*, const String&, OptionSet<Yarr::Flags>, CharSize, const VM*, YarrBoyerMoyerData&, MacroAssembler&, YarrJITRegisters&);
#endif
} } // namespace JSC::Yarr
diff --git a/Source/JavaScriptCore/yarr/YarrJITRegisters.h b/Source/JavaScriptCore/yarr/YarrJITRegisters.h
index de57784..bb821ce 100644
--- a/Source/JavaScriptCore/yarr/YarrJITRegisters.h
+++ b/Source/JavaScriptCore/yarr/YarrJITRegisters.h
@@ -206,7 +206,6 @@
const MacroAssembler::TrustedImm32 supplementaryPlanesBase = MacroAssembler::TrustedImm32(0x10000);
const MacroAssembler::TrustedImm32 leadingSurrogateTag = MacroAssembler::TrustedImm32(0xd800);
const MacroAssembler::TrustedImm32 trailingSurrogateTag = MacroAssembler::TrustedImm32(0xdc00);
- const MacroAssembler::TrustedImm32 surrogateTagMask = MacroAssembler::TrustedImm32(0xfffffc00);
};
#endif
diff --git a/Source/JavaScriptCore/yarr/YarrMatchingContextHolder.h b/Source/JavaScriptCore/yarr/YarrMatchingContextHolder.h
index 1af8309..139d1fe 100644
--- a/Source/JavaScriptCore/yarr/YarrMatchingContextHolder.h
+++ b/Source/JavaScriptCore/yarr/YarrMatchingContextHolder.h
@@ -37,10 +37,12 @@
namespace Yarr {
+class YarrCodeBlock;
+
class MatchingContextHolder {
WTF_FORBID_HEAP_ALLOCATION;
public:
- MatchingContextHolder(VM&, bool, RegExp*, MatchFrom);
+ MatchingContextHolder(VM&, YarrCodeBlock*, RegExp*, MatchFrom);
~MatchingContextHolder();
static ptrdiff_t offsetOfStackLimit() { return OBJECT_OFFSETOF(MatchingContextHolder, m_stackLimit); }
@@ -59,7 +61,7 @@
MatchFrom m_matchFrom;
};
-inline MatchingContextHolder::MatchingContextHolder(VM& vm, bool usesPatternContextBuffer, RegExp* regExp, MatchFrom matchFrom)
+inline MatchingContextHolder::MatchingContextHolder(VM& vm, YarrCodeBlock* yarrCodeBlock, RegExp* regExp, MatchFrom matchFrom)
: m_vm(vm)
, m_matchFrom(matchFrom)
{
@@ -72,12 +74,12 @@
}
#if ENABLE(YARR_JIT_ALL_PARENS_EXPRESSIONS)
- if (usesPatternContextBuffer) {
+ if (yarrCodeBlock && yarrCodeBlock->usesPatternContextBuffer()) {
m_patternContextBuffer = m_vm.acquireRegExpPatternContexBuffer();
m_patternContextBufferSize = VM::patternContextBufferSize;
}
#else
- UNUSED_PARAM(usesPatternContextBuffer);
+ UNUSED_PARAM(yarrCodeBlock);
#endif
}
diff --git a/Source/bmalloc/ChangeLog b/Source/bmalloc/ChangeLog
index 2341da0..58b73e6 100644
--- a/Source/bmalloc/ChangeLog
+++ b/Source/bmalloc/ChangeLog
@@ -1,3 +1,16 @@
+2022-01-21 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, reverting r288400.
+ https://bugs.webkit.org/show_bug.cgi?id=235470
+
+ broke ARM64E build
+
+ Reverted changeset:
+
+ "[JSC][32bit] Fix regexp crash on ARMv7"
+ https://bugs.webkit.org/show_bug.cgi?id=234476
+ https://commits.webkit.org/r288400
+
2022-01-21 Yusuke Suzuki <ysuzuki@apple.com>
[libpas] Follow-up after r288339
diff --git a/Source/bmalloc/bmalloc/Heap.cpp b/Source/bmalloc/bmalloc/Heap.cpp
index 40f1d75..04fbcca 100644
--- a/Source/bmalloc/bmalloc/Heap.cpp
+++ b/Source/bmalloc/bmalloc/Heap.cpp
@@ -105,7 +105,7 @@
BINLINE void Heap::logStat(size_t value, ssize_t amount, const char* label, const char* note)
{
- fprintf(stderr, "%s: %zu (%zd) %s\n", label, value, amount, note);
+ fprintf(stderr, "%s: %lu (%ld) %s\n", label, value, amount, note);
}
BINLINE void Heap::adjustFreeableMemory(UniqueLockHolder&, ssize_t amount, const char* note)