Bug 666488 - [TM] Re-enable YARR on sparc. r=dvander.

This commit is contained in:
Leon Sha 2011-07-04 13:40:43 +08:00
Родитель 1cd66e91f8
Коммит ab24384a95
4 изменённых файлов: 34 добавлений и 3 удалений

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

@ -1011,7 +1011,7 @@
/* The JIT is enabled by default on all x86, x64-64, ARM & MIPS platforms. */
#if !defined(ENABLE_JIT) \
&& (WTF_CPU_X86 || WTF_CPU_X86_64 || WTF_CPU_ARM || WTF_CPU_MIPS) \
&& (WTF_CPU_X86 || WTF_CPU_X86_64 || WTF_CPU_ARM || WTF_CPU_MIPS || WTF_CPU_SPARC32) \
&& (WTF_OS_DARWIN || !WTF_COMPILER_GCC || GCC_VERSION_AT_LEAST(4, 1, 0)) \
&& !WTF_OS_WINCE
#define ENABLE_JIT 1

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

@ -34,7 +34,11 @@
namespace WTF {
#if WTF_CPU_SPARC
#define MINIMUM_BUMP_POOL_SIZE 0x2000
#else
#define MINIMUM_BUMP_POOL_SIZE 0x1000
#endif
class BumpPointerPool {
public:

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

@ -71,6 +71,16 @@ class YarrGenerator : private MacroAssembler {
static const RegisterID regT1 = SH4Registers::r1;
static const RegisterID returnRegister = SH4Registers::r0;
#elif WTF_CPU_SPARC
static const RegisterID input = SparcRegisters::i0;
static const RegisterID index = SparcRegisters::i1;
static const RegisterID length = SparcRegisters::i2;
static const RegisterID output = SparcRegisters::i3;
static const RegisterID regT0 = SparcRegisters::i4;
static const RegisterID regT1 = SparcRegisters::i5;
static const RegisterID returnRegister = SparcRegisters::i0;
#elif WTF_CPU_X86
static const RegisterID input = X86Registers::eax;
static const RegisterID index = X86Registers::edx;
@ -679,7 +689,11 @@ class YarrGenerator : private MacroAssembler {
UChar ch2 = nextTerm->patternCharacter;
int mask = 0;
#if WTF_CPU_BIG_ENDIAN
int chPair = ch2 | (ch << 16);
#else
int chPair = ch | (ch2 << 16);
#endif
if (m_pattern.m_ignoreCase) {
if (isASCIIAlpha(ch))
@ -2310,6 +2324,10 @@ class YarrGenerator : private MacroAssembler {
#elif WTF_CPU_SH4
push(SH4Registers::r11);
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
@ -2335,6 +2353,9 @@ class YarrGenerator : private MacroAssembler {
#elif WTF_CPU_SH4
pop(SH4Registers::r13);
pop(SH4Registers::r11);
#elif WTF_CPU_SPARC
ret_and_restore();
return;
#elif WTF_CPU_MIPS
// Do nothing
#endif

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

@ -39,6 +39,12 @@ namespace JSC { namespace Yarr {
#include "RegExpJitTables.h"
#if WTF_CPU_SPARC
#define BASE_FRAME_SIZE 24
#else
#define BASE_FRAME_SIZE 0
#endif
class CharacterClassConstructor {
public:
CharacterClassConstructor(bool isCaseInsensitive = false)
@ -678,7 +684,7 @@ public:
term.inputPosition = currentInputPosition;
} else {
term.inputPosition = currentInputPosition;
setupDisjunctionOffsets(term.parentheses.disjunction, 0, currentInputPosition);
setupDisjunctionOffsets(term.parentheses.disjunction, BASE_FRAME_SIZE, currentInputPosition);
currentCallFrameSize += YarrStackSpaceForBackTrackInfoParentheses;
}
// Fixed count of 1 could be accepted, if they have a fixed size *AND* if all alternatives are of the same length.
@ -725,7 +731,7 @@ public:
void setupOffsets()
{
setupDisjunctionOffsets(m_pattern.m_body, 0, 0);
setupDisjunctionOffsets(m_pattern.m_body, BASE_FRAME_SIZE, 0);
}
// This optimization identifies sets of parentheses that we will never need to backtrack.