Bug 689916 Fix yarr crashes on SPARC r=dmandelin

This commit is contained in:
Ginn Chen 2011-10-25 12:50:03 +08:00
Родитель a1019f02aa
Коммит d763025900
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -1205,8 +1205,10 @@ class YarrGenerator : private MacroAssembler {
// If we get here, the prior alternative matched - return success.
// Adjust the stack pointer to remove the pattern's frame.
#if !WTF_CPU_SPARC
if (m_pattern.m_body->m_callFrameSize)
addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
#endif
// Load appropriate values into the return register and the first output
// slot, and return. In the case of pattern with a fixed size, we will
@ -1513,8 +1515,10 @@ class YarrGenerator : private MacroAssembler {
}
case OpMatchFailed:
#if !WTF_CPU_SPARC
if (m_pattern.m_body->m_callFrameSize)
addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
#endif
move(TrustedImm32(-1), returnRegister);
generateReturn();
break;
@ -1753,8 +1757,10 @@ class YarrGenerator : private MacroAssembler {
// run any matches, and need to return a failure state from JIT code.
matchFailed.link(this);
#if !WTF_CPU_SPARC
if (m_pattern.m_body->m_callFrameSize)
addPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
#endif
move(TrustedImm32(-1), returnRegister);
generateReturn();
break;
@ -2326,8 +2332,6 @@ class YarrGenerator : private MacroAssembler {
push(SH4Registers::r13);
#elif WTF_CPU_SPARC
save(Imm32(-m_pattern.m_body->m_callFrameSize * sizeof(void*)));
// set m_callFrameSize to 0 avoid and stack movement later.
m_pattern.m_body->m_callFrameSize = 0;
#elif WTF_CPU_MIPS
// Do nothing.
#endif
@ -2377,8 +2381,10 @@ public:
if (!m_pattern.m_body->m_hasFixedSize)
store32(index, Address(output));
#if !WTF_CPU_SPARC
if (m_pattern.m_body->m_callFrameSize)
subPtr(Imm32(m_pattern.m_body->m_callFrameSize * sizeof(void*)), stackPointerRegister);
#endif
// Compile the pattern to the internal 'YarrOp' representation.
opCompileBody(m_pattern.m_body);