Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: src/jsregexp.cc

Issue 12469: * Better factoring of ARM/IA32 code in irregexp. (Closed)
Patch Set: Dropped the unifying ...-native.h file. Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames-inl.h ('k') | src/jsregexp-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(&macro_assembler,
node,
input->capture_count);
- }
#endif
+ }
byte codes[1024];
IrregexpAssembler assembler(Vector<byte>(codes, 1024));
RegExpMacroAssemblerIrregexp macro_assembler(&assembler);
« no previous file with comments | « src/frames-inl.h ('k') | src/jsregexp-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698