| Index: src/jsregexp.cc
|
| diff --git a/src/jsregexp.cc b/src/jsregexp.cc
|
| index f803a9ecb80012c1e388bb9bde98225351454185..154d2419ec9b0b7f49ca08995cad5192a5dbaa57 100644
|
| --- a/src/jsregexp.cc
|
| +++ b/src/jsregexp.cc
|
| @@ -43,11 +43,14 @@
|
| #include "assembler-irregexp.h"
|
| #include "regexp-macro-assembler.h"
|
| #include "regexp-macro-assembler-irregexp.h"
|
| -#if defined __arm__ || defined __thumb__ || defined ARM
|
| -// include regexp-macro-assembler-arm.h when created.
|
| -#else // ia32
|
| +
|
| +#ifdef ARM
|
| +#include "regexp-macro-assembler-arm.h"
|
| +#else // IA32
|
| +#include "macro-assembler-ia32.h"
|
| #include "regexp-macro-assembler-ia32.h"
|
| #endif
|
| +
|
| #include "interpreter-irregexp.h"
|
|
|
| // Including pcre.h undefines DEBUG to avoid getting debug output from
|
| @@ -516,6 +519,11 @@ Handle<Object> RegExpImpl::IrregexpExecOnce(Handle<JSRegExp> regexp,
|
| }
|
| break;
|
| }
|
| + default:
|
| + case RegExpMacroAssembler::kARMImplementation:
|
| + UNREACHABLE();
|
| + rc = false;
|
| + break;
|
| case RegExpMacroAssembler::kBytecodeImplementation: {
|
| Handle<ByteArray> byte_codes = IrregexpCode(regexp);
|
|
|
| @@ -525,11 +533,6 @@ Handle<Object> RegExpImpl::IrregexpExecOnce(Handle<JSRegExp> regexp,
|
| previous_index);
|
| break;
|
| }
|
| - case RegExpMacroAssembler::kARMImplementation:
|
| - default:
|
| - UNREACHABLE();
|
| - rc = false;
|
| - break;
|
| }
|
| }
|
|
|
| @@ -600,8 +603,8 @@ Handle<Object> RegExpImpl::JscreExecOnce(Handle<JSRegExp> regexp,
|
|
|
| class OffsetsVector {
|
| public:
|
| - inline OffsetsVector(int num_registers)
|
| - : offsets_vector_length_(num_registers) {
|
| + inline OffsetsVector(int num_registers) :
|
| + offsets_vector_length_(num_registers) {
|
| if (offsets_vector_length_ > kStaticOffsetsVectorSize) {
|
| vector_ = NewArray<int>(offsets_vector_length_);
|
| } else {
|
| @@ -640,8 +643,8 @@ int OffsetsVector::static_offsets_vector_[
|
|
|
|
|
| Handle<Object> RegExpImpl::IrregexpExec(Handle<JSRegExp> regexp,
|
| - Handle<String> subject,
|
| - Handle<Object> index) {
|
| + Handle<String> subject,
|
| + Handle<Object> index) {
|
| ASSERT_EQ(regexp->TypeTag(), JSRegExp::IRREGEXP);
|
| ASSERT(!regexp->DataAt(JSRegExp::kIrregexpDataIndex)->IsUndefined());
|
|
|
| @@ -804,7 +807,8 @@ Handle<Object> RegExpImpl::JscreExecGlobal(Handle<JSRegExp> regexp,
|
|
|
| int RegExpImpl::JscreNumberOfCaptures(Handle<JSRegExp> re) {
|
| FixedArray* value = FixedArray::cast(re->DataAt(JSRegExp::kJscreDataIndex));
|
| - return Smi::cast(value->get(kJscreNumberOfCapturesIndex))-> value();
|
| + return Smi::cast(value->get(kJscreNumberOfCapturesIndex))->
|
| + value();
|
| }
|
|
|
|
|
| @@ -2579,18 +2583,17 @@ Handle<FixedArray> RegExpEngine::Compile(RegExpParseResult* input,
|
| return Handle<FixedArray>::null();
|
| }
|
|
|
| -#if !(defined ARM || defined __arm__ || defined __thumb__)
|
| - if (FLAG_irregexp_native) { // Flag only checked in IA32 mode.
|
| - // TODO(lrn) Move compilation to a later point in the life-cycle
|
| - // of the RegExp. We don't know the type of input string yet.
|
| - // For now, always assume two-byte strings.
|
| + if (FLAG_irregexp_native) {
|
| +#ifdef ARM
|
| + UNIMPLEMENTED();
|
| +#else // IA32
|
| RegExpMacroAssemblerIA32 macro_assembler(RegExpMacroAssemblerIA32::UC16,
|
| (input->capture_count + 1) * 2);
|
| return compiler.Assemble(¯o_assembler,
|
| node,
|
| input->capture_count);
|
| - }
|
| #endif
|
| + }
|
| byte codes[1024];
|
| IrregexpAssembler assembler(Vector<byte>(codes, 1024));
|
| RegExpMacroAssemblerIrregexp macro_assembler(&assembler);
|
|
|